第一步、预配置
r1(config)#int f0/0
r1(config-if)#ip add 123.0.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#int lo0
r1(config-if)#ip add 1.1.1.1 255.255.255.0
r1(config-if)#exit
r2(config)#int f0/0
r2(config-if)#ip add 123.0.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int lo0
r2(config-if)#ip add 2.2.2.2 255.255.255.0
r2(config-if)#exit
r3(config)#int f0/0
r3(config-if)#ip add 123.0.0.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#int lo0
r3(config-if)#ip add 3.3.3.3 255.255.255.0
r3(config-if)#exit
第二步、配置rip
r1(config)#router rip
r1(config-router)#net 123.0.0.0
r1(config-router)#net 1.0.0.0
r1(config-router)#no au
r1(config-router)#end
r2(config)#router rip
r2(config-router)#net 123.0.0.0
r2(config-router)#net 2.0.0.0
r2(config-router)#no au
r2(config-router)#end
r3(config)#router rip
r3(config-router)#net 123.0.0.0
r3(config-router)#net 3.0.0.0
r3(config-router)#no au
r3(config-router)#end
第三步、查看r1的更新包
r1#debug ip packet
IP packet debugging is on
r1#
00:09:37: datagramsize=66, IP 0: s=123.0.0.2 (FastEthernet0/0), d=255.255.255.255, totlen 52, fragment 0, fo 0, rcvd 2
00:09:38: datagramsize=371, IP 0: s=123.0.0.1 (local), d=255.255.255.255 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending broad/multicast
00:09:38: datagramsize=66, IP 0: s=123.0.0.1 (local), d=255.255.255.255 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending full packet
00:09:38: datagramsize=371, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending broad/multicast
00:09:38: datagramsize=92, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending full packet
r1#
00:09:38: datagramsize=92, IP 0: s=1.1.1.1 (Loopback0), d=255.255.255.255, totlen 92, fragment 0, fo 0, unroutable
r1#
00:09:47: datagramsize=66, IP 0: s=123.0.0.3 (FastEthernet0/0), d=255.255.255.255, totlen 52, fragment 0, fo 0, rcvd 2
r1#
00:10:05: datagramsize=66, IP 0: s=123.0.0.2 (FastEthernet0/0), d=255.255.255.255, totlen 52, fragment 0, fo 0, rcvd 2
r1#
00:10:07: datagramsize=66, IP 0: s=123.0.0.1 (local), d=255.255.255.255 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending broad/multicast
00:10:07: datagramsize=66, IP 0: s=123.0.0.1 (local), d=255.255.255.255 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending full packet
00:10:07: datagramsize=37, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending broad/multicast
00:10:07: datagramsize=92, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending full packet
00:10:07: datagramsize=92, IP 0: s=1.1.1.1 (Loopback0), d=255.255.255.255, totlen 92, fragment 0, fo 0, unroutable
r1#u all
进行广播更新
第四步、在r1和r2上做单播更新
r1(config)#router rip
r1(config-router)#passive-interface f0/0
r1(config-router)#neighbor 123.0.0.2
r1(config-router)#end
r2(config)#router rip
r2(config-router)#passive-interface f0/0
r2(config-router)#neighbor 123.0.0.1
r2(config-router)#end
第五步、查看r1的更新包
r1#debug ip packet
IP packet debugging is on
r1#
00:15:12: datagramsize=66, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending broad/multicast
00:15:12: datagramsize=92, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending full packet
00:15:12: datagramsize=371, IP 0: s=123.0.0.1 (local), d=123.0.0.2 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending
00:15:12: datagramsize=66, IP 0: s=123.0.0.1 (local), d=123.0.0.2 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending full packet
00:15:12: datagramsize=92, IP 0: s=1.1.1.1 (Loopback0), d=255.255.255.255, totlen 92, fragment 0, fo 0, unroutable
r1#
00:15:18: datagramsize=86, IP 0: s=123.0.0.3 (FastEthernet0/0), d=255.255.255.255, totlen 72, fragment 0, fo 0, rcvd 2
r1#
00:15:34: datagramsize=66, IP 0: s=123.0.0.2 (FastEthernet0/0), d=123.0.0.1 (FastEthernet0/0), totlen 52, fragment 0, fo 0, rcvd 3
r1#u al
00:15:41: datagramsize=371, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending broad/multicast
00:15:41: datagramsize=92, IP 0: s=1.1.1.1 (local), d=255.255.255.255 (Loopback0), totlen 92, fragment 0, fo 0, sending full packet
00:15:41: datagramsize=62, IP 0: s=123.0.0.1 (local), d=123.0.0.2 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending
00:15:41: datagramsize=66, IP 0: s=123.0.0.1 (local), d=123.0.0.2 (FastEthernet0/0), totlen 52, fragment 0, fo 0, sending full packet
00:15:41: datagramsize=92, IP 0: s=1.1.1.1 (Loopback0), d=255.255.255.255, totlen 92, fragment 0, fo 0, unroutable
r1#u all
进行单播更新
第六步、查看路由表
r1#show 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
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback0
R 2.0.0.0/8 [120/1] via 123.0.0.2, 00:00:01, FastEthernet0/0
R 3.0.0.0/8 [120/1] via 123.0.0.3, 00:00:24, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, FastEthernet0/0
r1#
r2#show 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
R 1.0.0.0/8 [120/1] via 123.0.0.1, 00:00:11, FastEthernet0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
R 3.0.0.0/8 [120/1] via 123.0.0.3, 00:00:06, FastEthernet0/0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, FastEthernet0/0
r2#
r3#show 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
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback0
123.0.0.0/24 is subnetted, 1 subnets
C 123.0.0.0 is directly connected, FastEthernet0/0
r3#
r1和r2可以学到r3的路由,而r3学不到r1和r2的路由
