找回密码
 注册
查看: 2631|回复: 3

cicso路由设置实现下一跳出当前交换机

[复制链接]

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
发表于 2021-2-20 17:50:44 | 显示全部楼层 |阅读模式
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

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-2-20 18:45:13 | 显示全部楼层
A(config)#no ip route 192.168.6.0 255.255.255.0 192.168.9.2  
' x& n; d8 E7 T* Z# E7 a1 c删除路由

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-2-20 18:49:46 | 显示全部楼层
增加交换机方式:# ^6 J2 ~- \$ p
使用2960网络交换机
9 D  b8 H* k" Z+ t/ S
' [" @$ M2 R" S/ x* F* e

1

主题

0

回帖

12

积分

管理员

积分
12
QQ
 楼主| 发表于 2021-2-20 19:21:40 | 显示全部楼层
ping测结果:
' y1 m  L1 ?5 |' q+ R% sPC>ping 192.168.6.3
+ K1 Y! y& \; i! y% r, R* v9 E4 `5 [+ ], n
Pinging 192.168.6.3 with 32 bytes of data:& _7 G" u2 l! l" Y7 p% V+ y# n

% |' q" K% f5 w/ R; OReply from 192.168.6.3: bytes=32 time=98ms TTL=126* s  d2 n1 B+ h; Q9 Y( ^- R! Z
Reply from 192.168.6.3: bytes=32 time=96ms TTL=126) S* j9 R% @% U2 u! M7 I
Reply from 192.168.6.3: bytes=32 time=95ms TTL=126
8 h4 g8 H9 ?  i/ |2 K2 ?Reply from 192.168.6.3: bytes=32 time=93ms TTL=126
# @5 c  I0 y+ S5 t6 W- P- \
( h1 m/ }/ i5 [. Z$ t1 FPing statistics for 192.168.6.3:
+ _8 e5 \; s, o. V2 x    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
8 }$ ?7 ?$ _5 z. j& R% HApproximate round trip times in milli-seconds:$ a, r$ e; t+ P1 V
    Minimum = 93ms, Maximum = 98ms, Average = 95ms
. t! V+ i- _; @0 I
, g* d0 Y; H  l& S, g  t  Z9 E: e' n6 F) }4 o/ W1 }+ Z) w6 s! c+ w

$ j* i( i6 l" i  V2 S9 l5 J3 y8 s! B/ w; k
PC>ping 192.168.5.3  S8 m! F; k" L- F

2 |1 Q* [: G8 z6 s2 C% |Pinging 192.168.5.3 with 32 bytes of data:
4 a' N! O9 _1 y4 b
# X) J0 w) V& {5 oReply from 192.168.5.3: bytes=32 time=156ms TTL=126
+ h6 J( v5 N( ]/ s- FReply from 192.168.5.3: bytes=32 time=152ms TTL=126) n+ Z4 w7 G$ K4 C$ t
Reply from 192.168.5.3: bytes=32 time=109ms TTL=126" s. C! h5 s* x) B0 m2 E
: I: y$ p: m  g$ B5 R$ h
Ping statistics for 192.168.5.3:' n3 G+ E5 d# |5 a4 \; q
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),( Z: F' w! ]* a0 Y, \! _
Approximate round trip times in milli-seconds:( c: y" z. _  j& h1 I' p
    Minimum = 109ms, Maximum = 156ms, Average = 139ms6 h/ }' i: d& n: x: z2 [6 O4 ?7 }
& h/ O8 J; G" U8 }; Z7 r9 A
Control-C4 U1 j' \" K: L7 N0 ]. p4 V: |

) j& `8 M4 z/ D( o$ f1 `2 m, f
您需要登录后才可以回帖 登录 | 注册

本版积分规则

返回首页|Archiver|手机版|小黑屋|易陆发现技术论坛 ( 蜀ICP备2026014127号-1 )

GMT+8, 2026-6-12 00:19 , Processed in 0.036318 second(s), 33 queries .

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表