|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100
6 O$ B, f: X$ q, U$ b[Huawei-vlan100]q
0 G7 ]0 j. V) h _[Huawei]acl number 2000
1 X2 A( n! P* K6 Q[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255 # N1 X" \3 b+ J) @ y' @' f: C
[Huawei-acl-basic-2000]q
, ^5 h0 O6 c( x4 y[Huawei]interface giga 0/0/0
- I5 ~4 o2 T5 p/ \! k[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0
; M; X1 }0 _ U; M" d' {0 j[Huawei-GigabitEthernet0/0/0] - I. a1 n I8 k0 g5 G, E
Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol 3 L1 o# | f9 W8 O
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
% H8 ~" x3 g2 [8 w1 ][Huawei-GigabitEthernet0/0/0]q
& S0 J0 w& G( s* ^[Huawei]interface giga 0/0/1 . ?' r8 p! b% W( T+ J
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 - e; `6 ]2 W' j. `8 I% {! `
[Huawei-GigabitEthernet0/0/1]q 7 x2 z5 Q, X5 g" q
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 ' D/ L* l. `7 D4 q& r Y
[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2
* V, V/ F4 U/ ~# E2 }5 D0 k9 s[Huawei]q 6 w7 @9 B8 S- X E( V1 {
save
5 r3 z" ]( O+ i The current configuration will be written to the device. ; ^/ i" l& J7 `8 c( K1 v
Are you sure to continue? (y/n)[n]:y
8 U4 g, }* v$ S3 l# a9 V; P' \7 a It will take several minutes to save configuration file, please wait.......... ( o, E$ t7 B, o( a' D" H' ^
/ |: G; O4 ] x+ S- ?8 d, ]0 q4 _
Configuration file had been saved successfully , \+ I. m8 q9 A5 L* G; d) s% t& }
Note: The configuration file will take effect after being activated
" _$ d4 `6 `3 u; }8 v) l2 b7 g: ^. O2 P1 {+ \3 W/ H
Mar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648 9 \* I$ i+ F$ p* W
.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33
; u1 r, H; ~5 z/ h, B1 g. i0 D554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf
/ C) r5 J7 E' Z# Q' ]. i0 g: eace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0 3 C& A% A- G- S! B3 s2 C5 ^
, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla : t7 P% S6 r X$ O. h q1 c, ?" Z+ L
n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict). 4 V/ ?8 k* Q. `& C% X: Z# L( ]/ x
9 y; B8 @- D& m) R- U- ]. W. ]' T: `7 X1 ?5 x
接下来配置S5700交换机,GE1接口IP为1.1.1.2,属于vlan100,GE2接口属于vlan1,GE3接口属于vlan2,代码如下
[Huawei]vlan batch 2 4 6 8 100 Info: This operation may take a few seconds. Please wait for a moment...done.
2 \1 M3 Y" q7 O1 ?[Huawei]
% z$ [. h- z/ ?, r; V jMar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
5 e( W# X- G3 ?% i+ t' X& U25.191.3.1 configurations have been changed. The current change number is 4, the & J3 L( A) \; P' [
change loop count is 0, and the maximum number of records is 4095.
1 V) x* u9 T! O8 _3 P$ H0 W9 H[Huawei]interface vlanif 100 # l; @% ?# G8 B, C
[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0
# a2 j! t. y, P& s[Huawei-Vlanif100]
+ E" d4 O5 r* P( U0 b+ V! { ZMar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. : D) U8 B; q8 q+ l( a0 G9 o7 V
25.191.3.1 configurations have been changed. The current change number is 6, the
( }0 B; \" ^8 _. o8 g5 f( Pchange loop count is 0, and the maximum number of records is 4095. " O& s' e7 G2 j6 o6 k: S
[Huawei-Vlanif100]q
, m/ x: R0 @4 a6 `. W+ A[Huawei]interface giga 0/0/1 B3 v8 z0 E3 `% b+ `
[Huawei-GigabitEthernet0/0/1]port link-type access ; N' K* V: z! } Z6 {
[Huawei-GigabitEthernet0/0/1]port default vlan 100 ) h8 F- |6 A; i* L0 i5 g8 q$ H
[Huawei-GigabitEthernet0/0/1]q
N/ K# P% F) [& a* G9 p3 k% S% Z[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 1 {! ^6 m: p# N( n
[Huawei] # _+ b% z7 Z0 n$ s3 I) d. l
Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. 8 p* j4 ~) U' `2 L
25.191.3.1 configurations have been changed. The current change number is 9, the
# D9 V/ Z, Q* @$ Schange loop count is 0, and the maximum number of records is 4095.
- b+ n* y% [! C. a7 P2 ]: h- b. _[Huawei]interface vlanif 1
3 A0 l) f4 p5 p. Y' F. `[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
# J" G! W! u3 b v7 {5 Z' Z2 Y[Huawei-Vlanif1]q
/ H' s4 Y. Q* K[Huawei]interface vlanif 2
7 c# }# Q0 ~6 G; p0 _% F[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0 - T! h9 ]6 j3 v' G, s
[Huawei-Vlanif2]q 4 N+ U4 ]2 [& l. R4 G% A1 i2 B
[Huawei]interface giga 0/0/3
" G7 [+ J0 G0 D& C! u" }[Huawei-GigabitEthernet0/0/3]port link-type access
/ g& e( w2 U$ ^[Huawei-GigabitEthernet0/0/3]port default vlan 2 . x+ O. S7 H% C" @! Q
[Huawei-GigabitEthernet0/0/3] # F- N- v* w# ?
[Huawei]q : G: S- H3 R0 r& S
save % ]; P, c$ Z& g1 l7 L$ X% d: x
The current configuration will be written to the device.
3 k: ^7 Q8 D% L( \9 \* uAre you sure to continue?[Y/N]y " R7 {' w6 P3 t2 D# q
Now saving the current configuration to the slot 0.
! `9 K0 Z+ ^0 b2 E) z1 oMar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec 4 W0 [* U5 [$ D/ [1 O# p. a, p
iding whether to save the configuration to the device.
) U1 Z: w, j2 ~; H: b" cSave the configuration successfully.
; v! Y4 Y6 l& Z A4 ]
; U G& }3 s2 {+ k9 A( Z+ n% e- f
然后设置PC1和PC2的IP地址,先ping 1.1.1.1,如果没有问题再ping 192.168.1.3,192.168.1.111,202.99.192.66,一路ping下来是不是感觉有点小成就感,如果PC2无法ping通,那么就像昨天一样,在自己的真实路由器上做个静态路由指向192.168.2.0便可以了.需要的可以下载附件导出配置文件看.
! E* v$ N' b0 K# J8 P+ V5 o d* H5 t. u( k9 Y: a
# b r+ m' v7 Z4 [' k |