|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100
/ ^: `, |# y' M5 k8 L[Huawei-vlan100]q . y3 Y/ e2 f' f& _- i$ a5 H% V
[Huawei]acl number 2000
3 o! @. J" e% v) l[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255 ; d A/ O+ k& u& p; s
[Huawei-acl-basic-2000]q 5 [4 R+ s$ k- Z% R
[Huawei]interface giga 0/0/0 . d1 k* N" J( J% |3 S. j: L3 I. q
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0 C: b% `1 V4 @: L: }
[Huawei-GigabitEthernet0/0/0] 8 ]1 T+ s2 ?% J- O( Y4 k
Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
- D$ S" Y' F" |IP on the interface GigabitEthernet0/0/0 has entered the UP state. : U! N! g/ P5 K* b0 [) g V
[Huawei-GigabitEthernet0/0/0]q
8 m9 p( _2 @6 X5 z" w[Huawei]interface giga 0/0/1 ?, I0 H. _- {) B5 ^+ C: S# p
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 % n8 I L% F( i8 f6 A
[Huawei-GigabitEthernet0/0/1]q ) B0 d3 a0 j- |6 a. f0 j
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
4 n! O$ I; s+ j- J+ ]" \' u[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2 C3 q" D3 v6 ] T. L
[Huawei]q
$ r/ L& n, U5 d( a2 vsave " w( l b: [, d8 z1 u4 r2 p/ E
The current configuration will be written to the device.
2 O* J" Z0 W* L, l* f Are you sure to continue? (y/n)[n]:y
- X) I8 f$ n! R, v$ Z It will take several minutes to save configuration file, please wait..........
$ o$ n& p, ]% h* O2 z' p) X
) M! w+ A2 U5 i9 l, b" U+ i3 ^
# w; k. g0 a; {6 X) e Configuration file had been saved successfully % z5 @8 e6 K! D% J2 u8 q
Note: The configuration file will take effect after being activated 3 s' M6 {! u5 T5 U3 {; n
: Q k% n" R9 Z/ O5 J
Mar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648 ) N8 }* s m; b: `
.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33
' b F: i& A# Q2 `) Z& D554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf
; M0 R8 a2 o! K( \- l& Xace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0
. H8 G' C5 D, \ d/ O, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla
8 y+ j7 _- l- ?1 F6 ~9 r4 A. nn=0, Receive CE vlan=0, IP conflict type=Remote IP conflict).
) s" F, K" e7 m$ o6 j' u; M6 M5 X: f" s. ]/ s- V
% C0 k8 k r$ Y; Q: v: {
接下来配置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.
- _5 {5 e% `( p5 n' R6 \[Huawei] 2 b$ H& u' d0 l, _5 G0 g/ I
Mar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. + ?& p9 ?6 I. n7 Y* Z
25.191.3.1 configurations have been changed. The current change number is 4, the 3 H/ r' j _& x. Z, `4 K" p
change loop count is 0, and the maximum number of records is 4095. " l+ k2 k: X. K: d4 ]4 M: ]% {- N# Y
[Huawei]interface vlanif 100
- E, H- U0 T, `; R( G4 |[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0
- ^: l: z5 y) ~ T6 v6 X& c[Huawei-Vlanif100]
5 p3 V0 c6 d. B! ZMar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. ( d: q) O% R" S8 G. j
25.191.3.1 configurations have been changed. The current change number is 6, the 5 j# \3 a" G" V8 i1 ^# d0 m& d
change loop count is 0, and the maximum number of records is 4095.
' |( }+ y. e1 z8 y[Huawei-Vlanif100]q ( D1 `& w* j; @: l* r3 J
[Huawei]interface giga 0/0/1
) t( w& w; ~$ c5 _[Huawei-GigabitEthernet0/0/1]port link-type access
: C i3 G$ ?5 u: k+ \7 s[Huawei-GigabitEthernet0/0/1]port default vlan 100
' ~0 ?6 f: k6 k& n# u[Huawei-GigabitEthernet0/0/1]q
$ I* O+ n3 W+ X: b[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 ! U7 B8 N7 u0 k( Y# [( k$ P
[Huawei] ; {+ V. j# P7 H$ Z/ {0 m, K
Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
: W6 ^& v8 Q$ N/ Z& g! B25.191.3.1 configurations have been changed. The current change number is 9, the ! Y8 r# W3 b4 c# C: _5 ~4 {4 f
change loop count is 0, and the maximum number of records is 4095.
! q9 s3 h+ \5 d. j' j: R% d[Huawei]interface vlanif 1
- e$ m! U$ T. o; R# E[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
* g9 w3 C' Q! ]7 C[Huawei-Vlanif1]q 7 s3 A$ e9 ]) P" u$ I* }/ c: m5 D, E
[Huawei]interface vlanif 2 1 j& Y" S2 ^; g. Z9 a/ y3 \
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
& O( w. @. L3 o0 U" f2 |[Huawei-Vlanif2]q ! j. _5 e( X- \ ^/ b6 Q! P' |/ I/ g
[Huawei]interface giga 0/0/3
2 P; r. O9 @) ~! I/ f. l7 T[Huawei-GigabitEthernet0/0/3]port link-type access
3 O/ ?+ s; n" [8 k+ t3 N! A* W[Huawei-GigabitEthernet0/0/3]port default vlan 2 & y: I2 _5 m( d6 X( [. n
[Huawei-GigabitEthernet0/0/3] : g6 Y: [) U% q$ ]8 P, e
[Huawei]q ( }# h M- U3 H1 @* d, K3 T( i' L6 o
save 8 ^* k5 [3 g1 T0 z
The current configuration will be written to the device.
0 q+ |- g7 c5 m- J. o2 OAre you sure to continue?[Y/N]y 5 H/ P2 z1 E7 I) H/ X1 j# b
Now saving the current configuration to the slot 0.
O& H/ e( U; A2 rMar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec ) L0 h! Y' D( O" U' @0 K* _
iding whether to save the configuration to the device.
9 Y- \6 k9 a) z- [Save the configuration successfully. p1 `' d; o3 ~
0 [) N6 K2 Y, Q/ ?2 B. j; o
然后设置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便可以了.需要的可以下载附件导出配置文件看. ! X9 g4 l1 l- D' X1 q% W
. I) b, l$ M. D, W$ H. O# N
& y! [( [5 v/ ^* t# v6 ~ |