RIP 实验 路由交换与技术
实验目的:
1、掌握动态协议的配置。
2、学会实验出错时排查。
3、掌握路由器的基本命令配置。
4、熟练掌握GNS3软件的配置方法。
5、进一步理解网络配置的基本原理。
实验拓扑: 1. R1配置接口IP地址以及环回地址命令 R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface Loopback0 R1(config-if)# *Mar 19 14:56:00.007: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up R1(config-if)#ip a R1(config-if)#ip add R1(config-if)#ip address 10.52.52.1 255.255.255.0 R1(config-if)#ip address 10.52.53.1 255.255.255.0 secondary R1(config-if)#ip address 10.52.54.1 255.255.255.0 secondary R1(config-if)#ip address 10.52.55.1 255.255.255.0 secondary R1(config-if)# R1(config-if)#interface Loo R1(config-if)#interface Loob R1(config-if)#interface Loopback1 R1(config-if)# *Mar 19 14:57:33.783: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up R1(config-if)#ip address 192.168.3.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)#interface Loopback0 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#interface f0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown R1(config-if)# *Mar 19 15:03:24.627: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 19 15:03:25.627: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)#
2. R2路由器接口地址及环回地址配置命令 R2#configure termina Enter configuration commands, one per line. End with CNTL/Z. R2(config)#interface f0/0 R2(config-if)#ip address 192.168.1.2 255.255.255.0 R2(config-if)#no shutdown R2(config-if)# R2(config-if)# *Mar 19 14:59:51.539: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 19 14:59:52.539: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R2(config-if)#interface f0/1 R2(config-if)#ip address 192.168.2.1 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#interface Loopback0 R2(config-if)#ip *Mar 19 15:09:16.739: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up R2(config-if)#ip address 192.168.4.1 255.255.255.0 R2(config-if)#no shutdown R2(config-if)#
3. R3路由器接口IP地址及环回地址配置命令 R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#interface f0/1 R3(config-if)#ip address 192.168.2.2 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#intera *Mar 19 15:11:43.695: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up *Mar 19 15:11:44.695: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up R3(config-if)#interface Loopback0 R3(config-if)#ip *Mar 19 15:11:58.583: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to up R3(config-if)#ip address 10.52.72.1 255.255.255.0 R3(config-if)#ip address 10.52.73.1 255.255.255.0 secondary R3(config-if)#ip address 10.52.74.1 255.255.255.0 secondary R3(config-if)#ip address 10.52.75.1 255.255.255.0 secondary R3(config-if)#no shutdown R3(config-if)#interface Loopback1 R3(config-if)#nos *Mar 19 15:13:06.339: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback1, changed state to up R3(config-if)#ip address 192.168.5.1 255.255.255.0 R3(config-if)#no shutdown R3(config-if)#
二、在路由器中配置RIP协议
R1路由器配置: R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router rip R1(config-router)#network 10.0.0.0 R1(config-router)#network 192.168.1.0 R1(config-router)#network 192.168.3.0 R1(config-router)#
R2路由器配置: R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router rip R2(config-router)#network 192.168.1.0 R2(config-router)#network 192.168.4.0 R2(config-router)#
R3路由器配置: R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#router rip R3(config-router)#network 10.0.0.0 R3(config-router)#network 192.168.2.0 R3(config-router)#network 192.168.5.0 R3(config-router)# R3(config-router)#
问题1:配置后在每个路由器上查看路由表,在路由器R1、R2上能看到192.168.5.0吗?在路由器R3中能看到路由器R1和R2中的路由吗? 答:
1.查看路由器R1路由表(发现看不到192.168.5.0)
2.查看路由器R2路由表(发现看不到192.168.5.0)
3.查看路由器R3路由表
问题2:现在路由器R2中添加192.168.2.0,在查看每个路由的路由表,看有什么变化
答: 在路由器R2中添加命令: R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#router rip R2(config-router)#network 192.168.2.0 R2(config-router)#
查看路由器R1路由表:(发现多了192.168.2.0、192.168.5.0路由信息) 查看路由器R2路由表:(发现多了192.168.5.0和192.168.2.2的路由信息) 查看路由器R3路由表:(发现多了192.168.4.0、192.168.1.0、192.168.3.0的路由信息)
问题3:这时在路由器R3中ping10.10.52.1,看能否ping通,为什么?提示:看路由表
答:此时在路由器R3ping 10.52.52.1 发现根本ping不通 通过查看路由表发现此时路由表中并没有去往10.52.52.1网段的路由信息,如果需要ping通10.52.52.1需要宣告10.52.52.0的rip协议
三、配置RIPv2,查看路由表 R1配置命令: R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#router rip R1(config-router)#version 2 R1(config-router)#end R1# clear ip route *
问题4:在R1中能否看到R2和R3的路由?在R2中能否看到R1的路由?
查看路由器R1路由表:(发现在R1中没有R2和R3的路由)
查看路由器R2路由表:(此时R2中也没有R1的路由信息)
四、配置手动汇总,解决问题3中无法通信问题。
1. 将R2、R3也启用version2 R2配置RIPv2命令: R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)# R2(config)#router rip R2(config-router)#version 2 R3配置RIPv2命令: R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#router rip R3(config-router)#version 2 R3(config-router)# 2.关闭自动汇总,进行手动汇总 R1配置手动汇总命令: R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface f0/0 R1(config-if)#ip summary-address rip 10.52.52.0 255.255.252.0 R1(config-if)# R3配置手动汇总命令: R3(config-if)#no ip summary-address rip 10.52.72.0 255.255.252.0 R3(config-if)#interface f0/1 R3(config-if)#ip summary-address rip 10.52.72.0 255.255.252.0 R3(config-if)#end R3# *Mar 19 17:59:26.171: %SYS-5-CONFIG_I: Configured from console by console
问题5:此时在路由器R3上ping 10.52.52.1,能否ping通? 答:此时在在路由器R3上ping 10.52.52.1已经可以ping通
五、在路由器R3上启用默认路由,让内部网络可以访问Internet 1.在路由器R3上配置静态默认路由,并向其他路由注入默认路由 R3配置命令: R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#ip route 0.0.0.0 0.0.0.0 211.52.52.52 R3(config)#router rip R3(config-router)#default-information originate R3(config-router)#
问题6:在R1和R2中查看路由表,有什么变化?此时在R1中ping 211.52.52.52能否ping通? 答:路由表中多了一条默认路由,但是并不能ping通目标IP,因为目标IP并不实际存在
七、在路由器R1和R2之间实现认证 R1配置命令: R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#key chain zjb R1(config-keychain)#key 1 R1(config-keychain-key)#key-string zjb0052 R1(config-keychain-key)#interface f0/0 R1(config-if)#ip rip authentication key-chain zjb R1(config-if)#ip rip % Incomplete command.
R1(config-if)#ip rip authentication mode md5 R1(config-if)#
问题7:在R1中配置后,删除R1和R2的当前路由表,重新生成,在R1中能否看到其他路由器上的路由? 答:此时R1仅有自己直连的路由信息,并不能看到其他路由的路由信息 八、参考R1的配置,在R2中做同样的认证配置,然后更新路由表,在R1中能否看到其他路由器的路由信息? R2配置命令: R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#key chain zjb R2(config-keychain)#key 1 R2(config-keychain-key)#key-string zjb0052 R2(config-keychain-key)#interface f0/0 R2(config-if)#ip rip authentication key-chain zjb R2(config-if)#ip rip authentication mode md5 R2(config-if)#end *Mar 19 18:30:52.511: %SYS-5-CONFIG_I: Configured from console by console R2#clear ip route * 此时更新路由表,在R1上查看路由表(显示此时已经能够看到其他路由器的路由信息) 九、修改路由器R3发送出去的路由信息的度量值 1. 创建访问控制列表ACL,配置需要修改的metric的路由条目 R3配置命令: R3#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R3(config)#access-list 52 permit 192.168.5.0 0.0.0.255 R3(config)#router rip R3(config-router)#offset-list 52 out 2 f0/0 R3(config-router)#
问题8:修改后查看路由器R1上关于192.168.5.0的路由,距离是多少?修改前的距离是多少? 答: 修改之后距离是4(如下图)
修改之前距离是2(如下图)
|