|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100 " S6 Q3 o2 f' ?1 g$ e4 F$ j6 C
[Huawei-vlan100]q
3 }: ]6 J) u" j2 E. z[Huawei]acl number 2000 8 T2 h3 `# r5 N8 }3 y( F
[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255
& [+ k/ G6 b1 X! W; B[Huawei-acl-basic-2000]q
& U" I+ |* F, z[Huawei]interface giga 0/0/0 ]( m8 o6 X) h
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0
3 |% v; [1 @9 i) n. ^[Huawei-GigabitEthernet0/0/0]
7 t, Q" e& C( ]Mar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
7 a) T; V. a, G4 Q' T! eIP on the interface GigabitEthernet0/0/0 has entered the UP state. ; V1 @( k# m9 T4 `! Y
[Huawei-GigabitEthernet0/0/0]q ; F# I3 R& F: U
[Huawei]interface giga 0/0/1
- X3 Z. D7 r1 O$ d7 q3 S" I& E3 D$ E[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 - x8 p8 Z8 _- `8 M1 A
[Huawei-GigabitEthernet0/0/1]q ; J0 [$ T( u. ?& N) |
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
+ u$ V0 ~1 q8 E3 w" i# `/ \7 e[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2 4 \; f$ p9 {5 h9 A/ j* a7 d* v
[Huawei]q # j8 ^) a6 y. R. C
save 5 t$ V* S( M# V* z; f! ]$ o0 i
The current configuration will be written to the device.
% u: X5 l7 ~6 `" d" }/ | Are you sure to continue? (y/n)[n]:y
u. L/ ?% f9 [3 z# [2 s It will take several minutes to save configuration file, please wait.......... * Y7 } x, i4 R& O+ l: R- K" U
3 O1 h0 b- ?* |. ~
' s8 T, h! x! a) R; L8 b( m; A2 m N- f Configuration file had been saved successfully
) W6 q1 o& y! ?9 m8 `; B Note: The configuration file will take effect after being activated 5 M$ q$ D( f. H0 A
% w4 e6 D$ z: s5 ?: a, UMar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648
" X6 c) J+ i0 Q7 J' Y.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 y; b- [* n8 V9 x0 Y) ]2 m+ Z
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf 9 X/ f' V+ E4 D @0 h
ace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0 1 P0 E" u! [7 @4 A) n/ z8 i5 Z+ O9 q
, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla
8 x6 m, G) ~! a9 u5 U, u" C/ {n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict).
+ R' R7 U+ J; v6 J7 j# ]: Z" D" m- j
2 T7 H1 S+ f' n/ z: X4 y0 Q0 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. % J* u0 C/ n1 u0 I2 C+ W
[Huawei]
/ y k7 t- r$ ^4 H4 v' AMar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
+ c! x+ ]& O7 n3 }7 ~3 k9 H25.191.3.1 configurations have been changed. The current change number is 4, the
( ~% r4 p% N7 Y& Wchange loop count is 0, and the maximum number of records is 4095. ! t9 l0 S- J* B9 W: _
[Huawei]interface vlanif 100 * p2 Y( K; q6 s& ?( o# C. m2 Q) q
[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0 - S4 J, `: \1 G- |4 b+ z% a# Q/ |
[Huawei-Vlanif100]
+ L' }2 h' w% G% JMar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. . M9 c8 L5 M) H/ b# C& q& b+ s
25.191.3.1 configurations have been changed. The current change number is 6, the
1 S, g( y+ Z8 x$ O1 H5 S. p, Mchange loop count is 0, and the maximum number of records is 4095. ( }: r) w; ] E0 f' ]& m+ r2 L$ H6 V
[Huawei-Vlanif100]q - c$ L: C4 a! Y& @
[Huawei]interface giga 0/0/1
2 M( p3 ?0 P# ^4 ~3 r* {[Huawei-GigabitEthernet0/0/1]port link-type access % Q+ L5 a1 A: w
[Huawei-GigabitEthernet0/0/1]port default vlan 100 + s3 ?; \/ i+ q% h& s) `) X
[Huawei-GigabitEthernet0/0/1]q
_0 D# Q) u6 E. P8 v2 L2 o! n/ J3 D[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
( ]' t! h1 K/ H# a[Huawei]
f0 e2 \) i( y: h1 d9 g2 t sMar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. ) Y4 b* d7 L9 j+ x7 e% u
25.191.3.1 configurations have been changed. The current change number is 9, the
2 E8 X" S% S' d% T3 e$ uchange loop count is 0, and the maximum number of records is 4095.
8 |9 V* Y! T* X7 Z# R. w[Huawei]interface vlanif 1
% m3 d; c( z& X4 c1 U1 ?2 x" H$ L[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
$ }& i' G9 {$ ]. l: e. _[Huawei-Vlanif1]q 3 l4 C7 v4 Q! Q9 C( j
[Huawei]interface vlanif 2 : H; d( Y6 V- v# n" m
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
1 l% X$ b! V# B[Huawei-Vlanif2]q
) t/ m4 x" t0 G[Huawei]interface giga 0/0/3
7 I2 u |0 v# F I3 R. D+ g[Huawei-GigabitEthernet0/0/3]port link-type access
9 s( P$ B3 T, L+ v: F3 x, r[Huawei-GigabitEthernet0/0/3]port default vlan 2 ; d- r) v; P( g O9 X3 \
[Huawei-GigabitEthernet0/0/3] , K y. M, p9 A& e2 f) ]( Q+ X
[Huawei]q 3 ` @. d/ t3 ~5 m! B
save 5 z5 J, m& }8 | J9 \2 ?7 a
The current configuration will be written to the device.
. K9 i k6 ~: vAre you sure to continue?[Y/N]y / e2 H' v* E$ y M* f
Now saving the current configuration to the slot 0.
/ `7 ^! ]" I, H0 ^% MMar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
7 m" W! R8 {3 ciding whether to save the configuration to the device.
* n# w3 Z3 j+ _5 u" i4 W# qSave the configuration successfully.
d: |' Y u% u4 F( U4 ~& g5 d% l% F- L0 K
然后设置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便可以了.需要的可以下载附件导出配置文件看. ]/ B( D+ j% z v! S. y W) Z
# d! w# I% D+ Y: B
7 S+ _4 C0 A1 e7 V1 |; q. s
|