|
|
cicso路由设置实现下一跳出当前交换机
' {4 h! i$ b! q N$ s6 b设计思路" E7 Q9 c) b& Z* Y
A路由器 B路由器# K# Z( o; I1 N6 |& H3 j2 u9 e
A路由器网段192.168.5.1 255.255.255.0
8 f! z1 m& R, pB路由器网段192.168.6.1 255.255.255.0
: F3 w: J+ H+ C2 \# h
( j- w7 r& U6 i1 A4 N; N" m2 Y6 G
e电脑pc 192.168.5.2
& o$ A2 V F# j$ v/ lf电脑pc 192.168.6.2
9 v! O. S4 J2 q6 i' a
3 m3 F5 m2 d9 U" q% K; j形成两个网络通过端口转发能互相访问。
! T }, M, n0 X0 t9 ~, m2 j
* p$ e* O9 A6 w+ W( F% ~3 M两个互联端口选择用serial端口,或者使用端口进行转发。
6 `) V7 w5 d) p9 ?) l6 {5 A! P2 V; `0 g; _ p# Q- ]4 [
连接方式:5 k$ D* \$ {. @& H. ^
e 网口连接A路由器 >A路由器连接B路由器>B路由器连接f网口
2 x4 D. t* T+ |4 T( t: H0 f! B
操作步骤:% q( S+ `# ?3 s
; h" | X2 f V, _A路由器 :
6 w5 X0 x, k& ~* B- S4 ]( t( rRouter>en, [: Y6 P! I! ~
Router#configure t
3 V/ d% [3 x4 I+ gEnter configuration commands, one per line. End with CNTL/Z.+ X+ N; S$ r5 X: I# X
Router(config)#hostname A
1 N5 x0 }- I! E. I' L! R0 B- pA(config)#interface fa 0/0
3 i) R8 Y* B/ [; X: `& g% dA(config-if)#no shutdown
% y8 }5 Q6 }& u lA(config-if)#
$ b; Z' K9 z; [' J% U* b6 J%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up" f A) N, o0 b
3 E f1 e: n$ a1 SA(config-if)#ip address 192.168.5.1 255.255.255.0 g+ h, W+ H! S* v' m
: s( m- d9 X+ \2 tA(config-if)#exit
( A2 A0 k1 W5 C0 a4 W( ^ Z3 i$ s5 ~3 J2 i0 J7 B4 c& F
A(config)#interface fa 1/0, w5 J$ d5 y! I" X: @
A(config-if)#no shutdown ( H( ^, `9 x7 ~4 U
A(config-if)#
u/ x: s% `' a( h- c%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up. _6 z2 x/ Z* ?; C
A(config-if)#ip address 192.168.9.3 255.255.255.0
: W9 k- N: v- }0 dA(config-if)#exit
2 s3 H2 p( ~2 j1 _. e+ m0 J: \; J6 [5 w4 ^! d
( F1 o/ e: `1 ?/ X* XB路由器 : ; h( Q& W6 L0 T2 l% Q
9 ~8 z' h5 f& k$ D
Router>en; E# N2 ?2 e% I- c# [6 n" A
Router#conf t ]' m4 ~1 b2 f9 w1 w2 X1 B! s
Enter configuration commands, one per line. End with CNTL/Z.0 L4 |' {: k @4 y; e! A
Router(config)#hostname B1 ^' e1 C$ r7 o' u1 j
B(config)#inter fa 0/0
. w) n3 o2 d3 d5 V1 q6 wB(config-if)#no shut- L+ Y3 i' R9 y. Z0 t `& W$ \
B(config-if)#
* @+ l% K U4 V9 `3 R%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
1 V" g6 n% k- A& v! Z! g3 D1 fip add 192.168.6.1 255.255.255.09 z) Q" V7 N [4 n8 `: {
B(config-if)#exit
% b9 M. c+ E$ N2 ?3 {# a2 H" lB(config)#inter fa 1/0
2 i2 w5 L) ~+ o) l& r" `B(config-if)#no shut( Q5 x' Z0 t% N+ Q1 M2 ~
B(config-if)#
9 s2 U2 L: Q+ }! p- y/ M& A9 H%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up5 w& }1 X3 Y% J9 r
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
( M0 c& L3 Y/ H& eip add 192.168.9.2 255.255.255.0
* d' U7 E. a' p$ \# R. c c" w- B0 i% }B(config-if)#exit; N. ~4 ]) _6 c/ C) B+ m
0 O% A- N0 a N1 i5 D! u }- c. z" H! @5 W
2 u' C2 c ?. d3 @! S% S
A路由器添加路由:
v+ y. W7 ^ I: {! N- xA#conf t
U6 @' T8 ?; R' DEnter configuration commands, one per line. End with CNTL/Z./ S# M4 u: g8 t3 a
在A端路由器上添加B路由器的网段地址,并且转发给B端互联地址:
; g F% r) r- y) iA(config)#ip route 192.168.6.0 255.255.255.0 192.168.9.2
( Q: G6 v+ R) ~9 {% n
\! m, \" G6 y* S' d* S7 iB路由器添加路由:
% W2 C. c: B9 P; i) E; yB#conf t
3 B7 w& }9 b2 r" q( |; \Enter configuration commands, one per line. End with CNTL/Z.3 N$ ^. N" L' [; \% T
在A端路由器上添加B路由器的网段地址,并且转发给B端互联地址:" ]5 L) U) b- j3 `
B(config)#ip route 192.168.5.0 255.255.255.0 192.168.9.3
+ s# S; x( @5 _5 f# J* u' E- x0 @( `$ X
" y( I% M- q0 H" ?' v% }配置pc端口IP地址:
7 b( u0 ~+ o- R/ Q! e& `- ye电脑pc: 192.168.5.27 g. [2 t: T- W* W
f电脑pc: 192.168.6.2% F( b+ q' _2 @8 \$ H+ m
( c% Z8 G: e: e7 Z4 ~完成配置
5 Q, @7 d* z; O' U: W4 T2 k测试联通性:e上 ping 192.168.6.2
) W" ~, \+ P5 c. E6 B- ?0 x+ [9 |2 o+ |5 n2 G
PC>ping 192.168.6.3
* m8 O f) Q8 {* n7 Q$ XPinging 192.168.6.3 with 32 bytes of data:- l# [3 U! x2 i
Reply from 192.168.6.3: bytes=32 time=98ms TTL=126& ]% n6 s, Q1 S) w3 s* V/ \
Reply from 192.168.6.3: bytes=32 time=96ms TTL=126
4 Y6 u1 Z' c; W+ c/ _" V# b# N, e; y( lReply from 192.168.6.3: bytes=32 time=95ms TTL=126' H- ` d6 q% W$ z1 O% V
Reply from 192.168.6.3: bytes=32 time=93ms TTL=126; S6 I# o0 ?5 e( s4 y
Ping statistics for 192.168.6.3:' N; L3 V/ J4 Y! d( n
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),/ G: ]; F/ D8 Z; s5 F
Approximate round trip times in milli-seconds:3 ^; Z* O8 }* w5 ]
Minimum = 93ms, Maximum = 98ms, Average = 95ms8 E& w; b& c' Y( E3 _" D
6 G& F5 `/ C Y' qPC>ping 192.168.5.3
8 q2 h# s }( P5 C; OPinging 192.168.5.3 with 32 bytes of data:# ?8 \" p; d _% i6 y
Reply from 192.168.5.3: bytes=32 time=122ms TTL=126
J1 [3 S8 t5 s# ^6 B1 VReply from 192.168.5.3: bytes=32 time=94ms TTL=126
5 |0 L: @! Z8 W$ qReply from 192.168.5.3: bytes=32 time=81ms TTL=126
8 b) W$ I. j" C5 V/ EReply from 192.168.5.3: bytes=32 time=92ms TTL=1262 ~9 u' Q/ U, ?$ X M0 i+ @0 S
- A. b; G& B- r: r
: {1 B9 y: B2 g) h. q |
|