|
首先配置AR2220,设置GE0接口IP为固定外网地址,设置GE1接口IP为1.1.1.1,然后做两条静态路由,创建vlan 100,红色文本是需要特别多看几眼的,代码如下:
[Huawei]vlan 100
+ N' l7 F+ j, R: T: {) A% v[Huawei-vlan100]q
# s7 K% y" f5 v6 y2 E( Q" q[Huawei]acl number 2000
7 H7 W" q+ U8 x& `[Huawei-acl-basic-2000]rule 5 permit source 192.168.0.0 0.0.255.255 1 E) J( W6 F3 d! t6 E" x
[Huawei-acl-basic-2000]q : L% b6 f* b5 j# n. d5 [4 `/ u
[Huawei]interface giga 0/0/0
. B' q7 S& A; j, Z[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.3 255.255.255.0
: e- _- o6 h+ J1 Z; n[Huawei-GigabitEthernet0/0/0]
9 B- o# z6 {+ b- fMar 13 2014 07:34:12-05:13 Huawei %IFNET/4/LINK_STATE(l)[1]:The line protocol
- D% z' K, ~" |. j5 ~/ {6 bIP on the interface GigabitEthernet0/0/0 has entered the UP state.
n6 f9 V, c& D' F[Huawei-GigabitEthernet0/0/0]q
- W- N; l2 a2 E[Huawei]interface giga 0/0/1 1 R: c4 X$ m# Z8 {$ G! d& o
[Huawei-GigabitEthernet0/0/1]ip address 1.1.1.1 255.255.255.0 @& I1 L* E% ?: X
[Huawei-GigabitEthernet0/0/1]q
3 C+ M# i8 g* _+ @8 B. U, b- Y7 |[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.1 ' W1 ^& E" }8 [. l( d# l5 |: n3 [
[Huawei]ip route-static 192.168.0.0 255.255.0.0 1.1.1.2
5 X% [6 D% [7 @ @9 U( T' h[Huawei]q
/ S$ `+ _% j6 w( n- A8 K" y# isave
$ g- F/ K8 c/ o3 c3 O$ k The current configuration will be written to the device.
n6 j& x( B- Y' _5 Z# j Are you sure to continue? (y/n)[n]:y 7 u# v. Y+ U5 R! Z& f( F
It will take several minutes to save configuration file, please wait..........
% f% R: C" b( A1 m/ a# j
2 R* M( j# Y+ g7 B% X1 w# p4 o+ W; ^; o0 j: S2 f7 p5 K: Q
Configuration file had been saved successfully
9 T2 i2 g9 i# }5 c% E Z' U Note: The configuration file will take effect after being activated - f7 F6 k, ~+ f
n( g* l$ c' X! ? w( u
Mar 13 2014 07:37:25-05:13 Huawei ARP/4/ARP_IPCONFLICT_TRAP:OID 16777216.50331648 7 u' h3 m. S- Z2 R0 p
.100663296.16777216.67108864.16777216.3674669056.83886080.419430400.2063597568.33 1 o' h( Q3 _) I
554432.100663296 ARP detects IP conflict. (IP address=201.1.168.192, Local interf ) _5 `3 i) R! W0 |. T
ace=GigabitEthernet0/0/0, Local MAC=4437-e68c-b212, Local vlan=0, Local CE vlan=0
" X) S6 _- Z" f1 o, ?" T O* K; o4 J, Receive interface=GigabitEthernet0/0/0, Receive MAC=1c1a-c00f-253f, Receive vla 0 `$ t3 e) ~/ V. x
n=0, Receive CE vlan=0, IP conflict type=Remote IP conflict). " Z( v' C4 l" q; u+ B9 j! l
* X1 E# |( A' Y
# f% G* \/ v- Q; R
接下来配置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.
# O }% w, h$ V. j[Huawei]
+ H0 Y( H1 ?( f. X: LMar 13 2014 10:38:34-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
+ a6 n ^0 V" q6 S25.191.3.1 configurations have been changed. The current change number is 4, the 2 ?% D+ X9 [6 w* Y2 u
change loop count is 0, and the maximum number of records is 4095. ! {, `" S6 Y; U1 [" ~" W' c/ O
[Huawei]interface vlanif 100
6 u/ R- `' B' d' c9 k[Huawei-Vlanif100]ip address 1.1.1.2 255.255.255.0
5 h7 I6 {1 \' W) D[Huawei-Vlanif100]
. e% P/ N$ ~. n! xMar 13 2014 10:40:14-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5.
5 f. L$ d1 H0 F. I; I, T25.191.3.1 configurations have been changed. The current change number is 6, the . ^4 ] G# M; o" n9 z
change loop count is 0, and the maximum number of records is 4095. 9 f3 r, i1 m$ P' I/ U
[Huawei-Vlanif100]q 6 J* N1 Q, a- P6 v3 Q" a, B3 I4 M
[Huawei]interface giga 0/0/1 : h' V; j) V7 u8 S" \' H: D. v
[Huawei-GigabitEthernet0/0/1]port link-type access
/ E6 Z" u( c1 h1 ?# g7 z[Huawei-GigabitEthernet0/0/1]port default vlan 100 3 [9 [- x& V6 J- _
[Huawei-GigabitEthernet0/0/1]q
2 h: n4 P* B. L+ S[Huawei]ip route-static 0.0.0.0 0.0.0.0 1.1.1.1 " k# _" X- C: D4 o2 l x; e, P
[Huawei]
+ Z: f. v# a; F, r. S0 }9 _Mar 13 2014 10:43:24-08:00 Huawei DS/4/DATASYNC_CFGCHANGE:OID 1.3.6.1.4.1.2011.5. 9 \' G# x( f1 U% w; d# X: ?! u; i
25.191.3.1 configurations have been changed. The current change number is 9, the ! e6 A/ z' x; q" \ h: q6 k
change loop count is 0, and the maximum number of records is 4095. & U( n1 w; e: ~1 a& U3 `
[Huawei]interface vlanif 1 & M0 V. [* [# m( ^3 Y
[Huawei-Vlanif1]ip address 192.168.0.1 255.255.255.0
: ?" U1 X- L: D# f: Q0 H% V[Huawei-Vlanif1]q
/ ]( r1 [+ g0 s) P[Huawei]interface vlanif 2 1 [! H% b" G- u, _# Z* V
[Huawei-Vlanif2]ip address 192.168.2.1 255.255.255.0
( Z. r; I6 i2 l! \[Huawei-Vlanif2]q + {9 v/ Y; ^( G1 ~
[Huawei]interface giga 0/0/3 # t- V/ \4 n. z9 P) G6 ]
[Huawei-GigabitEthernet0/0/3]port link-type access 6 F+ [9 h" |6 t- U$ Y
[Huawei-GigabitEthernet0/0/3]port default vlan 2
: {: d W0 `8 N0 [[Huawei-GigabitEthernet0/0/3]
' U/ u, z h7 Q4 ~2 E$ |9 {5 C[Huawei]q
( X7 u: M" ]; s: Q/ ^& G7 psave
/ F5 U4 [" T, G! Y+ y' R" P$ OThe current configuration will be written to the device. * f# c7 g; a, a* b
Are you sure to continue?[Y/N]y # V& s5 m$ O( q6 V
Now saving the current configuration to the slot 0.
' M+ G+ {# b" c9 c; l6 BMar 13 2014 11:02:44-08:00 Huawei %CFM/4/SAVE(l)[11]:The user chose Y when dec
' g: ^: r2 n' B$ N5 m& w) \9 uiding whether to save the configuration to the device. 1 |% |& T' @4 T; z ]; w, d# Z
Save the configuration successfully. . d3 c0 x e* h+ T& D
. F: ]' p4 P' z% Q; q) B
然后设置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便可以了.需要的可以下载附件导出配置文件看.
3 q, a5 G$ D) Q( e2 p1 o
1 K; G1 P! l0 F( D% _( z
3 b* a$ D) b; J; { |