7【工程实验室】【RIPv2配置】



《7【工程实验室】【RIPv2配置】》由会员分享,可在线阅读,更多相关《7【工程实验室】【RIPv2配置】(12页珍藏版)》请在装配图网上搜索。
1、 实验 RIPv2 配置 【实验名称】 RIPv2 配置。 【实验目的】 理解 RIP 两个版本之间的区别,掌握如何配置 RIPv2。 【背景描述】 假设在校园网在地理上分为 2 个区域,每个区域内分别有一台路由器连接了 2 个子网, 需要将两台路由器通过以太网链路连接在一起并进行适当的配置,以实现这 4 个子网之间的 互联互通。为了在未来每个校园区域扩充子网数量的时候,管理员不需要同时更改路由器的 配置,计划使用 RIP 路由协议实现子网之间的互通。 【需求分析】 两台
2、路由器通过快速以太网端口连接在一起,每个路由器上设置 2 个 Loopback 端口模 拟子网,在所有端口运行 RIP 路由协议,实现所有子网间的互通。 【实验拓扑】 图 7‐2 实验拓扑图 【实验设备】 路由器 2 台 【预备知识】 路由器的工作原理和基本配置方法,距离矢量路由协议,RIP 工作原理,RIPv1 和 RIPv2 的区别,RIPv2 的配置方法 【实验原理】 RIP 协议有两个版本 RIPv1 和 RIPv2。 RIPv1 属于有类路由协议,不支持 VLSM(变长子网
3、掩码),RIPv1 是以广播的形式进 行路由信息的更新的;更新周期为 30 秒。 RIPv2 属于无类路由协议,支持 VLSM(变长子网掩码),RIPv2 是以组播的形式进行 路由信息的更新的,组播地址是 224.0.0.9。RIPv2 还支持基于端口的认证,提高网络的安全 性。 【实验步骤】 第一步:配置两台路由器的主机名、接口 IP 地址 RSR20#configure terminal Enter configuration commands, one per line. End with CNTL/Z. RSR20(
4、config)#hostname RouterA RouterA(config)# RouterA(config)#interface fastEthernet 0/0 RouterA(config-if)#ip address 192.168.1.1 255.255.255.0 RouterA(config-if)#no shutdown RouterA(config-if)#exit RouterA(config)# RouterA(config)#interface loopback 0 RouterA(config-if)#Aug 15 23:46:32 RouterA
5、 %7:%LINE PROTOCOL CHANGE: Interface Loopback 0, changed state to UP RouterA(config-if)#ip address 172.16.1.1 255.255.255.0 RouterA(config-if)#exit RouterA(config)# RouterA(config)#interface loopback 1 RouterA(config-if)#Aug 15 23:47:00 RouterA %7:%LINE PROTOCOL CHANGE: Interface Loopback 1,
6、changed state to UP RouterA(config-if)#ip address 172.16.2.1 255.255.255.0 RouterA(config-if)#exit RSR20#configure terminal Enter configuration commands, one per line. End with CNTL/Z. RSR20(config)#hostname RouterB RouterB(config)# RouterB(config)#interface fastEthernet 0/0 RouterB(conf
7、ig-if)#ip address 192.168.1.2 255.255.255.0 RouterB(config-if)#no shutdown RouterB(config-if)#exit RouterB(config)# RouterB(config)#interface loopback 0 RouterB(config-if)#Aug 8 21:00:00 RouterB %7:%LINE PROTOCOL CHANGE: Interface Loopback 0, changed state to UP RouterB(config-if)#ip address
8、10.1.1.1 255.255.255.0 RouterB(config-if)#exit RouterB(config)# RouterB(config)#interface loopback 1 RouterB(config-if)#Aug 8 21:00:28 RouterB %7:%LINE PROTOCOL CHANGE: Interface Loopback 1, changed state to UP RouterB(config-if)#ip address 10.2.2.1 255.255.255.0 RouterB(config-
9、if)#exit 第二步:在两台路由器上启用 RIPv2,但不关闭自动汇总 RouterA(config)#router rip RouterA(config-router)#network 192.168.1.0 RouterA(config-router)#network 172.16.1.0 RouterA(config-router)#version 2 !配置使用 RIPv2 RouterA(config-router)#exit RouterB(config)#router rip RouterB(config-router)#network 192.
10、168.1.0 RouterB(config-router)#network 10.0.0.0 RouterB(config-router)#version 2 RouterB(config-router)#exit 第三步:查看路由表 从路由表中可以看到,仍然只有 B 类主网络 172.16.0.0/16 和 A 类主网络 10.0.0.0/8 出 现在路由表之中。虽然 RIPv2 支持 VLSM,但 RouterA 和 RouterB 都是边界路由器,分别 是 B 类主网络 172.16.0.0/16 和 C 类主网络 192.168.1.0/24 的边界、A 类主网络
11、10.0.0.0/8 和 C 类主网络 192.168.1.0/24 的边界,因此在执行自动的路由汇总。 RouterA#show ip route Codes: C - connected, S - static, R - RIP B - BGP O - 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 i - IS-IS, L1 - I
12、S-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set R C C C C C C 10.0.0.0/8 [120/1] via 192.168.1.2, 00:00:10, FastEthernet 0/0 172.16.1.0/24 is directly connected, Loopback 0 172.16.1.1/32 is local host. 172.16.2.0/24 i
13、s directly connected, Loopback 1 172.16.2.1/32 is local host. 192.168.1.0/24 is directly connected, FastEthernet 0/0 192.168.1.1/32 is local host. RouterB#show ip route Codes: C - connected, S - static, R - RIP B - BGP O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 -
14、OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set C 10.1.1.0/24 is directly connected, Loopback 0 C 10.1.1.1/32 is
15、local host. C 10.2.2.0/24 is directly connected, Loopback 1 C 10.2.2.1/32 is local host. R C C 172.16.0.0/16 [120/1] via 192.168.1.1, 00:00:02, FastEthernet 0/0 192.168.1.0/24 is directly connected, FastEthernet 0/0 192.168.1.2/32 is local host. 第四步:关闭自动路由汇总 RouterA(config)#rout
16、er rip RouterA(config-router)#no auto-summary !关闭 RIPv2 的自动路由汇总功能 RouterA(config-router)#end RouterB(config)#router rip RouterB(config-router)#no auto-summary RouterB(config-router)#end 第五步:查看 RIP 配置信息,路由表 RouterA#show ip route Codes: C - connected, S - static, R - RIP B - BGP O - OS
17、PF, 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 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set R 10.1.1.0/24 [120/
18、1] via 192.168.1.2, 00:00:03, FastEthernet 0/0 R 10.2.2.0/24 [120/1] via 192.168.1.2, 00:00:03, FastEthernet 0/0 C 172.16.1.0/24 is directly connected, Loopback 0 C 172.16.1.1/32 is local host. C 172.16.2.0/24 is directly connected, Loopback 1 C 172.16.2.1/32 is local host. C 192.1
19、68.1.0/24 is directly connected, FastEthernet 0/0 C 192.168.1.1/32 is local host. !可以看到 RIP 路由表中已经学习到了子网的路由 RouterA#show ip rip Routing Protocol is "rip" Sending updates every 30 seconds, next due in 23 seconds Invalid after 180 seconds, flushed after 120 seconds Outgoing
20、update filter list for all interface is: not set Incoming update filter list for all interface is: not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive version 2 Interface Send Recv Key-chain FastEthernet 0/0 2 2 Loopb
21、ack 0 2 2 Loopback 1 2 2 Routing for Networks: 172.16.0.0 192.168.1.0 Distance: (default is 120) !在配置 RIPv2 版本后,RIP 路由器将只接收和发送版本 2 的更新报文 RouterA#show ip rip database 10.0.0.0/8 auto-summary 10.1.1.0/24 [1] via 192.168.1.2 FastEthernet 0/0 00:28 10.2.2.0/24 [
22、1] via 192.168.1.2 FastEthernet 0/0 00:28 172.16.0.0/16 auto-summary 172.16.1.0/24 [1] directly connected, Loopback 0 172.16.2.0/24 [1] directly connected, Loopback 1 192.168.1.0/24 auto-summary 192.168.1.0/24 [1] directly connected, FastEthernet 0/0 !RIP 的数据库中保存了子网条目的信息 RouterA#sh
23、ow ip rip interface FastEthernet 0/0 is up, line protocol is up Routing Protocol: RIP Receive RIPv2 packets only Send RIPv2 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Disabled Multicast registe: Registed Interface Summary Rip: Not Configured
24、 IP interface address: 192.168.1.1/24 FastEthernet 0/1 is down, line protocol is down RIP is not enabled on this interface Null 0 is up, line protocol is up RIP is not enabled on this interface Loopback 0 is up, line protocol is up Routing Protocol: RIP Receive RIPv2 packets only Send RIPv
25、2 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Disabled Multicast registe: Registed Interface Summary Rip: Not Configured IP interface address: 172.16.1.1/24 Loopback 1 is up, line protocol is up Routing Protocol: RIP Receive RIPv2 packets only Send RIPv2
26、 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Disabled Multicast registe: Registed Interface Summary Rip: Not Configured IP interface address: 172.16.2.1/24 RouterB#show ip route Codes: C - connected, S - static, R - RIP B - BGP O - OSPF, IA - OSPF int
27、er area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default Gateway of last resort is no set C 10.1.1.0/24 is directly connected,
28、 Loopback 0 C 10.1.1.1/32 is local host. C 10.2.2.0/24 is directly connected, Loopback 1 C 10.2.2.1/32 is local host. R R C C 172.16.1.0/24 [120/1] via 192.168.1.1, 00:00:22, FastEthernet 0/0 172.16.2.0/24 [120/1] via 192.168.1.1, 00:00:22, FastEthernet 0/
29、0 192.168.1.0/24 is directly connected, FastEthernet 0/0 192.168.1.2/32 is local host. RouterB#show ip rip Routing Protocol is "rip" Sending updates every 30 seconds, next due in 22 seconds Invalid after 180 seconds, flushed after 120 seconds Outgoing update filter list for all interfac
30、e is: not set Incoming update filter list for all interface is: not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive version 2 Interface Send Recv Key-chain FastEthernet 0/0 Loopback 0 Loopback 1 2 2 2 2 2 2 Rout
31、ing for Networks: 10.0.0.0 192.168.1.0 Distance: (default is 120) RouterB# RouterB#show ip rip dat RouterB#show ip rip database 10.0.0.0/8 auto-summary 10.1.1.0/24 [1] directly connected, Loopback 0 10.2.2.0/24 [1] directly connected, Loopback 1 172.16.0.0/16 auto-summary 172.16
32、.1.0/24 [1] via 192.168.1.1 FastEthernet 0/0 00:02 172.16.2.0/24 [1] via 192.168.1.1 FastEthernet 0/0 00:02 192.168.1.0/24 auto-summary 192.168.1.0/24 [1] directly connected, FastEthernet 0/0 RouterB#show ip rip interface FastEthernet 0/0 is up, line protocol is up Routing Protocol: R
33、IP Receive RIPv2 packets only Send RIPv2 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Disabled Multicast registe: Registed Interface Summary Rip: Not Configured IP interface address: 192.168.1.2/24 FastEthernet 0/1 is down, line protocol is d
34、own RIP is not enabled on this interface Null 0 is up, line protocol is up RIP is not enabled on this interface Loopback 0 is up, line protocol is up Routing Protocol: RIP Receive RIPv2 packets only Send RIPv2 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Di
35、sabled Multicast registe: Registed Interface Summary Rip: Not Configured IP interface address: 10.1.1.1/24 Loopback 1 is up, line protocol is up Routing Protocol: RIP Receive RIPv2 packets only Send RIPv2 packets only Passive interface: Disabled Split horizon: Enabled V2 Broadcast: Disab
36、led Multicast registe: Registed Interface Summary Rip: Not Configured IP interface address: 10.2.2.1/24 第六步:测试网络连通性 RouterA#ping 10.1.1.1 Sending 5, 100-byte ICMP Echoes to 10.1.1.1, timeout is 2 seconds: < press Ctrl+C to break > !!!!! Success rate is 100 percent (5/5), round-trip min/
37、avg/max = 1/2/10 ms RouterA#ping 10.2.2.1 Sending 5, 100-byte ICMP Echoes to 10.2.2.1, timeout is 2 seconds: < press Ctrl+C to break > !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms RouterB#ping 172.16.1.1 Sending 5, 100-byte ICMP Echoes to 17
38、2.16.1.1, timeout is 2 seconds: < press Ctrl+C to break > !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms RouterB#ping 172.16.2.1 Sending 5, 100-byte ICMP Echoes to 172.16.2.1, timeout is 2 seconds: < press Ctrl+C to break > !!!!! Success rate is 100 percent (5
39、/5), round-trip min/avg/max = 1/2/10 ms 第七步:用 debug 命令观察路由器接收和发生路由更新的情况 下面是一个完整的 RIPv2 路由器接收更新和发送更新的过程,从中可以看到 RouterB 接收到了 RouterA 发送的更新,其中包含两条路由信息 172.16.1.0 和 172.16.2.0(可以看 到水平分割原则的作用),然后刷新了路由表。 RouterB 本身发送的更新报文则在 Fa0/0、Lo0 和 Lo1 三个端口发出,使用组播方式, 组播地址为 224.0.0.9,使用的是 UDP 520 端口。在水平分割的原则下,每
40、个端口发送的路 由信息均不相同。 注意 RIPv2 的更新报文格式和 RIPv1 的不同。 RouterB#debug ip rip RouterB#Aug 8 21:58:08 RouterB %7: [RIP] RIP recveived packet, sock=2125 src=192.168.1.1 len=44 Aug 8 21:58:08 RouterB %7: [RIP] Cancel peer remove timer Aug 8 21:58:08 RouterB %7:[RIP] Peer remove timer shedule... Aug 8
41、21:58:08 RouterB %7: [RIP] Both do not need auth, Auth ok Aug 8 21:58:08 RouterB %7: route-entry: family 2 tag 0 ip 172.16.1.0 mask 255.255.255.0 nhop 0.0.0.0 metric 1 Aug 8 21:58:08 RouterB %7: route-entry: family 2 tag 0 ip 172.16.2.0 mask 255.255.255.0 nhop 0.0.0.0 metric 1 Aug 8 2
42、1:58:08 RouterB %7: [RIP] Received version 2 response packet Aug 8 21:58:08 RouterB %7: [RIP] routesrc=192.168.1.1 intf=1 Aug 8 21:58:08 RouterB %7: [RIP] routesrc=192.168.1.1 Old path is: nhop=192.168.1.1 New path is: nhop=192.168.1.1 Aug 8 21:58:08 RouterB %7: [RIP] [172.16.1
43、.0/24] RIP route refresh! Aug 8 21:58:08 RouterB %7: [RIP] [172.16.1.0/24] RIP distance apply from 192.168.1.1! Aug 8 21:58:08 RouterB %7: [RIP] [172.16.1.0/24] ready to refresh kernel... Aug 8 21:58:08 RouterB %7: [RIP] NSM refresh: IPv4 RIP Route 172.16.1.0/24 distance=120 metri
44、c=1 nexthop_num=1 distance=120 nexhop=192.168.1.1 ifindex=1 Aug 8 21:58:08 RouterB %7: [RIP] [172.16.1.0/24] cancel route timer Aug 8 21:58:08 RouterB %7: [RIP] [172.16.1.0/24] route timer schedule... Aug 8 21:58:08 RouterB %7: [RIP] routesrc=192.168.1.1 intf=1 Aug 8 21:58:08 RouterB %7:
45、[RIP] Old path is: nhop=192.168.1.1 New path is: nhop=192.168.1.1 routesrc=192.168.1.1 Aug 8 21:58:08 RouterB %7: [RIP] [172.16.2.0/24] RIP route refresh! Aug 8 21:58:08 RouterB %7: [RIP] [172.16.2.0/24] RIP distance apply from 192.168.1.1! Aug 8 21:58:08 RouterB %7: [RIP] [172.16.2.0/
46、24] ready to refresh kernel... Aug 8 21:58:08 RouterB %7: [RIP] NSM refresh: IPv4 RIP Route 172.16.2.0/24 distance=120 metric=1 nexthop_num=1 distance=120 nexhop=192.168.1.1 ifindex=1 Aug 8 21:58:08 RouterB %7: [RIP] [172.16.2.0/24] cancel route timer Aug 8 21:58:08 RouterB %7: [RIP] [172.16.2.0
47、/24] route timer schedule... Aug 8 21:58:23 RouterB %7: [RIP] Output timer expired to send reponse Aug 8 21:58:23 RouterB %7: [RIP] Prepare to send MULTICAST response... Aug 8 21:58:23 RouterB %7: [RIP] Building update entries on FastEthernet 0/0 Aug 8 21:58:23 RouterB %7: Aug 8 21:58:23 Rout
48、erB %7: 10.1.1.0/24 via 0.0.0.0 metric 1 tag 0 10.2.2.0/24 via 0.0.0.0 metric 1 tag 0 Aug 8 21:58:23 RouterB %7: [RIP] Send packet to 224.0.0.9 Port 520 on FastEthernet 0/0 Aug 8 21:58:23 RouterB %7: [RIP] Prepare to send MULTICAST response... Aug 8 21:58:23 RouterB %7: [RIP] Building updat
49、e entries on Loopback 0 Aug 8 21:58:23 RouterB %7: Aug 8 21:58:23 RouterB %7: Aug 8 21:58:23 RouterB %7: Aug 8 21:58:23 RouterB %7: 10.2.2.0/24 via 0.0.0.0 metric 1 tag 0 172.16.1.0/24 via 0.0.0.0 metric 2 tag 0 172.16.2.0/24 via 0.0.0.0 metric 2 tag 0 192.168.1.0/24 via 0.0.0.0 metric 1
50、tag 0 Aug 8 21:58:23 RouterB %7: [RIP] Send packet to 224.0.0.9 Port 520 on Loopback 0 Aug 8 21:58:23 RouterB %7: [RIP] Prepare to send MULTICAST response... Aug 8 21:58:23 RouterB %7: [RIP] Building update entries on Loopback 1 Aug 8 21:58:23 RouterB %7: Aug 8 21:58:23 RouterB %7: Aug 8
51、21:58:23 RouterB %7: Aug 8 21:58:23 RouterB %7: 10.1.1.0/24 via 0.0.0.0 metric 1 tag 0 172.16.1.0/24 via 0.0.0.0 metric 2 tag 0 172.16.2.0/24 via 0.0.0.0 metric 2 tag 0 192.168.1.0/24 via 0.0.0.0 metric 1 tag 0 Aug 8 21:58:23 RouterB %7: [RIP] Send packet to 224.0.0.9 Port 520 on Loopback
52、1 Aug 8 21:58:23 RouterB %7: [RIP] Schedule response send timer 【注意事项】 1、配置 RIP 的 Network 命令时只支持 A、B、C 的主网络号,如果写入子网则自动转为主 网络号。 2、No auto-summary 功能只有在 RIPv2 支持。 3、如果刚配置了 no auto-summary 命令后立刻查看路由表,除了能看到子网的路由条目外, 还可以看到原本主网络的路由条目,该主网络的路由条目将在无效计时器、刷新计时器超时 后才会被清除。 【参考配置】 Rout
53、erA#show running-config Building configuration... Current configuration : 642 bytes ! version RGNOS 10.1.00(4), Release(18443)(Tue Jul 17 20:50:30 CST 2007 -ubu1server) hostname RouterA ! ! interface FastEthernet 0/0 ip address 192.168.1.1 255.255.255.0 duplex auto speed auto ! inte
54、rface FastEthernet 0/1 duplex auto speed auto ! interface Loopback 0 ip address 172.16.1.1 255.255.255.0 ! interface Loopback 1 ip address 172.16.2.1 255.255.255.0 ! router rip version 2 network 172.16.0.0 network 192.168.1.0 no auto-summary ! line con 0 line aux 0 li
55、ne vty 0 4 login ! end RouterB#show running-config Building configuration... Current configuration : 636 bytes ! version RGNOS 10.1.00(4), Release(18443)(Tue Jul 17 20:50:30 CST 2007 -ubu1server) hostname RouterB ! ! interface FastEthernet 0/0 ip address 192.168.1.2 255.255.255.
56、0 duplex auto speed auto ! interface FastEthernet 0/1 duplex auto speed auto ! interface Loopback 0 ip address 10.1.1.1 255.255.255.0 ! interface Loopback 1 ip address 10.2.2.1 255.255.255.0 ! router rip version 2 network 10.0.0.0 network 192.168.1.0 no auto-summary ! line con 0 line aux 0 line vty 0 4 login !
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 专题党课讲稿:以高质量党建保障国有企业高质量发展
- 廉政党课讲稿材料:坚决打好反腐败斗争攻坚战持久战总体战涵养风清气正的政治生态
- 在新录用选调生公务员座谈会上和基层单位调研座谈会上的发言材料
- 总工会关于2025年维护劳动领域政治安全的工作汇报材料
- 基层党建工作交流研讨会上的讲话发言材料
- 粮食和物资储备学习教育工作部署会上的讲话发言材料
- 市工业园区、市直机关单位、市纪委监委2025年工作计划
- 检察院政治部关于2025年工作计划
- 办公室主任2025年现实表现材料
- 2025年~村农村保洁员规范管理工作方案
- 在深入贯彻中央8项规定精神学习教育工作部署会议上的讲话发言材料4篇
- 开展深入贯彻规定精神学习教育动员部署会上的讲话发言材料3篇
- 在司法党组中心学习组学习会上的发言材料
- 国企党委关于推动基层党建与生产经营深度融合工作情况的报告材料
- 副书记在2025年工作务虚会上的发言材料2篇