R1预配置
r1(config)#int lo0
r1(config-if)#ip ad 1.1.1.1 255.255.255.255
r1(config-if)#int s2/1
r1(config-if)#ip ad 12.0.0.1 255.255.255.0
r1(config-if)#no sh
r1(config-if)#int s2/2
r1(config-if)#ip ad 15.0.0.1 255.255.255.0
r1(config-if)#no sh
R2预配置
r2(config)#int lo0
r2(config-if)#ip ad 2.2.2.2 255.255.255.255
r2(config-if)#int s2/1
r2(config-if)#ip ad 12.0.0.2 255.255.255.0
r2(config-if)#no sh
r2(config-if)#int s2/2
r2(config-if)#ip ad 23.0.0.2 255.255.255.0
r2(config-if)#no sh
R3预配置
r3(config)#int lo0
r3(config-if)#ip ad 3.3.3.3 255.255.255.255
r3(config-if)#int s2/1
r3(config-if)#ip ad 23.0.0.3 255.255.255.0
r3(config-if)#no sh
R4预配置
r4(config)#int lo0
r4(config-if)#ip ad 4.4.4.4 255.255.255.255
r4(config-if)#int s2/2
r4(config-if)#ip ad 45.0.0.4 255.255.255.0
r4(config-if)#no sh
R5预配置
r5(config)#int lo0
r5(config-if)#ip ad 5.5.5.5 255.255.255.0
r5(config-if)#int s2/1
r5(config-if)#ip ad 15.0.0.5 255.255.255.0
r5(config-if)#no sh
r5(config-if)#int s2/2
r5(config-if)#ip ad 45.0.0.5 255.255.255.0
r5(config-if)#no sh
R1配置路由
r1(config)#router os 100
r1(config-router)#router-id 1.1.1.1
r1(config-router)#net 1.1.1.1 0.0.0.0 a 0
r1(config-router)#net 12.0.0.1 0.0.0.0 a 0
r1(config-router)#net 15.0.0.1 0.0.0.0 a 0
r1(config-router)#end
R2配置路由
r2(config)#router os 100
r2(config-router)#router-id 2.2.2.2
r2(config-router)#net 2.2.2.2 0.0.0.0 a 0
r2(config-router)#net 12.0.0.2 0.0.0.0 a 0
r2(config-router)#net 23.0.0.2 0.0.0.0 a 1
r2(config-router)#end
R3配置路由
r3(config)#router os 100
r3(config-router)#no net 3.3.3.3 0.0.0.0 a 0
r3(config-router)#no net 23.0.0.3 0.0.0.0 a 0
r3(config-router)#net 3.3.3.3 0.0.0.0 a 1
r3(config-router)#net 23.0.0.3 0.0.0.0 a 1
r3(config-router)#end
R4配置路由
r4(config)#router os 100
r4(config-router)#router-id 4.4.4.4
r4(config-router)#net 4.4.4.4 0.0.0.0 a 2
r4(config-router)#net 45.0.0.4 0.0.0.0 a 2
r4(config-router)#end
R5配置路由
r5(config)#router os 100
r5(config-router)#router-id 5.5.5.5
r5(config-router)#net 5.5.5.5 0.0.0.0 a 0
r5(config-router)#net 15.0.0.5 0.0.0.0 a 0
r5(config-router)#net 45.0.0.5 0.0.0.0 a 2
r5(config-router)#end
R5配置重分布
r5(config)#int lo1
r5(config-if)#ip ad 199.172.1.1 255.255.255.0
r5(config-if)#int lo2
r5(config-if)#ip ad 199.172.2.2 255.255.255.0
r5(config-if)#int lo3
r5(config-if)#ip ad 199.172.3.3 255.255.255.0
r5(config-if)#int lo4
r5(config-if)#ip ad 199.172.4.4 255.255.255.0
r5(config-if)#int lo5
r5(config-if)#ip ad 199.172.5.5 255.255.255.0
r5(config-if)#int lo6
r5(config-if)#ip ad 199.172.6.6 255.255.255.0
r5(config-if)#int lo7
r5(config-if)#ip ad 199.172.7.7 255.255.255.0
r5(config-if)#int lo8
r5(config-if)#ip ad 199.172.8.8 255.255.255.0
r5(config-if)#int lo9
r5(config-if)#ip ad 199.172.9.9 255.255.255.0
r5(config-if)#int lo10
r5(config-if)#ip ad 199.172.10.10 255.255.255.0
r5(config-if)#int lo11
r5(config-if)#ip ad 199.172.11.11 255.255.255.0
r5(config-if)#int lo12
r5(config-if)#ip ad 199.172.12.12 255.255.255.0
r5(config-if)#int lo13
r5(config-if)#ip ad 199.172.13.13 255.255.255.0
r5(config-if)#int lo14
r5(config-if)#ip ad 199.172.14.14 255.255.255.0
r5(config-if)#int lo15
r5(config-if)#ip ad 199.172.15.15 255.255.255.0
r5(config-if)#exi
r5(config)#router os 100
r5(config-router)#redistribute connected sub
r5(config-router)#end
r5#sh ip os da
OSPF Router with ID (5.5.5.5) (Process ID 100)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 888 0x80000005 0x005B35 5
2.2.2.2 2.2.2.2 1097 0x80000003 0x001743 3
5.5.5.5 5.5.5.5 20 0x80000004 0x0042E7 3
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
3.3.3.3 2.2.2.2 918 0x80000001 0x004F98
4.4.4.4 5.5.5.5 680 0x80000001 0x00C611
23.0.0.0 2.2.2.2 1092 0x80000001 0x00A33A
45.0.0.0 5.5.5.5 700 0x80000001 0x002A91
Router Link States (Area 2)
Link ID ADV Router Age Seq# Checksum Link count
4.4.4.4 4.4.4.4 692 0x80000002 0x0009E6 3
5.5.5.5 5.5.5.5 20 0x80000004 0x00E521 2
Summary Net Link States (Area 2)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 5.5.5.5 705 0x80000001 0x005192
2.2.2.2 5.5.5.5 707 0x80000001 0x00A5F9
3.3.3.3 5.5.5.5 707 0x80000001 0x00F961
5.5.5.5 5.5.5.5 707 0x80000001 0x0016FD
12.0.0.0 5.5.5.5 707 0x80000001 0x005B41
15.0.0.0 5.5.5.5 707 0x80000001 0x00B128
23.0.0.0 5.5.5.5 707 0x80000001 0x004E03
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
199.172.1.0 5.5.5.5 21 0x80000001 0x00090E 0
199.172.2.0 5.5.5.5 21 0x80000001 0x00FD18 0
199.172.3.0 5.5.5.5 21 0x80000001 0x00F222 0
199.172.4.0 5.5.5.5 21 0x80000001 0x00E72C 0
199.172.5.0 5.5.5.5 21 0x80000001 0x00DC36 0
199.172.6.0 5.5.5.5 21 0x80000001 0x00D140 0
199.172.7.0 5.5.5.5 21 0x80000001 0x00C64A 0
199.172.8.0 5.5.5.5 21 0x80000001 0x00BB54 0
199.172.9.0 5.5.5.5 21 0x80000001 0x00B05E 0
199.172.10.0 5.5.5.5 21 0x80000001 0x00A568 0
199.172.11.0 5.5.5.5 21 0x80000001 0x009A72 0
199.172.12.0 5.5.5.5 21 0x80000001 0x008F7C 0
199.172.13.0 5.5.5.5 21 0x80000001 0x008486 0
199.172.14.0 5.5.5.5 21 0x80000001 0x007990 0
199.172.15.0 5.5.5.5 21 0x80000001 0x006E9A 0
出现5型LSA
R3查看路由表
r3#sh ip ro
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
O E2 199.172.11.0/24 [110/20] via 23.0.0.2, 00:00:42, Serial2/1
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/129] via 23.0.0.2, 00:15:57, Serial2/1
O E2 199.172.10.0/24 [110/20] via 23.0.0.2, 00:00:42, Serial2/1
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 23.0.0.2, 00:15:57, Serial2/1
O E2 199.172.9.0/24 [110/20] via 23.0.0.2, 00:00:42, Serial2/1
3.0.0.0/32 is subnetted, 1 subnets
C 3.3.3.3 is directly connected, Loopback0
O E2 199.172.8.0/24 [110/20] via 23.0.0.2, 00:00:42, Serial2/1
O E2 199.172.15.0/24 [110/20] via 23.0.0.2, 00:00:42, Serial2/1
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/257] via 23.0.0.2, 00:11:53, Serial2/1
O E2 199.172.14.0/24 [110/20] via 23.0.0.2, 00:00:52, Serial2/1
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/193] via 23.0.0.2, 00:15:16, Serial2/1
O E2 199.172.13.0/24 [110/20] via 23.0.0.2, 00:00:53, Serial2/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.0.0.0 is directly connected, Serial2/1
O E2 199.172.12.0/24 [110/20] via 23.0.0.2, 00:00:53, Serial2/1
O E2 199.172.3.0/24 [110/20] via 23.0.0.2, 00:00:54, Serial2/1
O E2 199.172.2.0/24 [110/20] via 23.0.0.2, 00:00:54, Serial2/1
O E2 199.172.1.0/24 [110/20] via 23.0.0.2, 00:00:54, Serial2/1
O E2 199.172.7.0/24 [110/20] via 23.0.0.2, 00:00:54, Serial2/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.0.0.0 [110/128] via 23.0.0.2, 00:16:10, Serial2/1
O E2 199.172.6.0/24 [110/20] via 23.0.0.2, 00:00:55, Serial2/1
O E2 199.172.5.0/24 [110/20] via 23.0.0.2, 00:00:55, Serial2/1
O E2 199.172.4.0/24 [110/20] via 23.0.0.2, 00:00:55, Serial2/1
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.0.0.0 [110/256] via 23.0.0.2, 00:12:26, Serial2/1
15.0.0.0/24 is subnetted, 1 subnets
O IA 15.0.0.0 [110/192] via 23.0.0.2, 00:16:11, Serial2/1
将OSPF区域1配置为stub区
r2(config)#router os 100
r2(config-router)#area 1 stub
r3(config)#router os 100
r3(config-router)#area 1 stub
r2#sh ip os
Routing Process "ospf 100" with ID 2.2.2.2
Supports only single TOS(TOS0) routes
Supports opaque LSA
Supports Link-local Signaling (LLS)
It is an area border router
Initial SPF schedule delay 5000 msecs
Minimum hold time between two consecutive SPFs 10000 msecs
Maximum wait time between two consecutive SPFs 10000 msecs
Minimum LSA interval 5 secs. Minimum LSA arrival 1 secs
LSA group pacing timer 240 secs
Interface flood pacing timer 33 msecs
Retransmission pacing timer 66 msecs
Number of external LSA 15. Checksum Sum 0x09FAEC
Number of opaque AS LSA 0. Checksum Sum 0x000000
Number of DCbitless external and opaque AS LSA 0
Number of DoNotAge external and opaque AS LSA 0
Number of areas in this router is 2. 1 normal 1 stub 0 nssa
External flood list length 0
Area BACKBONE(0)
Number of interfaces in this area is 2 (1 loopback)
Area has no authentication
SPF algorithm last executed 00:00:31.780 ago
SPF algorithm executed 11 times
Area ranges are
Number of LSA 6. Checksum Sum 0x02493B
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
Area 1
Number of interfaces in this area is 1
It is a stub area
generates stub default route with cost 1
Area has no authentication
SPF algorithm last executed 00:00:06.716 ago
SPF algorithm executed 9 times
Area ranges are
Number of LSA 10. Checksum Sum 0x05A810
Number of opaque link LSA 0. Checksum Sum 0x000000
Number of DCbitless LSA 0
Number of indication LSA 0
Number of DoNotAge LSA 0
Flood list length 0
查看R3路由表
r3#sh ip os da
OSPF Router with ID (3.3.3.3) (Process ID 100)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 163 0x80000004 0x00FF56 2
3.3.3.3 3.3.3.3 158 0x80000004 0x00E153 3
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 187 0x80000001 0x0075C0
1.1.1.1 2.2.2.2 187 0x80000002 0x00C729
2.2.2.2 2.2.2.2 187 0x80000002 0x001716
4.4.4.4 2.2.2.2 187 0x80000002 0x004222
5.5.5.5 2.2.2.2 187 0x80000002 0x00910F
12.0.0.0 2.2.2.2 187 0x80000002 0x004F9A
15.0.0.0 2.2.2.2 187 0x80000002 0x00AAFB
45.0.0.0 2.2.2.2 187 0x80000002 0x00A5A2
已经看不见5型LSA