将设为首页浏览此站
开启辅助访问 天气与日历 收藏本站联系我们切换到窄版

易陆发现论坛

 找回密码
 开始注册
查看: 219|回复: 3
收起左侧

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

[复制链接]
发表于 2021-2-20 17:50:44 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有帐号?开始注册

x
cicso路由设置实现下一跳出当前交换机; J: r/ B3 x8 `# V+ m' P
设计思路5 k# \3 ]- A5 x: e* B. ]$ S5 p
A路由器  B路由器* Q# g' w) A5 [' j5 _# ^/ @& A, @5 K
A路由器网段192.168.5.1 255.255.255.0
! h/ i* k: U% v! W$ k# D+ MB路由器网段192.168.6.1 255.255.255.0
; M9 z' x0 T" M2 z  l# y3 ^/ f& L% G' J0 d" g' x- Z# C5 j& S* j) _
# a) T2 N* c7 E, f6 R
e电脑pc 192.168.5.2
" ]7 C; o3 ~3 Zf电脑pc  192.168.6.2  n. E% Q4 T- a. ~; I
  n0 t. `, g% w1 r
形成两个网络通过端口转发能互相访问。, T* F  [5 d6 [2 e. F

8 `+ u& s. e2 I$ J+ K1 a两个互联端口选择用serial端口,或者使用端口进行转发。# F0 @; w+ D- f1 p3 z
. l( R7 k+ m& R: Q/ ]6 s
连接方式:
- N4 Q' ~" m  |1 Z) fe 网口连接A路由器 >A路由器连接B路由器>B路由器连接f网口
0 x0 Q" o% v9 _% e+ Z2 a8 c
) N3 B3 R1 }, ~/ o) Z. K/ i操作步骤:
) h& @0 y3 `3 m7 C2 W
4 J* }* }& x: [3 k8 t5 F" ^A路由器 :   ; W( x& B, y; a3 R6 J+ [& }6 }
Router>en! f6 P4 ^) |! H6 T3 Q& b3 o' }, n
Router#configure t
( J; O( o$ X6 b  F9 ?; w# C; j, {1 q4 F5 HEnter configuration commands, one per line.  End with CNTL/Z.
3 y# r# j' C; M4 BRouter(config)#hostname A" ]2 ]5 c/ [9 {9 e
A(config)#interface fa 0/0
; ?, _+ K5 T  @# y9 }A(config-if)#no shutdown ; ~! ?( X- }- v" q+ H
A(config-if)#- G( C  i# U/ S. E1 _  |
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
: ]- R& r. i7 d1 B% m1 o
' s8 q& W+ n0 \5 y( W7 M- XA(config-if)#ip address 192.168.5.1 255.255.255.0- I, y/ m' G" I: Y

5 e2 C0 ?9 O! i# p' uA(config-if)#exit
6 a& U! U  w: O) m6 V" X5 t( G; S2 @/ q. y) Z
A(config)#interface fa 1/02 J2 A2 n9 H; U7 I
A(config-if)#no shutdown ( @: u0 |9 Y$ i' T
A(config-if)#% c$ P4 o/ f2 a* `# d
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
5 N, I+ E9 [" I4 f, N2 rA(config-if)#ip address 192.168.9.3 255.255.255.0
0 G6 A5 f9 G3 h/ u6 ~( ZA(config-if)#exit
0 k! T* X  d3 @! G" T, c$ L! E0 J

! Z* ]7 k6 J3 c& J  F2 DB路由器 :   
  `  U5 o5 l5 X3 c- v
$ y7 q: w7 r. F  ~: ARouter>en
# u) Y& S2 V0 n" p( Q! ?. [Router#conf t8 b$ I. O2 m+ E  q0 e! T. i6 F
Enter configuration commands, one per line.  End with CNTL/Z.+ K7 q, D3 l# D- d
Router(config)#hostname B
& G6 J" u0 e* X* [B(config)#inter fa 0/0
* Q( I; G2 d: o5 K  W, PB(config-if)#no shut
" R/ T7 N7 D7 b* cB(config-if)#7 x4 B* u% a5 r. ^5 B) v; L: l
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up4 w+ B! h( _" E4 S
ip add 192.168.6.1 255.255.255.0# [2 Z6 Y. u! {
B(config-if)#exit" u9 K$ D6 n% n9 G- G/ h
B(config)#inter fa 1/0
) ?" X3 t& C6 T. \9 uB(config-if)#no shut
2 ^$ A) ^; e5 ~6 p: NB(config-if)#8 u4 s! h6 o- |. D: C
%LINK-5-CHANGED: Interface FastEthernet1/0, changed state to up
0 P8 C& }% x9 A; Y% G% [* O%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet1/0, changed state to up
2 w1 d# p7 V% s' q6 x4 Tip add 192.168.9.2 255.255.255.0
$ o0 ^3 j, j( DB(config-if)#exit+ r9 z$ @5 [4 x( q
* l0 x$ ~! j: j
! ]' t5 @9 q% H! y( s* N" K
. z# R$ t% X# _
A路由器添加路由:
5 q# x$ \; [8 ]4 }, gA#conf t, D7 r  q8 @0 t4 `; m& \
Enter configuration commands, one per line.  End with CNTL/Z.
. J( e& T0 `; C3 ]' B9 P" A在A端路由器上添加B路由器的网段地址,并且转发给B端互联地址:
! C5 y6 [( M- A: t1 y, q3 h  `) kA(config)#ip route 192.168.6.0 255.255.255.0 192.168.9.2
% U' P3 T" J( s4 c0 `, }4 z& u3 W$ |6 k5 ^0 y
B路由器添加路由:
  D6 i2 z' E5 ~B#conf t. ^2 k/ ]2 \# K. t7 U3 M. r
Enter configuration commands, one per line.  End with CNTL/Z.5 t6 v* a+ x) N/ K
在A端路由器上添加B路由器的网段地址,并且转发给B端互联地址:; f/ A  _# d) P0 X/ H! ~
B(config)#ip route 192.168.5.0 255.255.255.0 192.168.9.37 b5 q7 U# k( O% o

8 e) M5 D  ^# u2 x. h$ \: c
$ E) T" o0 Q/ W" A3 M配置pc端口IP地址:
/ w1 q& _9 c, Q: Xe电脑pc: 192.168.5.2/ R% E8 F; P7 ?' z1 B" V
f电脑pc:   192.168.6.2
; M0 U* c' O: {" X  ~+ u+ s) O9 K% H" V& t6 q8 B! L  Z) E, q. E& W
完成配置  y+ p$ s, p) W8 V. Y
测试联通性:e上 ping  192.168.6.28 I" H* t+ \- V; e

+ `5 V% R  a# }5 y1 GPC>ping 192.168.6.3
- @, [6 w. X% B, F' FPinging 192.168.6.3 with 32 bytes of data:
" r6 ?/ w, u' l5 {9 D4 ^' ~$ e; cReply from 192.168.6.3: bytes=32 time=98ms TTL=126
6 K7 F* r- z. k. t: vReply from 192.168.6.3: bytes=32 time=96ms TTL=126
  j! y' y! f/ O4 [Reply from 192.168.6.3: bytes=32 time=95ms TTL=126
4 J2 k9 ~$ o" y, l9 T% O9 sReply from 192.168.6.3: bytes=32 time=93ms TTL=1261 ]/ C7 B3 Q" \7 K/ ]+ @
Ping statistics for 192.168.6.3:8 K3 b* S7 k( p4 @5 e
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),, {& N7 C+ s0 ]  W" d6 t" m! m
Approximate round trip times in milli-seconds:" J6 v! x  l& ?* {6 j! h
    Minimum = 93ms, Maximum = 98ms, Average = 95ms7 D3 r$ V3 @$ T) \

; {& L) A9 b' B5 w6 Y6 |+ F% fPC>ping 192.168.5.37 l4 S# G( u8 {* A# O3 A
Pinging 192.168.5.3 with 32 bytes of data:
/ t2 J1 l% S9 f* MReply from 192.168.5.3: bytes=32 time=122ms TTL=126
, s" s, Q. w9 p; M( v- ]0 L2 CReply from 192.168.5.3: bytes=32 time=94ms TTL=126( `, L; W6 q4 z1 u
Reply from 192.168.5.3: bytes=32 time=81ms TTL=126
1 Y+ ?. }6 {9 o) w/ j+ qReply from 192.168.5.3: bytes=32 time=92ms TTL=126
: u4 p) |6 D# n  R5 ?4 H; y" K: h% w+ ?) Y5 c

: G/ Y  c8 m; Z0 O: F* o
 楼主| 发表于 2021-2-20 18:45:13 | 显示全部楼层
A(config)#no ip route 192.168.6.0 255.255.255.0 192.168.9.2  
' L6 j5 f! r* _) `2 j删除路由
 楼主| 发表于 2021-2-20 18:49:46 | 显示全部楼层
增加交换机方式:
' ^! A8 E& b5 A0 _# `5 J使用2960网络交换机( |4 _# m4 M( j1 a  o* g4 ^

9 [7 C$ U- f4 P" C
路由模式.png
 楼主| 发表于 2021-2-20 19:21:40 | 显示全部楼层
ping测结果:
' v+ N- K! f1 m4 W- D: g$ w& Y4 |PC>ping 192.168.6.3
5 F9 Y9 m( p; L: b
/ g4 B$ j  J( H; ]7 `! K, Y5 I! VPinging 192.168.6.3 with 32 bytes of data:
! n8 i, o. ]. W3 N
8 u& \" k6 t& E# |# x& V% H- lReply from 192.168.6.3: bytes=32 time=98ms TTL=1263 S" \$ Y" L; }* s5 C
Reply from 192.168.6.3: bytes=32 time=96ms TTL=126
, t& W4 H) t8 V: m7 W4 XReply from 192.168.6.3: bytes=32 time=95ms TTL=126
& \# J6 p2 y8 {* T+ NReply from 192.168.6.3: bytes=32 time=93ms TTL=126
8 K& A) C( k' m; Y8 T+ A/ ?$ `) o% T
" O: s1 T2 D* y  vPing statistics for 192.168.6.3:
/ Q2 Y1 V$ q+ `" ~/ A5 g    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),6 L) ^4 ^1 f6 _* P% B# i+ Y
Approximate round trip times in milli-seconds:* X' Y# c6 F: W
    Minimum = 93ms, Maximum = 98ms, Average = 95ms
8 `0 ~/ ]# c+ k. B! T
+ ^  z, _8 N. q$ Y
; `: J5 i# l9 o; O0 X8 a  j/ [* `# p, B

+ k/ ?6 I( Y* o. ~/ x# s' N2 c# XPC>ping 192.168.5.36 V" e- J3 c, V2 R

' h* g, {& H$ E0 B  k7 Q3 `5 d2 oPinging 192.168.5.3 with 32 bytes of data:; ^( W% n; ]# k

' _4 C: m# M" c1 H2 y; A$ yReply from 192.168.5.3: bytes=32 time=156ms TTL=126
7 N. D$ M& E* F/ [6 \" KReply from 192.168.5.3: bytes=32 time=152ms TTL=126
4 f0 W  d/ `+ g! rReply from 192.168.5.3: bytes=32 time=109ms TTL=126/ E" L" h3 k/ P- {& a6 |' V

2 H' I1 m' v% I. i+ n# JPing statistics for 192.168.5.3:
: i' @; h/ ?+ W" Y0 F% b    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
; n! _! d4 o+ U6 \4 _Approximate round trip times in milli-seconds:: _: k8 U# K" g7 q" J2 `! Z
    Minimum = 109ms, Maximum = 156ms, Average = 139ms/ c8 e' p, v0 ~+ N; H6 I! d
, R' v  \0 |) e. W
Control-C
4 h/ f0 ], X, ~+ Y
% ^# W; D; s. ?" W9 _
ping测结果.png
您需要登录后才可以回帖 登录 | 开始注册

本版积分规则

关闭

站长推荐上一条 /4 下一条

如有购买积分卡请联系497906712

QQ|返回首页|Archiver|手机版|小黑屋|易陆发现 点击这里给我发消息

GMT+8, 2021-4-13 10:18 , Processed in 0.066253 second(s), 26 queries .

Powered by 龙睿 bbs168x X3.2

© 2001-2020 Comsenz Inc.

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