|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100
( T. U3 ^; L7 g4 w% U[Huawei-vlan100]q % r0 X" i" e0 @6 c; z
[Huawei]acl number 2000
( a# Y2 j8 x3 V5 Q[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255
7 q" G3 M* Z2 q. J* L9 A! B5 q[Huawei-acl-basic-2000]q , a$ {2 a) D' ?: ~* o, h
[Huawei]interface giga 0/0/0
( ~/ h- Z. d3 O) O) i/ b8 _[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0 0 m% _$ W5 I/ Q' d# H: ^6 M
[Huawei-GigabitEthernet0/0/0]
e* E) H* O' r/ bMar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
: H$ a1 p) M. e. A3 ]IP on the interface GigabitEthernet0/0/0 has entered the UP state.
6 l1 w, ]! L' u5 e! ~% h8 R/ o6 _[Huawei-GigabitEthernet0/0/0]q 6 `' j0 m0 |, q; Y+ T) V2 W2 G
[Huawei]interface giga 0/0/1 1 l! [2 _& ~) ^, D+ M0 Z
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0
! \. m0 K3 I4 ?. `8 @/ F9 H1 L9 Q[Huawei-GigabitEthernet0/0/1]q : h E0 I3 U5 t m7 t! k
[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1
R z, ^9 N+ y! P7 j$ X+ X( S[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2
2 ^ b5 W- \" u4 E) G[Huawei]q
/ t3 p" V1 b6 O! d3 v1 T, ksave + I( o& h7 S" t( g' B5 M- h$ d
The current configuration will be written to the device.
2 M/ u! Z4 ~# x5 }6 @; w W' R Are you sure to continue? (y/n)[n]:y
2 Z* y2 H, V; T: T It will take several minutes to save configuration file, please wait..........
6 z# i- Q. I0 h$ T& m' g3 ~3 P: ]8 o5 H+ O; `* v
3 O4 K7 c, w4 ~3 q6 a Configuration file had been saved successfully & N8 o0 \( R B9 m3 o
Note: The configuration file will take effect after being activated
: L: t. C5 w; s. [' U
9 K: x. Y, J& s' Z, p ZMar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648
1 q$ j) \5 n# x& E: P x.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 3 x5 d2 l; s. g' J5 j/ l
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf + D( A8 l* }! K' N+ P* M+ i. m# N
ace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0 6 f# G" L. }0 V7 o4 o7 p. ]. d
, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla . o* B9 l( H: }2 @* e9 i$ f
n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict). % k) X. x3 N( d, X
. p7 n6 z. ]2 i7 I+ Z' l
8 i; M3 a) M) e- u; K# D8 |
接下来配置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. , i$ m2 T( |* @
[Huawei]
2 j# f I$ e1 X: g3 BMar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. ) n$ a! V# E! g* j7 ~! _
25.191.3.1 configurations have been changed. The current change number is 4, the , G* T; V8 S" h @) H1 T
change loop count is 0, and the maximum number of records is 4095. # Z7 c% U4 Q k- v. ^
[Huawei]interface vlanif 100
: W3 U! U# z/ N2 U& ^* L[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0
9 A% p; a4 A; R3 A$ q2 n+ }9 o- r[Huawei-Vlanif100] 3 d3 o% P% g# |
Mar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
% y$ H$ Z3 s) v% O( H# T25.191.3.1 configurations have been changed. The current change number is 6, the & H7 j8 ]6 |; E$ O* I% G
change loop count is 0, and the maximum number of records is 4095. ! s, }6 M7 ] _% }1 l* f: G
[Huawei-Vlanif100]q / t8 X% @) ?6 f4 T
[Huawei]interface giga 0/0/1
$ _; L1 I5 G {% w4 G ][Huawei-GigabitEthernet0/0/1]port link-type access
/ F7 x# s0 c7 g) N[Huawei-GigabitEthernet0/0/1]port default vlan 100
3 ^4 M7 t7 I; Q$ q) R4 b0 E[Huawei-GigabitEthernet0/0/1]q 5 V% d& q1 H4 V" Y M
[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1
x3 w+ v0 p' o# E[Huawei] & E4 F% A% B! ]+ j4 v9 K7 b$ F
Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. 7 m% _- n0 J1 P+ `
25.191.3.1 configurations have been changed. The current change number is 9, the
7 @, |* X M/ }+ c; F5 jchange loop count is 0, and the maximum number of records is 4095. 0 ?! w" M4 R" P9 v: [3 p. O
[Huawei]interface vlanif 1
w1 b6 { \% b; Y1 Z# ~: r% }! {5 P[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
* y( s+ L; A/ v" O[Huawei-Vlanif1]q - W& ~- ~* n& S2 I- o% r% H$ ~, Q
[Huawei]interface vlanif 2 - i6 _# N5 i$ w
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
: s" j0 j+ l0 S% w[Huawei-Vlanif2]q / D5 U _. u% A* v7 j( X$ Q4 g
[Huawei]interface giga 0/0/3
: f; G& A$ T' O+ y8 J( T[Huawei-GigabitEthernet0/0/3]port link-type access % ?: p- M. p/ E
[Huawei-GigabitEthernet0/0/3]port default vlan 2 3 U$ S, w6 V4 G- ~( {2 i! \0 N7 a6 D7 ^
[Huawei-GigabitEthernet0/0/3] + L/ I5 a; D6 R$ x: o+ u6 P4 I: l* M- X
[Huawei]q
4 {$ I" f- g/ L/ {" F1 u- xsave
6 f j7 R; v+ h/ M3 VThe current configuration will be written to the device. 2 X' a5 V1 z" F. B0 q
Are you sure to continue?[Y/N]y + V9 p/ G6 b; E: r- L8 s
Now saving the current configuration to the slot 0.
$ Y6 z5 P- G7 lMar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
, d Z. Q4 _5 W5 W6 riding whether to save the configuration to the device.
4 ^& b8 m1 K @/ i h, [4 r& Y3 RSave the configuration successfully.
9 a" G- \) p7 Q6 ? c: b
+ p' A. H# u: W4 u% M' Y2 h$ |
然后设置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' ~" n" Z/ ?, U; [" V1 W' H% D9 g0 q+ `& D% Q4 p- v
) F( P& U& R& c
|