
R1#conf t
R1(config)#inter loop 0
R1(config-if)#no shut
R1(config-if)#ip add 192.34.1.1 255.255.255.0
R1(config-if)#exit
R1(config)#inter loop 1
R1(config-if)#no shut
R1(config-if)#ip add 192.34.2.1 255.255.255.0
R1(config-if)#exit
R1(config)#inter loop 2
R1(config-if)#no shut
R1(config-if)#ip add 192.34.3.1 255.255.255.0
R1(config-if)#exit
R1(config)#inter loop 3
R1(config-if)#no shut
R1(config-if)#ip add 192.34.4.1 255.255.255.0
R1(config-if)#exit
R1(config)#inter f0/0
R1(config-if)#ip add 34.34.1.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.34.1.0
R1(config-router)#network 192.34.2.0
R1(config-router)#network 192.34.3.0
R1(config-router)#network 192.34.4.0
R1(config-router)#network 34.34.1.0
R1(config-router)#end
R2#conf t
R2(config)#inter f0/0
R2(config-if)#ip add 34.34.1.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#inter f0/1
R2(config-if)#ip add 34.34.2.1 255.255.255.0
R2(config-if)#no shut
R2(config-if)#exit
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 34.34.1.0
R2(config-router)#no auto-summary
R2(config-router)#redi
R2(config-router)#redistribute ospf 1 metric 1
R2(config-router)#exit
R2(config)#router ospf 1
R2(config-router)#network 34.34.2.0 0.0.0.255 area 10
R2(config-router)#red
R2(config-router)#redistribute rip metric 50 subnets
R2(config-router)#area 10 nssa
R2(config-router)#end
R3#conf t
R3(config)#inter f0/1
R3(config-if)#ip add 34.34.2.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#inter f0/0
R3(config-if)#ip add 34.34.3.1 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#router ospf 1
R3(config-router)#network 34.34.2.0 0.0.0.255 area 10
R3(config-router)#network 34.34.3.0 0.0.0.255 area 0
R3(config-router)#area 10 nssa no-summary
R3(config-router)#end
R4#conf t
R4(config)#inter loop 0
R4(config-if)#no shut
R4(config-if)#ip add 34.34.4.1 255.255.255.0
R4(config-if)#exit
R4(config)#inter f0/0
R4(config-if)#ip add 34.34.3.2 255.255.255.0
R4(config-if)#no shut
R4(config-if)#exit
R4(config)#router ospf 1
R4(config-router)#network 34.34.3.0 0.0.0.255 area 0
R4(config-router)#network 34.34.4.0 0.0.0.255 area 0
R4(config-router)#end
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 34.34.1.2 to network 0.0.0.0
34.0.0.0/24 is subnetted, 2 subnets
C 34.34.1.0 is directly connected, FastEthernet0/0
R 34.34.2.0 [120/1] via 34.34.1.2, 00:00:00, FastEthernet0/0
C 192.34.4.0/24 is directly connected, Loopback3
C 192.34.1.0/24 is directly connected, Loopback0
C 192.34.2.0/24 is directly connected, Loopback1
C 192.34.3.0/24 is directly connected, Loopback2
R* 0.0.0.0/0 [120/1] via 34.34.1.2, 00:00:00, FastEthernet0/0
R1#
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 34.34.2.2 to network 0.0.0.0
34.0.0.0/24 is subnetted, 2 subnets
C 34.34.1.0 is directly connected, FastEthernet0/0
C 34.34.2.0 is directly connected, FastEthernet0/1
R 192.34.4.0/24 [120/1] via 34.34.1.1, 00:00:01, FastEthernet0/0
R 192.34.1.0/24 [120/1] via 34.34.1.1, 00:00:01, FastEthernet0/0
R 192.34.2.0/24 [120/1] via 34.34.1.1, 00:00:01, FastEthernet0/0
R 192.34.3.0/24 [120/1] via 34.34.1.1, 00:00:01, FastEthernet0/0
O*IA 0.0.0.0/0 [110/11] via 34.34.2.2, 00:07:16, FastEthernet0/1
// ASBR上会出现一条默认路由
R2#
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 not set
34.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
O N2 34.34.1.0/24 [110/50] via 34.34.2.1, 00:07:43, FastEthernet0/1
C 34.34.2.0/24 is directly connected, FastEthernet0/1
C 34.34.3.0/24 is directly connected, FastEthernet0/0
O 34.34.4.1/32 [110/11] via 34.34.3.2, 00:06:23, FastEthernet0/0
O N2 192.34.4.0/24 [110/50] via 34.34.2.1, 00:07:43, FastEthernet0/1
O N2 192.34.1.0/24 [110/50] via 34.34.2.1, 00:07:43, FastEthernet0/1
O N2 192.34.2.0/24 [110/50] via 34.34.2.1, 00:07:49, FastEthernet0/1
O N2 192.34.3.0/24 [110/50] via 34.34.2.1, 00:07:49, FastEthernet0/1
R3#
R4#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
34.0.0.0/24 is subnetted, 4 subnets
O E2 34.34.1.0 [110/50] via 34.34.3.1, 00:00:22, FastEthernet0/0
O IA 34.34.2.0 [110/20] via 34.34.3.1, 00:00:22, FastEthernet0/0
C 34.34.3.0 is directly connected, FastEthernet0/0
C 34.34.4.0 is directly connected, Loopback0
O E2 192.34.4.0/24 [110/50] via 34.34.3.1, 00:00:22, FastEthernet0/0
O E2 192.34.1.0/24 [110/50] via 34.34.3.1, 00:00:22, FastEthernet0/0
O E2 192.34.2.0/24 [110/50] via 34.34.3.1, 00:00:22, FastEthernet0/0
O E2 192.34.3.0/24 [110/50] via 34.34.3.1, 00:00:33, FastEthernet0/0
R4#
// 路由器R4已经收到了外部路由的消息,这说明不是绝对路由,因为绝对路由收不到外部消息