1.按照拓扑图去配置基本链路,配置完成以后检查基本链路的连通性
Router(config)#ho R1
R1(config)#inter s0/0
R1(config-if)#ip add 12.12.12.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#no shutdown
Router(config)#ho R2
R2(config)#inter s0/0
R2(config-if)#clock rate 64000
R2(config-if)#ip add 12.12.12.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter s0/1
R2(config-if)#clock rate 64000
R2(config-if)#ip add 23.23.23.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#inter e1/0
R2(config-if)#ip add 24.24.24.2 255.255.255.0
R2(config-if)#no shut
Router(config)#
Router(config)#ho R3
R3(config)#inter s0/0
R3(config-if)#ip add 23.23.23.3 255.255.255.0
R3(config-if)#no shut
R3(config-if)#inter s0/1
R3(config-if)#ip add 34.34.34.3 255.255.255.0
R3(config-if)#no shut
Router(config)#ho R4
R4(config)#inter s0/0
R4(config-if)#clock rate 64000
R4(config-if)#ip add 34.34.34.4 255.255.255.0
R4(config-if)#no shu
R4(config-if)#inter s0/1
R4(config-if)#clock rate 64000
R4(config-if)#ip add 45.45.45.4 255.255.255.0
R4(config-if)#no shut
R4(config-if)#inter e1/0
R4(config-if)#ip add 24.24.24.4 255.255.255.0
R4(config-if)#no shut
Router(config)#ho R5
R5(config)#inter s0/0
R5(config-if)#ip add 45.45.45.5 255.255.255.0
R5(config-if)#no shut
PING 测试:
R3(config-if)#do ping 23.23.23.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 23.23.23.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/17/64 ms
R3(config-if)#do ping 34.34.34.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 34.34.34.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/27/84 ms
R2(config-if)#do ping 12.12.12.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/56 ms
R2(config-if)#do ping 24.24.24.4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 24.24.24.4, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/27/60 ms
R4(config-if)#do ping 45.45.45.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 45.45.45.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/27/56 ms
2.分别在R1上起Lo 0到Lo 3地址范围从172.16.0.0/24到172.16.3.0/24。R5上起Lo 0到Lo 3地址范围从192.168.0.0/24到192.168.3.0/24。R2上起Lo 0到Lo 3起10.0.0.0/24到10.0.3.0/24这几个网段的地址。另外每个路由器起回环口10,例如R1的lo 10的ip:1.1.1.1 255.255.255.0 R5的Lo 10的IP:5.5.5.5 255.255.255.0 要求保证每个路由器的router-id为lo 10的IP地址。另外在每个路由器上可以远程到其他所有的路由器。
R1(config)#inter lo 0
R1(config-if)#ip add
R1(config-if)#ip add 172.16.0.1 255.255.255.0
R1(config-if)#inter lo 1
R1(config-if)#ip add 1
R1(config-if)#ip add 172.16.1.1 255.255.255.0
R1(config-if)#inter lo 2
R1(config-if)#ip a
R1(config-if)#ip add 172.16.2.1 255.255.255.0
R1(config-if)#inter lo 3
R1(config-if)#ip add 172.16.3.1 255.255.255.0
R1(config-if)#inter lo 10
R1(config-if)#ip add 1.1.1.1 255.255.255.0
R5(config)#inter lo 0
R5(config-if)#ip add 192.168.0.1 255.255.255.0
R5(config-if)#inter lo 1
R5(config-if)#ip add 192.168.1.1 255.255.255.0
R5(config-if)#inter lo 2
R5(config-if)#ip add 192.168.2.1 255.255.255.0
R5(config-if)#inter lo 3
R5(config-if)#ip add 192.168.3.1 255.255.255.0
R5(config-if)#inter lo 10
R5(config-if)#ip add 5.5.5.5 255.255.255.0
R2(config)#inter lo 0
R2(config-if)#ip add 10.0.0.1 255.255.255.0
R2(config-if)#inter lo 1
R2(config-if)#ip add 10.0.1.1 255.255.255.0
R2(config-if)#inter lo 2
R2(config-if)#ip add 10.0.2.1 255.255.255.0
R2(config-if)#inter lo 3
R2(config-if)#ip add 10.0.3.1 255.255.255.0
R2(config-if)#inter lo 10
R2(config-if)#ip add 2.2.2.2 255.255.255.0
R3(config)#inter lo 10
R3(config-if)#ip add 3.3.3.3 255.255.255.0
R4(config)#inter lo 10
R4(config-if)#ip add 4.4.4.4 255.255.255.0
3.按照拓扑图把相应的接口公布到OSPF区域里去,并且能够实现整个网络之间进行通信。公布R1和R5的RIP区域。并且把R2的lo 0到lo 3公布到area 1.
R1(config)#router ospf 1
R1(config-router)#router-id 1.1.1.1
R1(config-router)#network 12.12.12.0 0.0.0.255 area 1
R1(config-router)#network 1.1.1.0 0.0.0.255 area 1
R1(config-router)#exit
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#no auto-summary
R1(config-router)#network 172.16.0.0
R2(config)#router ospf 1
R2(config-router)#router-id 2.2.2.2
R2(config-router)#network 10.0.0.0 0.0.0.255 area 1
R2(config-router)#network 10.0.1.0 0.0.0.255 area 1
R2(config-router)#network 10.0.2.0 0.0.0.255 area 1
R2(config-router)#network 10.0.3.0 0.0.0.255 area 1
R2(config-router)#network 2.2.2.0 0.0.0.255 area 0
R2(config-router)#network 12.12.12.0 0.0.0.255 area 1
R2(config-router)#a
*Mar 1 00:30:22.967: %OSPF-5-ADJCHG: Process 1, Nbr 1.1.1.1 on Serial0/0 from LOADING to FULL, Loading Done
R2(config-router)#network 24.24.24.0 0.0.0.255 area 0
R2(config-router)#network 23.23.23.0 0.0.0.255 area 0
R3(config)#router ospf 1
R3(config-router)#router-id 3.3.3.3
R3(config-router)#network 23.23.23.0 0.0.0.255 area 0
*Mar 1 00:32:32.143: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial0/0 from LOADING to FULL, Loading Done
R3(config-router)#network 34.34.34.0 0.0.0.255 area 0
R3(config-router)#network 3.3.3.0 0.0.0.255 area 0
R4(config-if)#exit
R4(config)#router ospf 1
R4(config-router)#router-id 4.4.4.4
R4(config-router)#network 24.24.24.0 0.0.0.255 area 0
*Mar 1 00:34:43.095: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Ethernet1/0 from LOADING to FULL, Loading Done
R4(config-router)#network 34.34.34.0 0.0.0.255 area 0
*Mar 1 00:34:57.951: %OSPF-5-ADJCHG: Process 1, Nbr 3.3.3.3 on Serial0/0 from LOADING to FULL, Loading Done
R4(config-router)#network 45.45.45.0 0.0.0.255 area 2
R4(config-router)#network 4.4.4.0 0.0.0.255 area 0
R5(config)#router ospf 1
R5(config-router)#router-id 5.5.5.5
R5(config-router)#network 45.45.45.0 0.0.0.255 area 2
R5(config-router)#
*Mar 1 00:37:20.803: %OSPF-5-ADJCHG: Process 1, Nbr 4.4.4.4 on Serial0/0 from LOADING to FULL, Loading Done
R5(config-router)#network 5.5.5.0 0.0.0.255 area 2
R5(config-router)#exit
R5(config)#router rip
R5(config-router)#network 192.168.0.0
R5(config-router)#network 192.168.1.0
R5(config-router)#network 192.168.2.0
R5(config-router)#network 192.168.3.0
SHOW命令来检查R3
R3(config)#do 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, 1 subnets
C 34.34.34.0 is directly connected, Serial0/1
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/129] via 23.23.23.2, 00:05:14, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 23.23.23.2, 00:05:14, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback10
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 34.34.34.4, 00:05:14, Serial0/1
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/129] via 34.34.34.4, 00:02:56, Serial0/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
O 24.24.24.0 [110/74] via 34.34.34.4, 00:05:16, Serial0/1
[110/74] via 23.23.23.2, 00:05:16, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O IA 10.0.3.1 [110/65] via 23.23.23.2, 00:05:16, Serial0/0
O IA 10.0.2.1 [110/65] via 23.23.23.2, 00:05:16, Serial0/0
O IA 10.0.1.1 [110/65] via 23.23.23.2, 00:05:16, Serial0/0
O IA 10.0.0.1 [110/65] via 23.23.23.2, 00:05:16, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.12.12.0 [110/128] via 23.23.23.2, 00:05:16, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/128] via 34.34.34.4, 00:05:16, Serial0/1
没有去往RIP区域的路由。
4.配置路由重分发
R1(config)#router ospf 1
R1(config-router)#redistribute rip subnets
R5(config)#router ospf 1
R5(config-router)#redistribute rip subnets
再在R3上show
R3(config)#do 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, 1 subnets
C 34.34.34.0 is directly connected, Serial0/1
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/129] via 23.23.23.2, 00:12:06, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 23.23.23.2, 00:12:06, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback10
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 34.34.34.4, 00:12:06, Serial0/1
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/129] via 34.34.34.4, 00:09:48, Serial0/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
O E2 172.16.0.0 [110/20] via 23.23.23.2, 00:02:13, Serial0/0
O E2 172.16.1.0 [110/20] via 23.23.23.2, 00:02:13, Serial0/0
O E2 172.16.2.0 [110/20] via 23.23.23.2, 00:02:13, Serial0/0
O E2 172.16.3.0 [110/20] via 23.23.23.2, 00:02:13, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
O 24.24.24.0 [110/74] via 34.34.34.4, 00:12:07, Serial0/1
[110/74] via 23.23.23.2, 00:12:07, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O IA 10.0.3.1 [110/65] via 23.23.23.2, 00:12:07, Serial0/0
O IA 10.0.2.1 [110/65] via 23.23.23.2, 00:12:07, Serial0/0
O IA 10.0.1.1 [110/65] via 23.23.23.2, 00:12:08, Serial0/0
O IA 10.0.0.1 [110/65] via 23.23.23.2, 00:12:08, Serial0/0
O E2 192.168.0.0/24 [110/20] via 34.34.34.4, 00:02:14, Serial0/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.12.12.0 [110/128] via 23.23.23.2, 00:12:08, Serial0/0
O E2 192.168.1.0/24 [110/20] via 34.34.34.4, 00:02:14, Serial0/1
O E2 192.168.2.0/24 [110/20] via 34.34.34.4, 00:02:14, Serial0/1
O E2 192.168.3.0/24 [110/20] via 34.34.34.4, 00:02:14, Serial0/1
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/128] via 34.34.34.4, 00:12:08, Serial0/1
R2(config-router)#do show ip ospf database
OSPF Router with ID (2.2.2.2) (Process ID 1)
Router Link States (Area 0)
Link ID ADV Router Age Seq# Checksum Link count
2.2.2.2 2.2.2.2 868 0x80000005 0x00FC33 4
3.3.3.3 3.3.3.3 854 0x80000004 0x00BE99 5
4.4.4.4 4.4.4.4 822 0x80000004 0x00B51D 4
Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
24.24.24.2 2.2.2.2 867 0x80000001 0x00F8D6
Summary Net Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 1124 0x80000001 0x00AB44
5.5.5.5 4.4.4.4 683 0x80000001 0x00B621
10.0.0.1 2.2.2.2 1151 0x80000001 0x00CA5E
10.0.1.1 2.2.2.2 1151 0x80000001 0x00BF68
10.0.2.1 2.2.2.2 1151 0x80000001 0x00B472
10.0.3.1 2.2.2.2 1151 0x80000001 0x00A97C
12.12.12.0 2.2.2.2 1130 0x80000001 0x001EB2
45.45.45.0 4.4.4.4 839 0x80000001 0x00392C
Summary ASB Link States (Area 0)
Link ID ADV Router Age Seq# Checksum
1.1.1.1 2.2.2.2 260 0x80000001 0x00935C
5.5.5.5 4.4.4.4 239 0x80000001 0x009E39
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 266 0x80000004 0x0056DA 3
2.2.2.2 2.2.2.2 1136 0x80000005 0x00FACF 6
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
2.2.2.2 2.2.2.2 1153 0x80000001 0x00FA31
3.3.3.3 2.2.2.2 981 0x80000001 0x004F98
4.4.4.4 2.2.2.2 820 0x80000001 0x000317
5.5.5.5 2.2.2.2 690 0x80000001 0x00577E
23.23.23.0 2.2.2.2 1100 0x80000001 0x00901F
24.24.24.0 2.2.2.2 1110 0x80000001 0x004E94
34.34.34.0 2.2.2.2 860 0x80000002 0x00651E
45.45.45.0 2.2.2.2 838 0x80000001 0x00D989
Summary ASB Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
5.5.5.5 2.2.2.2 239 0x80000001 0x003F96
Type-5 AS External Link States
Link ID ADV Router Age Seq# Checksum Tag
172.16.0.0 1.1.1.1 266 0x80000001 0x00449B 0
172.16.1.0 1.1.1.1 267 0x80000001 0x0039A5 0
172.16.2.0 1.1.1.1 267 0x80000001 0x002EAF 0
172.16.3.0 1.1.1.1 267 0x80000001 0x0023B9 0
192.168.0.0 5.5.5.5 246 0x80000001 0x009F83 0
192.168.1.0 5.5.5.5 246 0x80000001 0x00948D 0
192.168.2.0 5.5.5.5 246 0x80000001 0x008997 0
192.168.3.0 5.5.5.5 246 0x80000001 0x007EA1 0
5.分别将区域1配置成stub,totally stub, nssa , totally nssa区域,然后查看每个特殊区域配置以后出现的现象
a) Stub
配置stub之前的路由
R1(config-router)#do 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, 1 subnets
O IA 34.34.34.0 [110/138] via 12.12.12.2, 00:06:52, Serial0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback10
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 12.12.12.2, 00:06:52, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.12.12.2, 00:06:52, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/75] via 12.12.12.2, 00:06:52, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/139] via 12.12.12.2, 00:06:52, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.23.23.0 [110/128] via 12.12.12.2, 00:06:53, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.24.24.0 [110/74] via 12.12.12.2, 00:06:53, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O 10.0.3.1 [110/65] via 12.12.12.2, 00:06:53, Serial0/0
O 10.0.2.1 [110/65] via 12.12.12.2, 00:06:53, Serial0/0
O 10.0.1.1 [110/65] via 12.12.12.2, 00:06:53, Serial0/0
O 10.0.0.1 [110/65] via 12.12.12.2, 00:06:53, Serial0/0
O E2 192.168.0.0/24 [110/20] via 12.12.12.2, 00:06:26, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
O E2 192.168.1.0/24 [110/20] via 12.12.12.2, 00:06:26, Serial0/0
O E2 192.168.2.0/24 [110/20] via 12.12.12.2, 00:06:26, Serial0/0
O E2 192.168.3.0/24 [110/20] via 12.12.12.2, 00:06:26, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/138] via 12.12.12.2, 00:06:54, Serial0/0
配置:
R1(config)#router ospf 1
R1(config-router)#area 1 stub
R1(config-router)#
*Mar 1 00:53:23.283: %OSPF-4-ASBR_WITHOUT_VALID_AREA: Router is currently an ASBR while having only one area which is a stub area
R1(config-router)#
*Mar 1 00:53:23.847: %OSPF-5-ADJCHG: Process 1, Nbr 2.2.2.2 on Serial0/0 from FULL to DOWN, Neighbor Down: Adjacency forced to reset
R2(config)#router ospf 1
R2(config-router)#area 1 stub
再次查看路由表
R1(config-router)#do 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 12.12.12.2 to network 0.0.0.0
34.0.0.0/24 is subnetted, 1 subnets
O IA 34.34.34.0 [110/138] via 12.12.12.2, 00:01:21, Serial0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback10
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 12.12.12.2, 00:01:21, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.12.12.2, 00:01:21, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/75] via 12.12.12.2, 00:01:21, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/139] via 12.12.12.2, 00:01:21, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.23.23.0 [110/128] via 12.12.12.2, 00:01:26, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.24.24.0 [110/74] via 12.12.12.2, 00:01:26, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O 10.0.3.1 [110/65] via 12.12.12.2, 00:01:26, Serial0/0
O 10.0.2.1 [110/65] via 12.12.12.2, 00:01:26, Serial0/0
O 10.0.1.1 [110/65] via 12.12.12.2, 00:01:26, Serial0/0
O 10.0.0.1 [110/65] via 12.12.12.2, 00:01:26, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/138] via 12.12.12.2, 00:01:26, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 12.12.12.2, 00:01:26, Serial0/0
R1(config-router)# do show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 233 0x80000006 0x006AC8 3
2.2.2.2 2.2.2.2 234 0x80000007 0x0015B5 6
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 236 0x80000001 0x0075C0
2.2.2.2 2.2.2.2 236 0x80000002 0x001716
3.3.3.3 2.2.2.2 236 0x80000002 0x006B7D
4.4.4.4 2.2.2.2 236 0x80000002 0x001FFB
5.5.5.5 2.2.2.2 236 0x80000002 0x007363
23.23.23.0 2.2.2.2 236 0x80000002 0x00AC04
24.24.24.0 2.2.2.2 236 0x80000002 0x006A79
34.34.34.0 2.2.2.2 236 0x80000003 0x008103
45.45.45.0 2.2.2.2 236 0x80000002 0x00F56E
b) Totally stub
只需要在末梢区域的基础上在ABR路由器上添加
R2(config-router)#area 1 stub no-summary
和stub相比过滤掉了区域间路由
R1(config-router)#do 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 12.12.12.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback10
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
10.0.0.0/32 is subnetted, 4 subnets
O 10.0.3.1 [110/65] via 12.12.12.2, 00:06:20, Serial0/0
O 10.0.2.1 [110/65] via 12.12.12.2, 00:06:20, Serial0/0
O 10.0.1.1 [110/65] via 12.12.12.2, 00:06:20, Serial0/0
O 10.0.0.1 [110/65] via 12.12.12.2, 00:06:20, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 12.12.12.2, 00:00:42, Serial0/0
R1(config-router)#do show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 537 0x80000006 0x006AC8 3
2.2.2.2 2.2.2.2 67 0x80000008 0x0013B6 6
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 198 0x80000002 0x0073C1
c) Nssa
R1(config-router)#area 1 nssa
R2(config-router)#area 1 nssa
R1(config-router)#do 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, 1 subnets
O IA 34.34.34.0 [110/138] via 12.12.12.2, 00:00:52, Serial0/0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback10
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/65] via 12.12.12.2, 00:00:52, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 12.12.12.2, 00:00:52, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/75] via 12.12.12.2, 00:00:52, Serial0/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/139] via 12.12.12.2, 00:00:52, Serial0/0
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.23.23.0 [110/128] via 12.12.12.2, 00:00:52, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.24.24.0 [110/74] via 12.12.12.2, 00:00:53, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O 10.0.3.1 [110/65] via 12.12.12.2, 00:00:53, Serial0/0
O 10.0.2.1 [110/65] via 12.12.12.2, 00:00:54, Serial0/0
O 10.0.1.1 [110/65] via 12.12.12.2, 00:00:54, Serial0/0
O 10.0.0.1 [110/65] via 12.12.12.2, 00:00:54, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/138] via 12.12.12.2, 00:00:54, Serial0/0
R1(config-router)#do show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 259 0x8000000A 0x00EF35 3
2.2.2.2 2.2.2.2 257 0x8000000C 0x009823 6
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
2.2.2.2 2.2.2.2 262 0x80000002 0x009E86
3.3.3.3 2.2.2.2 262 0x80000002 0x00F2ED
4.4.4.4 2.2.2.2 262 0x80000002 0x00A66C
5.5.5.5 2.2.2.2 262 0x80000002 0x00FAD3
23.23.23.0 2.2.2.2 262 0x80000002 0x003474
24.24.24.0 2.2.2.2 262 0x80000002 0x00F1E9
34.34.34.0 2.2.2.2 262 0x80000002 0x000B72
45.45.45.0 2.2.2.2 262 0x80000002 0x007DDE
Type-7 AS External Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Tag
172.16.0.0 1.1.1.1 270 0x80000001 0x00E1EF 0
172.16.1.0 1.1.1.1 270 0x80000001 0x00D6F9 0
172.16.2.0 1.1.1.1 271 0x80000001 0x00CB04 0
172.16.3.0 1.1.1.1 271 0x80000001 0x00C00E 0
在R5上show
R5(config-router)#do 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, 1 subnets
O IA 34.34.34.0 [110/128] via 45.45.45.4, 00:26:27, Serial0/0
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/139] via 45.45.45.4, 00:05:33, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O IA 2.2.2.2 [110/75] via 45.45.45.4, 00:26:27, Serial0/0
3.0.0.0/32 is subnetted, 1 subnets
O IA 3.3.3.3 [110/129] via 45.45.45.4, 00:26:27, Serial0/0
4.0.0.0/32 is subnetted, 1 subnets
O IA 4.4.4.4 [110/65] via 45.45.45.4, 00:26:27, Serial0/0
5.0.0.0/24 is subnetted, 1 subnets
C 5.5.5.0 is directly connected, Loopback10
23.0.0.0/24 is subnetted, 1 subnets
O IA 23.23.23.0 [110/138] via 45.45.45.4, 00:26:32, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
O E2 172.16.0.0 [110/20] via 45.45.45.4, 00:05:32, Serial0/0
O E2 172.16.1.0 [110/20] via 45.45.45.4, 00:05:32, Serial0/0
O E2 172.16.2.0 [110/20] via 45.45.45.4, 00:05:32, Serial0/0
O E2 172.16.3.0 [110/20] via 45.45.45.4, 00:05:32, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
O IA 24.24.24.0 [110/74] via 45.45.45.4, 00:26:32, Serial0/0
10.0.0.0/32 is subnetted, 4 subnets
O IA 10.0.3.1 [110/75] via 45.45.45.4, 00:26:32, Serial0/0
O IA 10.0.2.1 [110/75] via 45.45.45.4, 00:26:32, Serial0/0
O IA 10.0.1.1 [110/75] via 45.45.45.4, 00:26:32, Serial0/0
O IA 10.0.0.1 [110/75] via 45.45.45.4, 00:26:32, Serial0/0
C 192.168.0.0/24 is directly connected, Loopback0
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.12.12.0 [110/138] via 45.45.45.4, 00:26:32, Serial0/0
C 192.168.1.0/24 is directly connected, Loopback1
C 192.168.2.0/24 is directly connected, Loopback2
C 192.168.3.0/24 is directly connected, Loopback3
45.0.0.0/24 is subnetted, 1 subnets
C 45.45.45.0 is directly connected, Serial0/0
d) Totally nssa
与NSSA得区别是产生默认路由,不学习区域间路由
在nssa的基础上在ABR路由器上多配置
R2(config-router)#area 1 nssa no-summary
R1(config-router)#do 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 12.12.12.2 to network 0.0.0.0
1.0.0.0/24 is subnetted, 1 subnets
C 1.1.1.0 is directly connected, Loopback10
172.16.0.0/24 is subnetted, 4 subnets
C 172.16.0.0 is directly connected, Loopback0
C 172.16.1.0 is directly connected, Loopback1
C 172.16.2.0 is directly connected, Loopback2
C 172.16.3.0 is directly connected, Loopback3
10.0.0.0/32 is subnetted, 4 subnets
O 10.0.3.1 [110/65] via 12.12.12.2, 00:09:25, Serial0/0
O 10.0.2.1 [110/65] via 12.12.12.2, 00:09:25, Serial0/0
O 10.0.1.1 [110/65] via 12.12.12.2, 00:09:25, Serial0/0
O 10.0.0.1 [110/65] via 12.12.12.2, 00:09:25, Serial0/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
O*IA 0.0.0.0/0 [110/65] via 12.12.12.2, 00:02:00, Serial0/0
R1(config-router)#do show ip ospf database
OSPF Router with ID (1.1.1.1) (Process ID 1)
Router Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Link count
1.1.1.1 1.1.1.1 639 0x8000000A 0x00EF35 3
2.2.2.2 2.2.2.2 636 0x8000000C 0x009823 6
Summary Net Link States (Area 1)
Link ID ADV Router Age Seq# Checksum
0.0.0.0 2.2.2.2 189 0x80000001 0x00FC31
Type-7 AS External Link States (Area 1)
Link ID ADV Router Age Seq# Checksum Tag
172.16.0.0 1.1.1.1 649 0x80000001 0x00E1EF 0
172.16.1.0 1.1.1.1 649 0x80000001 0x00D6F9 0
172.16.2.0 1.1.1.1 649 0x80000001 0x00CB04 0
172.16.3.0 1.1.1.1 649 0x80000001 0x00C00E 0
6.将RIP区域的路由信息汇总,将区域里的Lo 0到Lo 3的地址也做汇总。
a) 区域间路由汇总
区域间的路由汇总是在ABR上进行配置的,是对3类的LSA进行汇总
R2(config-router)#area 1 range 10.0.0.0 255.255.252.0
R3(config)#do 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, 1 subnets
C 34.34.34.0 is directly connected, Serial0/1
1.0.0.0/32 is subnetted, 1 subnets
O IA 1.1.1.1 [110/129] via 23.23.23.2, 00:14:08, Serial0/0
2.0.0.0/32 is subnetted, 1 subnets
O 2.2.2.2 [110/65] via 23.23.23.2, 00:14:19, Serial0/0
3.0.0.0/24 is subnetted, 1 subnets
C 3.3.3.0 is directly connected, Loopback10
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/65] via 34.34.34.4, 00:14:19, Serial0/1
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/129] via 34.34.34.4, 00:14:19, Serial0/1
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/0
172.16.0.0/24 is subnetted, 4 subnets
O E2 172.16.0.0 [110/20] via 23.23.23.2, 00:00:20, Serial0/0
O E2 172.16.1.0 [110/20] via 23.23.23.2, 00:00:20, Serial0/0
O E2 172.16.2.0 [110/20] via 23.23.23.2, 00:00:20, Serial0/0
O E2 172.16.3.0 [110/20] via 23.23.23.2, 00:00:20, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
O 24.24.24.0 [110/74] via 34.34.34.4, 00:14:20, Serial0/1
[110/74] via 23.23.23.2, 00:14:20, Serial0/0
10.0.0.0/22 is subnetted, 1 subnets
O IA 10.0.0.0 [110/65] via 23.23.23.2, 00:00:25, Serial0/0
O E2 192.168.0.0/24 [110/20] via 34.34.34.4, 00:00:20, Serial0/1
12.0.0.0/24 is subnetted, 1 subnets
O IA 12.12.12.0 [110/128] via 23.23.23.2, 00:14:21, Serial0/0
O E2 192.168.1.0/24 [110/20] via 34.34.34.4, 00:00:20, Serial0/1
O E2 192.168.2.0/24 [110/20] via 34.34.34.4, 00:00:21, Serial0/1
O E2 192.168.3.0/24 [110/20] via 34.34.34.4, 00:00:21, Serial0/1
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/128] via 34.34.34.4, 00:14:22, Serial0/1
R2(config-router)#do 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, 1 subnets
O 34.34.34.0 [110/74] via 24.24.24.4, 00:01:38, Ethernet1/0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.12.12.1, 00:01:38, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback10
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 23.23.23.3, 00:01:38, Serial0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/11] via 24.24.24.4, 00:01:38, Ethernet1/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/75] via 24.24.24.4, 00:01:38, Ethernet1/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
172.16.0.0/24 is subnetted, 4 subnets
O N2 172.16.0.0 [110/20] via 12.12.12.1, 00:01:40, Serial0/0
O N2 172.16.1.0 [110/20] via 12.12.12.1, 00:01:40, Serial0/0
O N2 172.16.2.0 [110/20] via 12.12.12.1, 00:01:40, Serial0/0
O N2 172.16.3.0 [110/20] via 12.12.12.1, 00:01:40, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
C 24.24.24.0 is directly connected, Ethernet1/0
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.0.2.0/24 is directly connected, Loopback2
C 10.0.3.0/24 is directly connected, Loopback3
C 10.0.0.0/24 is directly connected, Loopback0
O 10.0.0.0/22 is a summary, 00:01:40, Null0
C 10.0.1.0/24 is directly connected, Loopback1
O E2 192.168.0.0/24 [110/20] via 24.24.24.4, 00:01:40, Ethernet1/0
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
O E2 192.168.1.0/24 [110/20] via 24.24.24.4, 00:01:41, Ethernet1/0
O E2 192.168.2.0/24 [110/20] via 24.24.24.4, 00:01:41, Ethernet1/0
O E2 192.168.3.0/24 [110/20] via 24.24.24.4, 00:01:41, Ethernet1/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/74] via 24.24.24.4, 00:01:41, Ethernet1/0
b) 外部路由信息汇总是5类汇总(外部路由信息汇总),他是在ASBR 上进行配置的
R1(config-router)#summary-address 172.16.0.0 255.255.252.0
R5(config-router)#summary-address 192.168.0.0 255.255.252.0
R2(config-router)#do 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, 1 subnets
O 34.34.34.0 [110/74] via 24.24.24.4, 00:04:54, Ethernet1/0
1.0.0.0/32 is subnetted, 1 subnets
O 1.1.1.1 [110/65] via 12.12.12.1, 00:04:54, Serial0/0
2.0.0.0/24 is subnetted, 1 subnets
C 2.2.2.0 is directly connected, Loopback10
3.0.0.0/32 is subnetted, 1 subnets
O 3.3.3.3 [110/65] via 23.23.23.3, 00:04:54, Serial0/1
4.0.0.0/32 is subnetted, 1 subnets
O 4.4.4.4 [110/11] via 24.24.24.4, 00:04:54, Ethernet1/0
5.0.0.0/32 is subnetted, 1 subnets
O IA 5.5.5.5 [110/75] via 24.24.24.4, 00:04:54, Ethernet1/0
23.0.0.0/24 is subnetted, 1 subnets
C 23.23.23.0 is directly connected, Serial0/1
172.16.0.0/22 is subnetted, 1 subnets
O N2 172.16.0.0 [110/20] via 12.12.12.1, 00:00:51, Serial0/0
24.0.0.0/24 is subnetted, 1 subnets
C 24.24.24.0 is directly connected, Ethernet1/0
10.0.0.0/8 is variably subnetted, 5 subnets, 2 masks
C 10.0.2.0/24 is directly connected, Loopback2
C 10.0.3.0/24 is directly connected, Loopback3
C 10.0.0.0/24 is directly connected, Loopback0
O 10.0.0.0/22 is a summary, 00:04:55, Null0
C 10.0.1.0/24 is directly connected, Loopback1
12.0.0.0/24 is subnetted, 1 subnets
C 12.12.12.0 is directly connected, Serial0/0
45.0.0.0/24 is subnetted, 1 subnets
O IA 45.45.45.0 [110/74] via 24.24.24.4, 00:04:56, Ethernet1/0
O E2 192.168.0.0/22 [110/20] via 24.24.24.4, 00:00:38, Ethernet1/0