r1#conf t
r1(config)#int f0/0
r1(config-if)#ip add 192.168.12.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.255
r1(config-if)#^Z
r2#conf t
r2(config)#int f0/0
r2(config-if)#ip add 192.168.12.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int f1/0
r2(config-if)#ip add 192.168.23.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.255
r2(config-if)#^Z
r2#conf t
r2(config)#router odr
r2(config-router)#^Z
r3#conf t
r3(config)#int f0/0
r3(config-if)#ip add 192.168.23.3 255.255.255.0
r3(config-if)#no sh
r3(config-if)#int lo 0
r3(config-if)#ip add 3.3.3.3 255.255.255.255
r3(config-if)#^Z
查看配置:
r1#show 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 192.168.12.2 to network 0.0.0.0
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/32 is subnetted, 3 subnets
C 1.1.1.1 is directly connected, Loopback0
o* 0.0.0.0/0 [160/1] via 192.168.12.2, 00:00:36, FastEthernet0/0
r2#show 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
C 192.168.12.0/24 is directly connected, FastEthernet0/0
1.0.0.0/32 is subnetted, 3 subnets
o 1.1.1.1 [160/1] via 192.168.12.1, 00:00:07, FastEthernet0/0
2.0.0.0/32 is subnetted, 1 subnets
C 2.2.2.2 is directly connected, Loopback0
3.0.0.0/32 is subnetted, 1 subnets
o 3.3.3.3 [160/1] via 192.168.23.3, 00:00:19, FastEthernet1/0
C 192.168.23.0/24 is directly connected, FastEthernet1/0
r3#show 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 192.168.23.2 to network 0.0.0.0
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
C 192.168.23.0/24 is directly connected, FastEthernet0/0
o* 0.0.0.0/0 [160/1] via 192.168.23.2, 00:00:41, FastEthernet0/0