分享
 
 
 

RIP协议的基本配置(2)

王朝other·作者佚名  2008-05-31
窄屏简体版  字體: |||超大  

配置清单5-2 配置RIP协议

第1段:配置RIP协议

R1#conft

Enter configuration commands, one per line. End with CNTL/Z.

R1(config)#router rip

R1(config-router)#eetwork 172.16.0.0

R1(config-router)#

Term_Server2

[Resuming connection 2 to R2 ...]

R2#conft

Enter configuration commands, one per line. End with CNTT ./Z

R2(config)#router rip

R2(config-router)#network 172.16.0.0

R2(config-router)#

Term_Server3

[Resuming connection 3 to R3 ...]

R3#conft

Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#router rip

R3(config-router)#network 172.16.0.0

R3(config-router)#

第2段:查看路由表

Term_Server 1

[Resuming connection I to R1... ]

R1(config-router)#end

R1#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX - EIGRP external, 0 - OSPF, IA - OSPF inter area

N - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 6 subnets

R172.16.23.0[20/1]via 172.16.12.2,00:00:06,Serial0

[20/1]via 172.16.13.3,00:00:07,Serial1

C172.16.12.0 is directly connected, Serial0

C172.16.13.0 is directly connected. Serial1

C172.16.1.0 is directly connected, Ethernet0

R172.16.2.0[20/1]via 172.16.12.2,00:00:06,Serial0

R 172.16.3.0[20/1]via 172.16.13.3,00:00:07,Serial1

R1#

Term_Server2

[Resuming connection 2 to R2 ... ]

R2(config-router)#end

R2#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M " mobile, B - BGP

D - EIGRP, EX - EIGRP external, 0 - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type I, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 6 subnets

C172.16.23.0 is directly connected, Seriall

C172.16.12.0 is directly connected, SerialO

R172.16.13.0[20/1]via 172.16.12.1,00:00:08,Serial0

[20/1]via 172.16.23.3,00:00:09,Serial1

R172.16.1.0[20/1]via 172.16.12.1,00:00:08,Serial0

C172.16.2.0 is directly connected, Ethernet0

R172.16.3.0[20/1]via 172.16.23.3,00:00:09,Serial1

R2#

Term_Server3

[Resuming connection 3 to R3 ... ]

R3(config-.router)#end

R3#sh ip route

Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP

D - EIGRP, EX -EIGRP external, 0 - OSPF, IA - OSPF inter area

N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2

E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP

i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 6 subnets

C172.16.23.0 is directly connected, Serial1

R172.16.12.0 [120/13 via 172.16.13.1, 00:00:17, Serial0

[120/1} via 172.16.23.2, 00:00:26, Serial1

C172.16.13.0 is directly connected, SerialO

R172.16.1.0 [120/1] via 172.16.13.1, 00:00:17, Serial0

R172.16.2,0 [120/1] via 172.16.23.2,00:00:26, Serial1

C172.16.3.0 is directly connected, Ethemet0

R3#

(1)RIP协议的基本配置非常简单。首先使用router ip命令进入RIP协议配置模式,然后用network语句声明进入RIP进程的网络。

可以看到netwo比语句中使用的是网络号,而不是子网号。当我们试图把172.16.1.0这一子网号码加入R1的RIP路由进程中而发出network l72.16.0.0的命令后,show running-config的结果会显示此处的语句变成为network 172.16.0.0,即B类网络172.16.0.0下的所有子网都加入了RIP路由进程。

(2)使用show ip route命令查看路由表。在R1路由器上可以看到,通过RIP协议,学马到了与R1不直接相连的网段172.16.23.0、172.16.2.0和17216.3.0。路由表中的项目解释如下。

R172.16.2.0[120/1]via 172.16.12.2,00:00:06,Serial0

R:表示此项路由是由RIP协议获取的,另外,"C,代表直连的网段。

172.16.2.0: 目标网络。

[120/1]:12O是RIP协议的治理距离,1是该条路由的度量值,即Metric值,即跳数。

via:经由的意思。

172.16.12.2:是由当前路由器出发,到达目标网段所需经过的下一个跳点的IP地址。

00:00:06:此条路由产生的时间,即65钟。

Serial0:由此路由器到达目标网段所需使用的接口。

(3)从3台路由器的路由表中可以看出RIP协议工作正常,所有网段的路由条目都已具备。

(4)对于路由器R1的路由表而言。172.16.23.0这条路由项具有2个路径,即表中列出的172.26.12.2和172.16.13.3,表示到达172.16.23.0网段可以通过R2路由器,也可以通过R3路由器,表明有两条等值的路径存在,其度量值均为1。

路由器R2和R3都有类似的路由存在。

(5)从实验拓扑图可以分析出,从R2发送到R3的数据包假如经由R1的话会有较高的带宽(5OOkbit/s),是应该首选的路由。但路由表中显示的实际情况是选择了由R2直接发送到R3。这表明RIP路由协议在进行路由计算时只考虑两个网段之间的跳数这个惟一的度量值,而不考虑诸如带宽。延迟等其他因素。

监测清单5-1记录了RIP协议常用的监测命令的使用。

监测清单5-1 RIP协议常用监测命令

R3#sh ip protocol

Routing Protocol is "rip"

Sending updates every 30 seconds, next due in 24 second

Invalid after 180 seconds, hold down 180, flushed after 240

Outgoing update filter list for all interfaces is

Incoming update filter list for all interfaces is

Redistributing: rip

Default version control: send version 1, receive any version

InterfaceSendRecvTriggered TIPKey-chain

Ethernet0112

Serial0112

Serial1112

Autonaatic network sunamarization is in effect

Routing for Networks:

172.16.0.0

Routing Information Sources:

GatewayDistanceLast Update

172.16.23.212000:00:14

172.16.13.112000:00:00

Distance: (default is 120)

R3#pmg 172.16.1.1

Type escape sequence to abort.

Sending 5, 100-bytelCMPEchos to 172.16.1.1,timeout is 2 seconds:

!!!!!

SUCcess rate is 100 percent (5/5), rouad-tripmin/avg/max=8/8/8 ms

R3#trace 172.16.1.1

Type escape sequence to abort.

Tracing the route to 172.16.1.1

1 172.16.13.14 msec *

R3#conft

Enter configuration commands, one per line. End with CNTL/Z.

R3(config)#int s1

R3(config-if)#shut

R3(config-if)#end

R3#sh ip route

Codes: C - connecte-IS inter area

* - candidate default, U - per-user static route, o - ODR

P - periodic downloaded static route

Gateway of last resort is not set

172.16.0.0/24 is subnetted, 5 subnets

R172.16.12.0 [120/1] via 172.16.13.1, 00:00:04, Serial0

C172.16.13.0 is directly connected, Serial0

R172.16.1.0 [120/1] via 172.16.13.1, 00:00:04, Serial0

R172.16.2.0 (.120/21 via 17246.13.1, 00:00:04,Serial0

C172.16.3.01s directly connected, Ethernet0

R3#trace 172.16.2.2

Type escape sequence to abort.

Tracing the route to 172.16.2.2

1 172.16.13.14 msec 4 msec 8 msec

2 172.16.12.2 16 msec 8 msec*

R3#conft

Enter configuration commands,one per line.End with CNTL/Z.

R3(config)#int s1

R3(ocnfig-if)#no sh

R3(config-if)#exit

R3(config)#logg con

R3(config)#exit

R3#de

01:29:45:%SYS-5CONFIG_I:Configured from console by console

R3:debug ip rip

RIP protocol debugging is on

R3#

01:29:56:RIP:sending v1 update to 255.255.255.255 via Ethernet0(172.16.3.3)

01:29:56:RIP:build update entries

01:29:56: subnet 172.16.1.0 metric 2

01:29:56: subnet 172.16.2.0 metric 2

01:29:56: subnet 172.16.12.0 metric 2

01:29:56: subnet 172.16.13.0 metric 1

01:29:56: subnet 172.16.23.0 metric 1

01:29:56: RIP: sending v1 update to 255.255.255.255 via Serial0 (172.16.13.3)

01:29:56: RIP: build update entries

01:29:56: subnet 172.16.2.0 metric 2

01:29:56: subnet 172.16.3.0 metric 1

01:29:56: subnet 172.16.23.0 metric 1

01:29:56: RIP: sending v1 update to 255.255.255.255 via Serial1 (172.16.23.3)

01:29:56: RIP: build update entries

01:29:56: subnet 172.16.1.0 metric 2

01:29:56: subnet 172.16.3.0 metric 1

01:29:56: subnet 172.16.13.0 metric 1

01:30:00: RIP: received v1 update from 172.16.23.2 on Serial1

01:30:00:172.16.1.0 in 2 hops

01:30:00:172.16.2.0 in 1 hops

01:30:00:172.16.12.0 in 1 hops

R3#

01:30:07: RIP: received v1 update from 172.16.13.1 on Serial0

01:30:07:172.16.1.0 in 1 hops

01:30:07:172.16.2.0 in 2 hops

01:30:07:172.16.12.0 in 1 hops

R3-#indebug all

(1)show ip protocol命令的执行结果中包含了有关RIP协议的大量信息,主要有:各种计时器信息;

版本信息,发送version 1,接收任何version;

各接口的发送(Send)和接收(Receive)的版本;

自动汇总生效(Automatic network summarization is in effect);

所路由的网络,172.16.0.0;

路由信息源,即从何处学月来的路由;

治理距离,缺省值为120。

(2)用ping和trace命令测试网络连通性,尤其是trace命令给出了相应的路径信息。

(3)我们把R3路由器的S1接口关闭后,使用show ip route指令查看路由表,显示到达172.16.2.0的路由己经变为R1,度量值也变为2.

trace命令的结果也显示了这一变化。

(4)使用debug ip rip命令可以监测到RIP协议的路由更新发送和接收情况,在此命令后面的若干行中,可以看出RIP协议工作的特点,大致有以下几点:

更新信息缺省情况下向所有参与路由的接口发送;

RIP版木1的更新包是广播包,即目的地址为255.255.255.255;

RIP把整个路由表向相邻路由器发送;

当前所有接口发送和接收的RIP更新包的版本均为1。

(5)最后应关闭debug进程。

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
2023年上半年GDP全球前十五强
 百态   2023-10-24
美众议院议长启动对拜登的弹劾调查
 百态   2023-09-13
上海、济南、武汉等多地出现不明坠落物
 探索   2023-09-06
印度或要将国名改为“巴拉特”
 百态   2023-09-06
男子为女友送行,买票不登机被捕
 百态   2023-08-20
手机地震预警功能怎么开?
 干货   2023-08-06
女子4年卖2套房花700多万做美容:不但没变美脸,面部还出现变形
 百态   2023-08-04
住户一楼被水淹 还冲来8头猪
 百态   2023-07-31
女子体内爬出大量瓜子状活虫
 百态   2023-07-25
地球连续35年收到神秘规律性信号,网友:不要回答!
 探索   2023-07-21
全球镓价格本周大涨27%
 探索   2023-07-09
钱都流向了那些不缺钱的人,苦都留给了能吃苦的人
 探索   2023-07-02
倩女手游刀客魅者强控制(强混乱强眩晕强睡眠)和对应控制抗性的关系
 百态   2020-08-20
美国5月9日最新疫情:美国确诊人数突破131万
 百态   2020-05-09
荷兰政府宣布将集体辞职
 干货   2020-04-30
倩女幽魂手游师徒任务情义春秋猜成语答案逍遥观:鹏程万里
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案神机营:射石饮羽
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案昆仑山:拔刀相助
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案天工阁:鬼斧神工
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案丝路古道:单枪匹马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:与虎谋皮
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:李代桃僵
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案镇郊荒野:指鹿为马
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:小鸟依人
 干货   2019-11-12
倩女幽魂手游师徒任务情义春秋猜成语答案金陵:千金买邻
 干货   2019-11-12
 
推荐阅读
 
 
 
>>返回首頁<<
 
靜靜地坐在廢墟上,四周的荒凉一望無際,忽然覺得,淒涼也很美
© 2005- 王朝網路 版權所有