|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100 1 e) B- ~# k: m
[Huawei-vlan100]q
4 f) D" t% o! U- f3 a# J[Huawei]acl number 2000 : K$ C, s+ m; B& i2 e L7 s5 I
[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255
# r; Z) ]8 u* o! e! ?[Huawei-acl-basic-2000]q 2 A0 ?1 `" c- j3 @" D+ Q7 Y7 E
[Huawei]interface giga 0/0/0
. G! X+ c# ], d; t9 P- t, z[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0 2 R1 k: m6 s- _$ c
[Huawei-GigabitEthernet0/0/0] : H! M5 b/ n. C" _6 A( i
Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
* `5 s7 N7 S* @1 q w. CIP on the interface GigabitEthernet0/0/0 has entered the UP state. 0 A# \: M n2 n# p
[Huawei-GigabitEthernet0/0/0]q
7 F2 ]! z2 y4 ^1 Y' H[Huawei]interface giga 0/0/1 " ~7 w$ P% O+ H* N9 m
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 / \: X) o6 G" D1 t% L. W% t
[Huawei-GigabitEthernet0/0/1]q
3 ?4 l: |! L1 I0 O[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 4 ?& N' O7 S6 Y+ u4 P6 z: I4 B; p
[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2 * j L* y {( O6 @, j
[Huawei]q ; ~: l6 H1 {* g" c& Y) d
save & @5 y& @% p& Q2 J0 K: X
The current configuration will be written to the device. 8 R7 R9 o# X' z5 F3 E9 H- X8 Q1 k
Are you sure to continue? (y/n)[n]:y
- P; W8 ?) `( ]1 k+ o It will take several minutes to save configuration file, please wait..........
^2 Y$ J5 o! E+ A" @
2 s5 ^/ u$ a% m! D N- _, k. r ^4 i, H0 ^9 R
Configuration file had been saved successfully ) R2 k* \, Z9 N; a
Note: The configuration file will take effect after being activated
. @4 b1 r8 K8 t) i6 s/ y
0 c4 X' s9 u+ f: |) L: @5 \Mar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648 " D M. C7 ~) S7 c5 x- J/ X, k6 a- j
.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 q' f0 V0 Z" T, b/ K5 K. c5 B( ^
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf 0 }* g9 _' A. G6 P8 ^% x1 I
ace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0 ' {& b) P- f) v0 [# v9 G' R
, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla 0 ^5 M/ _; n8 s* ?6 |/ G
n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict).
; O2 W8 N: H/ N G2 Y& n7 K: @, p- L' D& n0 Z8 w
4 N2 m0 k# a. \4 G
接下来配置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.
. k0 M/ Y6 O% k* \[Huawei] . c: z9 C- ?' C+ q1 p8 s1 Q9 H
Mar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
% R2 \# O2 H, Q$ U" u7 o8 @25.191.3.1 configurations have been changed. The current change number is 4, the ; Z/ `7 F/ H/ D6 T
change loop count is 0, and the maximum number of records is 4095. 5 s2 y/ C3 t' L6 P. S; I/ g2 o/ X
[Huawei]interface vlanif 100 # y0 A, c: q- V$ K! [# K
[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0 ) ]2 }( Z( O. e/ `% M, z* @5 ^8 ]
[Huawei-Vlanif100] + c" r$ Y1 k/ o
Mar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
# o/ `( X K4 P/ }8 I" \25.191.3.1 configurations have been changed. The current change number is 6, the
p$ l$ w% F% H+ f" Q- h5 Nchange loop count is 0, and the maximum number of records is 4095.
0 B8 \. p3 ~2 }( U( R[Huawei-Vlanif100]q
& Y0 S. K' ?1 U/ c1 w[Huawei]interface giga 0/0/1 9 O) C/ L# U( {
[Huawei-GigabitEthernet0/0/1]port link-type access ' y! Q! D2 D6 y2 a+ V
[Huawei-GigabitEthernet0/0/1]port default vlan 100
/ k+ A# [* P9 r) l* Q0 ~[Huawei-GigabitEthernet0/0/1]q
6 i: d C8 f Z[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 + v- M* s; [5 D* F1 T5 Q: Y9 f
[Huawei] / p, b& ^$ [, I+ m, V& F o
Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
7 m2 T# Z- \1 J* a" v25.191.3.1 configurations have been changed. The current change number is 9, the
4 r" b0 n& U4 [/ Tchange loop count is 0, and the maximum number of records is 4095. & H% H9 T3 v( [2 A' Y
[Huawei]interface vlanif 1
# g) i: ~. H' `; |4 j0 l/ a[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0 " V. \, e$ ^% I; ^5 M8 C" n
[Huawei-Vlanif1]q ^/ y b1 Z, U9 n: D" V* y% {
[Huawei]interface vlanif 2 . r1 }' D1 m7 ~0 c, h, H) C4 g
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
+ ]2 v) _0 e" Z$ v[Huawei-Vlanif2]q * R* a1 \5 G2 |# T( D$ ~$ c1 B
[Huawei]interface giga 0/0/3
5 f1 X. f8 i) y0 J: o3 ][Huawei-GigabitEthernet0/0/3]port link-type access % n1 Q0 [, c) |
[Huawei-GigabitEthernet0/0/3]port default vlan 2
/ ?$ X: f5 D* C- u2 R[Huawei-GigabitEthernet0/0/3]
+ s7 X, I$ m; f) z# [, d[Huawei]q
9 ^ H8 O- R7 Y9 u) csave
; J4 o4 W% t% J8 W0 VThe current configuration will be written to the device.
' |& @3 O- G+ Y) w5 P( }. gAre you sure to continue?[Y/N]y % f- A4 X4 {+ y9 V
Now saving the current configuration to the slot 0. 4 T% P* D3 w8 p3 x7 h0 T! A
Mar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
. _# Y/ y7 _- w/ diding whether to save the configuration to the device.
9 `' I* {, y6 v$ D& H+ n# B! Y' |Save the configuration successfully. 4 h2 ]2 g& ^# u: I( n+ M, k
3 X7 n2 H5 J0 z
然后设置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便可以了.需要的可以下载附件导出配置文件看.
% l% K; K* x# Y6 ?( H4 P3 g H& s4 o" K k7 C: P( z* _1 V4 a
1 O) U: h. r% W4 U& |
|