拓扑图:
R1的配置Router>en
Router#conf t
Router(config)#host R1
R1(config)#no ip do lo
R1(config)#line cons 0
R1(config-line)#no exec-t
R1(config-line)#logg sync
R1(config-line)#exi
R1(config)#int s1/1
R1(config-if)#ip add 10.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#int lo 0
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R1(config-if)#no sh
R1(config-if)#router rip
R1(config-router)#ver 2
R1(config-router)#no au
R1(config-router)#net 1.0.0.0
R1(config-router)#net 10.0.0
R2的配置
Router>en
Router#conf t
Router(config)#host R2
R2(config)#no ip do lo
R2(config)#line cons 0
R2(config-line)#no exec-t
R2(config-line)#logg sync
R2(config-line)#exi
R2(config)#int s1/0
R2(config-if)#ip add 10.1.1.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#int lo 0
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R2(config-if)#no sh
R2(config-if)#router rip
R2(config-router)#ver 2
R2(config-router)#no au
R2(config-router)#net 2.0.0.0
R2(config-router)#net 10.0.0.0
测试:
R2#sh ip route
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
1.0.0.0/24 is subnetted, 1 subnets
R 1.1.1.0 [120/1] via 10.1.1.1, 00:00:02, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C 10.1.1.0 is directly connected, Serial1/0
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 52/87/120 ms