|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100 + d+ A/ M! t* b7 Z! e" j3 _3 g
[Huawei-vlan100]q / e0 n x) D% G; T% d2 N
[Huawei]acl number 2000 # c7 `& @6 h/ \- c4 r
[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255 ( z7 T* S( L% u( u7 g# G _" s" r
[Huawei-acl-basic-2000]q
, K% C6 Z+ y! g. U9 A) k3 a B: L* l[Huawei]interface giga 0/0/0 : y# r3 I# g' O! p; K9 \
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0 4 S0 @2 R4 R- M' u- @
[Huawei-GigabitEthernet0/0/0] % Y! l% d3 F9 j+ }3 T
Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol " T4 B) ^: h# I% T$ y' F
IP on the interface GigabitEthernet0/0/0 has entered the UP state. ) h: ?; j# ~0 P1 P
[Huawei-GigabitEthernet0/0/0]q
* Y m* B) ]1 `[Huawei]interface giga 0/0/1 : G. M. ^. L8 R+ J! k" @
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 i4 X2 s" i2 ?5 z T7 d( R+ J8 O
[Huawei-GigabitEthernet0/0/1]q ( {, Q$ }" \: U! I% M* Y
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
( T) @' n' f, m0 t! n2 N[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2 ( j0 K/ t9 p4 F6 C2 }
[Huawei]q
W: w# I- [: ~save 9 p! E; J5 G8 @+ ]4 ~ n
The current configuration will be written to the device.
% ?+ X: b }3 _8 f Are you sure to continue? (y/n)[n]:y " Y" I* T y) F
It will take several minutes to save configuration file, please wait..........
9 W3 G/ L! o$ z8 ?! \( @& }' G" L
! ]1 N& P8 q X. i8 g# Z
Configuration file had been saved successfully + h, P6 {0 b4 w1 }6 x
Note: The configuration file will take effect after being activated
( A- X4 w" B; A2 \
) ^( D' _8 W; ^4 q* c! SMar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648
2 O3 E* y7 @1 d; l+ c.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 ' W I+ j$ h' Z+ O- X# z v5 x$ _
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf
' y2 O- K+ f7 X! lace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0
! U0 ~( Y; n* f; v* ^, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla 7 B7 l8 T3 t* ^; {9 p# n
n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict).
* ~! ]: N8 E7 E/ l2 `
7 ]$ R5 e u; L! T& Y- M# X) m0 e4 _; M
接下来配置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 y: C, J8 D' I% S% W* @: T C% f[Huawei]
' P0 I+ |+ d! k/ t. QMar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. - P- x8 c; i- s
25.191.3.1 configurations have been changed. The current change number is 4, the + S9 y0 t& Q5 p. Q: O- u/ L
change loop count is 0, and the maximum number of records is 4095. 3 \- H$ J6 t+ Y: ~2 a9 l7 C1 H# {
[Huawei]interface vlanif 100 8 `$ W# x! z D" s3 u3 Y
[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0
4 E. ^+ {! |# l" s[Huawei-Vlanif100]
; H! H. I- d& j7 P! W' NMar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
9 @; E/ s3 }! ]7 v( ~5 Y3 D: W25.191.3.1 configurations have been changed. The current change number is 6, the T! [. ], J2 z/ |: N, C1 J8 ~+ |1 z% t
change loop count is 0, and the maximum number of records is 4095. ; s! \/ S7 M# m3 k3 k/ _0 o
[Huawei-Vlanif100]q * Q- W& T$ b: r0 M! W4 Z
[Huawei]interface giga 0/0/1 & @' S$ H3 W# q# U6 B( R
[Huawei-GigabitEthernet0/0/1]port link-type access
/ N. {/ ?; M2 F$ ~( l# d: m5 I6 g[Huawei-GigabitEthernet0/0/1]port default vlan 100
7 }$ j+ l6 F4 E* A/ Q5 l9 P[Huawei-GigabitEthernet0/0/1]q
! q% b& ^" d7 k" ]! ?[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 ) ?. ~! _. O; \' g5 j$ H* `
[Huawei] 7 l% o6 n) u9 L# J3 a7 x% Z0 C
Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. 5 N8 }9 y& B# j7 {2 `
25.191.3.1 configurations have been changed. The current change number is 9, the & E- J' `1 ~1 j2 h2 Q3 n2 z
change loop count is 0, and the maximum number of records is 4095.
' k) F# G* C# l/ d2 n* p) N! }, f[Huawei]interface vlanif 1
/ i" |7 S5 K9 `/ r1 [[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
# |, E/ i" X9 D% ]7 E[Huawei-Vlanif1]q
/ o& U* h1 ?& c' V[Huawei]interface vlanif 2
4 W% s: _% K3 m' r/ q. m. |* a0 V[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
3 o( V: U' k' R8 v" r& K[Huawei-Vlanif2]q ! R! l3 Z$ \9 ^. s, J! t
[Huawei]interface giga 0/0/3
8 n- R* b5 l/ ]$ D. W5 v+ [[Huawei-GigabitEthernet0/0/3]port link-type access 8 G% q# Q1 E) x
[Huawei-GigabitEthernet0/0/3]port default vlan 2 & c+ E$ e" L% T' v, G9 B
[Huawei-GigabitEthernet0/0/3] " x2 Z( H9 w+ l: K+ S2 w! V
[Huawei]q
' t- G' m! _+ u& Z3 O! Y7 a$ isave
8 B% L5 p8 @) Z! d. K2 tThe current configuration will be written to the device. # o7 @( l6 G8 j
Are you sure to continue?[Y/N]y
( |& @$ w" m4 R. P$ dNow saving the current configuration to the slot 0. . p# f# }( `0 X9 g: Z
Mar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
( ]& Y' H1 ~8 N0 R% M' | yiding whether to save the configuration to the device. 2 v% `* y; L9 u' P, _; O$ o* D
Save the configuration successfully.
, A2 W1 \1 k2 H h8 |; H
; `8 L4 s; W/ c; D( g5 z8 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便可以了.需要的可以下载附件导出配置文件看.
. u% `! F* M0 l5 G' w
$ V Z) D- s7 }% K. G% D9 m6 h3 ~. t* H6 S& i9 x; T
|