实 验 报 告
日期:2011 年 5 月 17 日 学号 课程 实验名称 一、实验目的
1、熟练掌握在路由器上配置RIP; 2、学习RIP调试。 二、实验环境规划和实验拓扑
有4个路由器的网络,IP地址规划情况如下图所示。
B08050206 班级 网络系统集成 RIP实验2 B080502 姓名 实验 成绩 连双
三、实验步骤
1、使用PT放置4台2621XM;分别关闭电源,安装WIC-2T模块,其中R2要安装两个WIC-2T模块;打开电源;连接串行线路。
2、修改每台路由器的设备名称,按照IP地址规划配置每台路由器的端口地址和环回端口。
R1上的配置(R3、R4以R1为例) Router>en Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#int lo0
%LINK-5-CHANGED: Interface Loopback0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up
R1(config-if)#ip addr 172.31.1.1 255.255.255.0 R1(config-if)#exit R1(config)#int s0/0 R1(config-if)#clock rate 64000
R1(config-if)#ip addr 192.168.16.1 255.255.255.252 R1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial0/0, changed state to down
R2上的配置
Router>en Router#conf t
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2
R2(config)#int s0/0
R2(config-if)#clock ra 64000
R2(config-if)#ip addr 192.168.16.9 255.255.255.252 R2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/0, changed state to down R2(config-if)#exit R2(config)#int s0/1
R2(config-if)#clock ra 64000
R2(config-if)#ip addr 192.168.16.5 255.255.255.252 R2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/1, changed state to down R2(config-if)#exit R2(config)#int s0/2
R2(config-if)#clock ra 64000
R2(config-if)#ip addr 192.168.16.2 255.255.255.252 R2(config-if)#no sh
%LINK-5-CHANGED: Interface Serial0/2, changed state to up R2(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/2, changed state to up
3、查看每台路由器的路由表。 R1#show ip route
..........
172.31.0.0/24 is subnetted, 1 subnets
C 172.31.1.0 is directly connected, Loopback0 192.168.16.0/30 is subnetted, 1 subnets
C 192.168.16.0 is directly connected, Serial0/0
R2#show ip route
......
192.168.16.0/30 is subnetted, 3 subnets
C 192.168.16.0 is directly connected, Serial0/2 C 192.168.16.4 is directly connected, Serial0/1 C 192.168.16.8 is directly connected, Serial0/0
R3#show ip route ......
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.3.0 is directly connected, Loopback0 192.168.16.0/30 is subnetted, 1 subnets
C 192.168.16.4 is directly connected, Serial0/0
R4#show ip route ......
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.4.0 is directly connected, Loopback0 192.168.16.0/30 is subnetted, 1 subnets
C 192.168.16.8 is directly connected, Serial0/0
4、为每台路由器配置RIP协议,并配置指定网络地址。
R1(config)#route rip
R1(config-router)#network 192.168.16.0 R1(config-router)#network 172.31.0.0
R2(config)#route rip
R2(config-router)#network 192.168.16.0
R3(config)#route rip
R3(config-router)#network 192.168.16.0
R3(config-router)#network 172.16.0.0
R4(config)#route rip
R4(config-router)#network 192.168.16.0 R4(config-router)#network 172.16.0.0
5、在每台路由器上查看从RIP邻居处接受的路由表是否已经添加到路由表中(这个命令需要过一段时间执行一次)。
R1#show ip route
R 172.16.0.0/16 [120/2] via 192.168.16.2, 00:00:05, Serial0/0 172.31.0.0/24 is subnetted, 1 subnets
C 172.31.1.0 is directly connected, Loopback0 192.168.16.0/30 is subnetted, 3 subnets
C 192.168.16.0 is directly connected, Serial0/0
R 192.168.16.4 [120/1] via 192.168.16.2, 00:00:05, Serial0/0 R 192.168.16.8 [120/1] via 192.168.16.2, 00:00:05, Serial0/0 R2#show ip route
R 172.16.0.0/16 [120/1] via 192.168.16.10, 00:00:23, Serial0/0 [120/1] via 192.168.16.6, 00:00:24, Serial0/1 R 172.31.0.0/16 [120/1] via 192.168.16.1, 00:00:06, Serial0/2 192.168.16.0/30 is subnetted, 3 subnets
C 192.168.16.0 is directly connected, Serial0/2 C 192.168.16.4 is directly connected, Serial0/1 C 192.168.16.8 is directly connected, Serial0/0 R3#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.3.0 is directly connected, Loopback0
R 172.31.0.0/16 [120/2] via 192.168.16.5, 00:00:21, Serial0/0 192.168.16.0/30 is subnetted, 3 subnets
R 192.168.16.0 [120/1] via 192.168.16.5, 00:00:21, Serial0/0 C 192.168.16.4 is directly connected, Serial0/0
R 192.168.16.8 [120/1] via 192.168.16.5, 00:00:21, Serial0/0 R4#show ip route
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.4.0 is directly connected, Loopback0
R 172.31.0.0/16 [120/2] via 192.168.16.9, 00:00:18, Serial0/0 192.168.16.0/30 is subnetted, 3 subnets
R 192.168.16.0 [120/1] via 192.168.16.9, 00:00:18, Serial0/0 R 192.168.16.4 [120/1] via 192.168.16.9, 00:00:18, Serial0/0 C 192.168.16.8 is directly connected, Serial0/0
6、查看路由器的协议配置和统计信息。
R1#show ip protocols Routing Protocol is \"rip\"
Sending updates every 30 seconds, next due in 6 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip
Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain Serial0/0 1 2 1 Loopback0 1 2 1 Automatic network summarization is in effect Maximum path: 4 Routing for Networks:
172.31.0.0
192.168.16.0
Passive Interface(s): Routing Information Sources:
Gateway Distance Last Update 192.168.16.2 120 00:00:10
Distance: (default is 120) R2#show ip protocols Routing Protocol is \"rip\"
Sending updates every 30 seconds, next due in 9 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip
Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain Serial0/0 1 2 1 Serial0/1 1 2 1 Serial0/2 1 2 1 Automatic network summarization is in effect Maximum path: 4 Routing for Networks:
192.168.16.0
Passive Interface(s): Routing Information Sources:
Gateway Distance Last Update 192.168.16.10 120 00:00:10 192.168.16.6 120 00:00:14 192.168.16.1 120 00:00:01
Distance: (default is 120) R3#show ip protocols Routing Protocol is \"rip\"
Sending updates every 30 seconds, next due in 1 seconds Invalid after 180 seconds, hold down 180, flushed after 240 Outgoing update filter list for all interfaces is not set Incoming update filter list for all interfaces is not set Redistributing: rip
Default version control: send version 1, receive any version Interface Send Recv Triggered RIP Key-chain Serial0/0 1 2 1 Loopback0 1 2 1 Automatic network summarization is in effect Maximum path: 4 Routing for Networks:
172.16.0.0 192.168.16.0
Passive Interface(s): Routing Information Sources:
Gateway Distance Last Update 192.168.16.5 120 00:00:24
Distance: (default is 120) R4#show ip protocols
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.4.0 is directly connected, Loopback0
R 172.31.0.0/16 [120/2] via 192.168.16.9, 00:00:18, Serial0/0 192.168.16.0/30 is subnetted, 3 subnets
R 192.168.16.0 [120/1] via 192.168.16.9, 00:00:18, Serial0/0
R 192.168.16.4 [120/1] via 192.168.16.9, 00:00:18, Serial0/0 C 192.168.16.8 is directly connected, Serial0/0 7、调试RIP
使用下面命令查看RIP的转发过程。
R1#debug ip rip
RIP protocol debugging is on
这时候会看到RIP更新信息不停在屏幕上显示,记录该信息。 R1#RIP: received v1 update from 192.168.16.2 on Serial0/0 172.16.0.0 in 2 hops 192.168.16.4 in 1 hops 192.168.16.8 in 1 hops
RIP: sending v1 update to 255.255.255.255 via Loopback0 (172.31.1.1) RIP: build update entries network 172.16.0.0 metric 3 network 192.168.16.0 metric 1
RIP: sending v1 update to 255.255.255.255 via Serial0/0 (192.168.16.1) RIP: build update entries network 172.31.0.0 metric 1 RIP调试必须使用no debug ip rip关闭。 四、实验总结
使用RIP后动态路由表的生成过程如下:
路由器刚启动RIP时,以广播形式向其相邻路由器发送请求报文,相邻路由器收到请求报文后,响应该请求,并回送包含本地路由信息的响应报文。
路由器收到响应报文后,修改本地路由表,同时向相邻路由器发送触发修改报文,广播路由修改信息。相邻路由器收到触发修改报文后,又向其各自的相邻路由器发送触发修改报文。在一连串的触发修改广播后,各路由器都能得到并保持最新的路由信息。
同时,RIP每隔30秒向其相邻路由器广播本地路由表,相邻路由器在收到报文后,对本地路由进行维护,选择一条最近路由,再向其各自相邻网络广播修改信息,使更新的路由最
终能达到全局有效。
因篇幅问题不能全部显示,请点此查看更多更全内容