|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100 8 K0 ?9 C8 |' n2 I2 u1 J7 E; D6 p
[Huawei-vlan100]q - P2 e' U- }9 L2 v5 s
[Huawei]acl number 2000 ( _( F, q( S6 Z0 l2 @
[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255 ( N9 g0 p( |- x& b* e8 U0 M
[Huawei-acl-basic-2000]q " ^8 s( h- L& s' f7 y$ I" W5 j7 u
[Huawei]interface giga 0/0/0 ( G" o6 q% J' ~, a* _
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0 - t& `" U3 d/ T5 K
[Huawei-GigabitEthernet0/0/0] 6 r) L. C. J/ o" i# s) b5 K% f
Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
3 K+ ^1 g( W0 K# NIP on the interface GigabitEthernet0/0/0 has entered the UP state.
7 v4 O5 J6 l% i4 ^/ V V[Huawei-GigabitEthernet0/0/0]q ( f6 Z9 h) j0 ~, O
[Huawei]interface giga 0/0/1
5 C' k4 ~# o# l1 J) u2 q3 ~- B5 E[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 7 o; Z2 E9 v; z' s
[Huawei-GigabitEthernet0/0/1]q 7 |5 {/ f# T, }% e7 @8 A$ n
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 * p& ^4 W4 [4 \
[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2 , G8 V9 B6 o8 G
[Huawei]q
0 R: P6 L. s7 S) k# I) C. r4 x$ h: rsave 0 T; `1 }: }2 s; z5 t
The current configuration will be written to the device. 2 @2 K% T5 n* R. z8 h9 n( Z
Are you sure to continue? (y/n)[n]:y
E) f4 @5 n9 ]6 a r4 V' x0 x8 | It will take several minutes to save configuration file, please wait..........
3 u! A: \5 ~8 X8 e: A5 k. z1 ]) n- `8 u! H9 }' \
& F3 H7 }8 u" ]! M8 Y+ R
Configuration file had been saved successfully
) J1 ]6 t8 x% [% J0 s Note: The configuration file will take effect after being activated
+ @4 J2 b8 f1 W( [+ z2 Y) ]
! b6 F1 ]" P! q* L1 l BMar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648
2 i: b) j4 k% Y- E: Y! s.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 2 a. `( i, h2 | ^9 U
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf
+ e5 u$ q1 X7 s& A" K2 y' Uace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0
; d6 g, K8 Q* q0 l' g, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla
" B) l' ^* X: B, T* C3 J- xn=0, Receive CE vlan=0, IP conflict type=Remote IP conflict).
) I* } }% X( x) g
( R) D0 p' a. z3 u8 Z
0 r* i2 Y! C9 V! g a( u0 n- L
接下来配置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.
, V; H/ k# l: D) n& {7 U[Huawei] " t# d9 W! Q6 O% K" B
Mar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. % y( |5 N+ P% h) U5 A
25.191.3.1 configurations have been changed. The current change number is 4, the & M) k4 y# e; ?2 }
change loop count is 0, and the maximum number of records is 4095.
3 X; Y- H8 \/ }. c' g[Huawei]interface vlanif 100
5 }6 P, j k; W9 v# Z# p2 x+ a[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0 / z- U5 K5 d7 Q" a
[Huawei-Vlanif100] 3 K* E# V4 N5 J* C5 w( H3 q
Mar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
& ]% A$ L1 ~1 P" V, Y/ b) y25.191.3.1 configurations have been changed. The current change number is 6, the . s/ H+ N1 s# I( l% N
change loop count is 0, and the maximum number of records is 4095.
6 x1 b5 d, q1 i3 u, w) a1 \9 Q[Huawei-Vlanif100]q
' ~0 s' X. m9 R6 L8 |3 K[Huawei]interface giga 0/0/1 & P* G& V- Z) Y6 h7 @
[Huawei-GigabitEthernet0/0/1]port link-type access 7 ~7 ]- E1 _3 h& n( ?
[Huawei-GigabitEthernet0/0/1]port default vlan 100
, o) B0 D7 n; O3 F; S[Huawei-GigabitEthernet0/0/1]q
4 Q8 [! \* m {5 S. f[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
- B6 s( v& ]; ~% I) q. {: D[Huawei]
9 _$ w5 [$ M R* N) p+ ?, s. I% nMar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. , _, f7 I- q+ B( g8 c* V
25.191.3.1 configurations have been changed. The current change number is 9, the * E3 Q6 `' O$ x7 X" b
change loop count is 0, and the maximum number of records is 4095.
7 m; d" y& o* N+ w3 Y# J' l9 l[Huawei]interface vlanif 1
- @4 w& `* w3 H3 |7 c; D4 @4 Q1 k" i[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0 ' j- D( Y. W: n8 ?4 c% w8 j* V
[Huawei-Vlanif1]q
* f1 E) }) A# T3 V. \. ~[Huawei]interface vlanif 2 ! B% y9 w9 G q4 i. b
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
0 z$ W) V4 w+ \! R8 p" _[Huawei-Vlanif2]q
! I9 |+ s: U2 H# ]7 z; N[Huawei]interface giga 0/0/3 & q: m+ j! P: k! l& ^
[Huawei-GigabitEthernet0/0/3]port link-type access 3 N- E5 v i# _- d9 C* b9 m9 i
[Huawei-GigabitEthernet0/0/3]port default vlan 2
U& s% k) k6 a" W2 [; t- C" {$ y[Huawei-GigabitEthernet0/0/3] & I/ X6 {* D$ ~2 K" q
[Huawei]q - I: s$ V( K, v2 o) _1 n; c" c
save
9 |# U9 `$ r4 s2 u- `; xThe current configuration will be written to the device.
& ?% H& U9 |7 }" E$ w5 TAre you sure to continue?[Y/N]y
6 o/ y9 t: W, ` JNow saving the current configuration to the slot 0.
9 B) [% g4 y E5 m* ~ G& `Mar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
g: e; X5 v* ?4 B2 o/ N/ kiding whether to save the configuration to the device.
! o0 w8 R3 ^% M: o1 hSave the configuration successfully. 7 h9 e- Z$ j8 E4 l$ W
! J; }" P: N# U" M2 Q' l
然后设置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便可以了.需要的可以下载附件导出配置文件看. a7 M W' I0 Q O& Y
! X. }2 o7 i1 X+ F; C0 @
3 B/ B: I, X Q
|