此时R1,R2路由表中只有直连网络[em3]
R11#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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, 1 subnets
C 172.16.1.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Serial0
R22#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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, 1 subnets
C 172.16.3.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Serial0
由于R1,R2直连的Loopback0是相同主类网络,并且中间夹杂了一个A类网络 所以形成了不连续的网络
如果在这个网络上启用有类动态路由协议那么就会造成路由器学不到对方直连的网段 因为子网掩码
在有类路由选择协议中是不传递的,有类路由协议只通告接口上直连网络的主网地址
所谓主网地址,就要知道常用的ABC三种有类地址 他们的子网掩码长度分别是8,16,24 子网掩码全为
1的部分称为网络位,在有类路由协议中 如果网络位不同 那么他们的主类地址也不同.
比如说 有类网络192.168.1.0与192.168.2.0 就不属于一个主类网络
172.16.2.0与172.16.3.0属于一个主类网络
某人可以在路由器上开启Debug ip rip 来查看rip的通讯内容
ps:RIP每30s更新一次,如果不想等待30s 可以使用clear ip route * 清除所有路由条目 让RIP立即更新
R11#debug ip rip
RIP protocol debugging is on
R11#clear ip route *
00:47:07: RIP: sending request on Serial0 to 255.255.255.255 //从所有加入RIP进程的接口发送广播更新请求
00:47:07: RIP: sending request on Loopback0 to 255.255.255.255
00:47:07: RIP: received v1 ** ** 10.0.0.2 on Serial0 //R2响应了请求 并把自己直连的主类地址172.16.0.0发送给R1
00:47:07: 172.16.0.0 in 1 hops
00:47:09: RIP: sending v1 flash ** to 255.255.255.255 via Loopback0 (172.16.1.1) //从自身进程接口发送更新
00:47:09: RIP: build flash ** entries
00:47:09: network 10.0.0.0 metric 1
00:47:09: RIP: sending v1 flash ** to 255.255.255.255 via Serial0 (10.0.0.1)
00:47:09: RIP: build flash ** entries
00:47:09: network 172.16.0.0 metric 1
R22#debug ip rip
RIP protocol debugging is on
R22#clear ip route *
00:51:49: RIP: sending request on Serial0 to 255.255.255.255 //从所有加入RIP进程的接口发送广播更新请求
00:51:49: RIP: sending request on Loopback0 to 255.255.255.255
00:51:49: RIP: received v1 ** ** 10.0.0.1 on Serial0 //R1响应了请求 并把自己直连的主类地址172.16.0.0发送给R2
00:51:49: 172.16.0.0 in 1 hops
00:51:51: RIP: sending v1 flash ** to 255.255.255.255 via Loopback0 (172.16.3.1) //从自身进程接口发送更新
00:51:51: RIP: build flash ** entries
00:51:51: network 10.0.0.0 metric 1
00:51:51: RIP: sending v1 flash ** to 255.255.255.255 via Serial0 (10.0.0.2)
00:51:51: RIP: build flash ** entries
00:51:51: network 172.16.0.0 metric 1
RIP更新完后,再用Sh ip route查看双方路由表
R11#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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, 1 subnets
C 172.16.1.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Serial0
R22#sh ip route
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
i - IS-IS, 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, 1 subnets
C 172.16.3.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.0.0.0 is directly connected, Serial0
|