RIPV1:被动接口与单播更新
实验目的
通过本实验可以掌握:
(
1)被动接口的含义、配置和应用场合
(
2)单播更新的应用场合和配置
(
3)RIPv1使用子网地址的条件
(
4)RIPv1接收子网路由的原则
拓扑结构
R1:
R1(config)#int e0/0
R1(config-if)#ip add 172.16.4.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo0
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#v 1
R1(config-router)#network 172.16.0.0
R2:
R2(config)#int e0/0
R2(config-if)#ip add 172.16.4.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo0
R2(config-if)#ip add 172.16.2.1 255.255.255.0
R2(config-if)#no sh
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#v 1
R2(config-router)#network 172.16.0.0
R3:
R3(config)#int e0/0
R3(config-if)#ip add 172.16.4.3 255.255.255.0
R3(config-if)#no sh
R3(config-if)#int lo0
R3(config-if)#ip add 172.16.3.1 255.255.255.0
R3(config-if)#no sh
R3(config-if)#exit
R3(config)#router rip
R3(config-router)#v 1
R3(config-router)#net
R3(config-router)#network 172.16.0.0
实验调试
分别查看
R1.R2.R3的路有表:
R1#sh ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, 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, su - IS-IS summary, 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, 4 subnets
C
172.16.4.0 is directly connected, Ethernet0/0
C
172.16.1.0 is directly connected, Loopback0
R
172.16.2.0 [120/1] via 172.16.4.2, 00:00:07, Ethernet0/0
R
172.16.3.0 [120/1] via 172.16.4.3, 00:00:21, Ethernet0/0
R2#sh ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, 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, su - IS-IS summary, 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, 4 subnets
C
172.16.4.0 is directly connected, Ethernet0/0
R
172.16.1.0 [120/1] via 172.16.4.1, 00:00:18, Ethernet0/0
C
172.16.2.0 is directly connected, Loopback0
R
172.16.3.0 [120/1] via 172.16.4.3, 00:00:08, Ethernet0/0
从路由器
R1和R2的路由表输出可以看出,它们互相学习到了24位的路由条目,从而 可以说明,某些情况下
RIPv1更新确实可以携带子网信息。
为了达到实验效果:
把R2的e0/0设为被动接口。
R2:
R2(config)#router rip
R2(config-router)#v 1
R2(config-router)#passive-interface e0/0
R2#debug ip rip
RIP protocol debugging is on
R2#
*Mar 1 00:36:17.363: RIP: received v1 update from 172.16.4.3 on Ethernet0/0
*Mar 1 00:36:17.363:
172.16.3.0 in 1 hops
*Mar 1 00:36:18.255: %SYS-5-CONFIG_I: Configured from console by console
R2#
*Mar 1 00:36:18.687: RIP: received v1 update from 172.16.4.1 on Ethernet0/0
*Mar 1 00:36:18.687:
172.16.1.0 in 1 hops
R2#
*Mar 1 00:36:24.007: RIP: sending v1 update to 255.255.255.255 via Loopback0 (172.16.2.1)
*Mar 1 00:36:24.007: RIP: build update entries
*Mar 1 00:36:24.007:
subnet 172.16.1.0 metric 2
*Mar 1 00:36:24.007:
subnet 172.16.3.0 metric 2
*Mar 1 00:36:24.007:
subnet 172.16.4.0 metric 1
R2#
R2#
*Mar 1 00:36:44.535: RIP: received v1 update from 172.16.4.3 on Ethernet0/0
*Mar 1 00:36:44.535:
172.16.3.0 in 1 hops
R2#
*Mar 1 00:36:45.939: RIP: received v1 update from 172.16.4.1 on Ethernet0/0
*Mar 1 00:36:45.943:
172.16.1.0 in 1 hops
从以上输出可以看出,路由器R2确实不向被动接口e0/0发送路由更新,但被动接口e0/0能接受路由更新。
R2
单播更新指向R1
R2:
R2(config)#router rip
R2(config-router)#v 1
R2(config-router)#neighbor 172.16.4.1
实验调试:
分别查看
R1和R3的路由表:
R1#sh ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, 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, su - IS-IS summary, 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, 4 subnets
C
172.16.4.0 is directly connected, Ethernet0/0
C
172.16.1.0 is directly connected, Loopback0
R 172.16.2.0 [120/1] via 172.16.4.2, 00:00:00, Ethernet0/0
R
172.16.3.0 [120/1] via 172.16.4.3, 00:00:12, Ethernet0/0
R3#sh ip ro
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, 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, su - IS-IS summary, 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, 3 subnets
C
172.16.4.0 is directly connected, Ethernet0/0
R
172.16.1.0 [120/1] via 172.16.4.1, 00:00:00, Ethernet0/0
C
172.16.3.0 is directly connected, Loopback0
分别查看
R1和R3的路由表可以得知:R1学习到R2的环回口路由条目,而在R3却没有学习到R2的环回口路由条目。
总结:
RIPv1路由更新可以携带子网信息必须同时满足两个条件:
(1)整个网络所有地址在同一个主类网络;
(2)子网掩码长度必须相同
(3)被动接口只能接收路由更新,不能以广播或组播方式发送更新,但是可以以单播的方式 发送更新,配置单播更新的命令如下:
R1(config-router)#neighbor A.B.C.D