R1配置
Router(config)#ho r1
r1(config)#int s1/2
r1(config-if)#ip add 192.168.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#int lo0
r1(config-if)#ip add 172.16.0.1 255.255.255.0
r1(config)#router rip
r1(config-router)#net 172.16.0.1
r1(config-router)#net 192.168.1.0
r1(config-router)#
r1(config-router)#^Z
R2配置
r2(config)#
r2(config)#int s2/1
r2(config-if)#ip add 192.168.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int lo0
r2(config-if)#ip add 172.16.1.2 255.255.255.0
r2(config-if)#exit
r2(config)#router
r2(config)#router rip
r2(config-router)#network 172.16.0.2
r2(config-router)#network 192.168.2.2
r2(config)#^Z
然后在r1和r2上show一下路由表
r1#sh ip route
Codes: C �C connected, S �C static, I �C IGRP, R �C RIP, M �C mobile, B �C BGP
D �C EIGRP, EX �C EIGRP external, O �C OSPF, IA �C OSPF inter area
N1 �C OSPF NSSA external type 1, N2 �C OSPF NSSA external type 2
E1 �C OSPF external type 1, E2 �C OSPF external type 2, E �C EGP
i �C IS-IS, L1 �C IS-IS level-1, L2 �C IS-IS level-2, * �C candidate default
U �C per-user static route, o �C ODR
T �C traffic engineered route
Gateway of last resort is not set
172.16.0.0/24 is subnetted, 1 subnets
C 172.16.0.0 is directly connected, Loopback0
C 192.168.0.0/24 is directly connected, Serial1/2
r2#sh ip route
Codes: C �C connected, S �C static, I �C IGRP, R �C RIP, M �C mobile, B �C BGP
D �C EIGRP, EX �C EIGRP external, O �C OSPF, IA �C OSPF inter area
N1 �C OSPF NSSA external type 1, N2 �C OSPF NSSA external type 2
E1 �C OSPF external type 1, E2 �C OSPF external type 2, E �C EGP
i �C IS-IS, L1 �C IS-IS level-1, L2 �C IS-IS level-2, * �C candidate default
U �C per-user static route, o �C ODR
T �C traffic engineered 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
C 192.168.0.0/24 is directly connected, Serial2/1
是学不到路由的 所以rip不支持连续的子网