实验五RIP动态路由的配置【实验目的】1.灵活掌握RIP的动态路由的配置。
2.掌握路由协议的分类,理解静态路由和动态路由3.掌握动态路由协议RIP的报文格式,工作原理及工作过程【实验学时】建议2学时【实验环境配置】本实验所用的设备为:三台带有2个S0口和三个E0口的路由器,三台PC【实验步骤】一、使用合适的连接将图中所有设备连接起来。
二、使用下列步骤对各设备进行配置。
注意在标注红色的命令上将相应的端口改成自己使用的端口。
1.R1上的配置:Router>Router>enRouter#conf tRouter(config)#host r1r1(config)#int e0r1(config-if)#ip add 172.16.1.1 255.255.255.0r1(config-if)#no shutdownr1(config-if)#exitr1(config)#int s0r1(config-if)#ip add 172.16.2.1 255.255.255.0r1(config-if)#no shutdownr1(config-if)#clock rate 56000r1(config-if)#no shutdownr1(config-if)#exitr1(config)#router ripr1(config-router)#net 172.16.0.0r1(config-router)#^ZRIP协议启用前的路由表r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet0C 172.16.2.0/24 is directly connected, Serial0RIP协议启用后的路由表r1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.1.0/24 is directly connected, Ethernet0C 172.16.2.0/24 is directly connected, Serial0R 172.16.3.0/24 [120/1] via 172.16.2.2, 00:01:37, Serial0R 172.16.4.0/24 [120/1] via 172.16.2.2, 00:07:21, Serial0R 172.16.5.0/24 [120/2] via 172.16.2.2, 00:05:21, Serial02.R2上的配置:Router>Router>enRouter#conf tRouter(config)#host r2r2(config)#int s1r2(config-if)#ip add 172.16.2.2 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#int s0r2(config-if)#ip add 172.16.4.1 255.255.255.0r2(config-if)#clock rate 56000r2(config-if)#no shutdownr2(config-if)#exitr2(config)#int e0r2(config-if)#ip add 172.16.3.1 255.255.255.0r2(config-if)#no shutdownr2(config-if)#exitr2(config)#router ripr2(config-router)#net 172.16.0.0r2(config-router)#^Zr2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.2.0/24 is directly connected, Serial1C 172.16.3.0/24 is directly connected, Ethernet0C 172.16.4.0/24 is directly connected, Serial0R 172.16.1.0/24 [120/1] via 172.16.2.1, 00:09:13, Serial1R 172.16.5.0/24 [120/1] via 172.16.4.2, 00:09:13, Serial03.R3上的配置:Router>Router>enRouter#conf tRouter(config)#int s1Router(config-if)#ip add 172.16.4.2 255.255.255.0Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#int e0Router(config-if)#ip add 172.16.5.1 255.255.255.0Router(config-if)#no shutdownRouter(config-if)#exitRouter(config)#host r3r3(config)#r3(config)#router ripr3(config-router)#net 172.16.0.0r3(config-router)#^Zr3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaE1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate defaultU - per-user static routeGateway of last resort is not setC 172.16.4.0/24 is directly connected, Serial1C 172.16.5.0/24 is directly connected, Ethernet0R 172.16.1.0/24 [120/1] via 172.16.4.1, 00:05:32, Serial1R 172.16.2.0/24 [120/1] via 172.16.4.1, 00:08:19, Serial1R 172.16.3.0/24 [120/1] via 172.16.4.1, 00:05:32, Serial14.测试:r1#r1#pingProtocol [ip]:Target IP address: 172.16.5.2Repeat count [5]:Datagram size [100]:Timeout in seconds [2]:Extended commands [n]:Type escape sequence to abort.Sending 5, 100-byte ICMP Echos to 172.16.5.2, timeout is 2 seconds:Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 msPC 上的配置为:PC1:IP为172.16.1.2 网关:172.16.1.1PC2:IP为172.16.3.2 网关:172.16.3.1PC3:IP为172.16.5.2 网关:172.16.5.1【思考问题】1.RIP使用UDP,这样做有何优点?答:UDP协议本身无法保证路由协议报文的可靠传输,因此RIP就必须通过自身的协议实现来保证路由协议报文在网络中的可靠传输。