![](https://i-blog.csdnimg.cn/blog_migrate/eae2c14c2c2990adcea63acb1c0945b7.png)
接上篇
《实验:OSPF高级配置(一)连通性目标实现》
本片主要介绍OSPF地址汇总
在ABR(R2)和ASBR(R5)上实现路由汇总:
路由器关键配置:
R2:
R2(config)#router ospf 1
R2(config-router)#area 1 range 192.168.16.0 0.0.15.255 advertise
在ABR(R2)和ASBR(R5)上实现路由汇总:
路由器关键配置:
R2:
R2(config)#router ospf 1
R2(config-router)#area 1 range 192.168.16.0 0.0.15.255 advertise
R5:
R5(config)#router ospf 1
R5(config-router)#summary-address 192.168.64.0 255.255.240.0
查看路由汇总会的路由表:
R1:
R1#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
R5(config)#router ospf 1
R5(config-router)#summary-address 192.168.64.0 255.255.240.0
查看路由汇总会的路由表:
R1:
R1#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
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet1/0
O E2 192.168.64.0/20 [110/20] via 192.168.1.2, 00:02:15, FastEthernet1/0
O IA 192.168.16.0/20 [110/2] via 192.168.10.2, 00:03:40, FastEthernet0/0
C 192.168.1.0/24 is directly connected, FastEthernet1/0
O E2 192.168.64.0/20 [110/20] via 192.168.1.2, 00:02:15, FastEthernet1/0
O IA 192.168.16.0/20 [110/2] via 192.168.10.2, 00:03:40, FastEthernet0/0
R2:
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
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
O 192.168.30.0/24 [110/2] via 192.168.17.2, 00:04:11, FastEthernet1/0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.17.0/24 is directly connected, FastEthernet1/0
O 192.168.1.0/24 [110/2] via 192.168.10.1, 00:04:11, FastEthernet0/0
O E2 192.168.64.0/20 [110/20] via 192.168.10.1, 00:02:46, FastEthernet0/0
O 192.168.16.0/20 is a summary, 00:04:11, Null0
C 192.168.10.0/24 is directly connected, FastEthernet0/0
C 192.168.17.0/24 is directly connected, FastEthernet1/0
O 192.168.1.0/24 [110/2] via 192.168.10.1, 00:04:11, FastEthernet0/0
O E2 192.168.64.0/20 [110/20] via 192.168.10.1, 00:02:46, FastEthernet0/0
O 192.168.16.0/20 is a summary, 00:04:11, Null0
R4:
R4#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
R4#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
C 192.168.30.0/24 is directly connected, FastEthernet0/0
O IA 192.168.10.0/24 [110/3] via 192.168.30.1, 00:38:40, FastEthernet0/0
O 192.168.17.0/24 [110/2] via 192.168.30.1, 00:38:40, FastEthernet0/0
O IA 192.168.1.0/24 [110/4] via 192.168.30.1, 00:38:40, FastEthernet0/0
O E2 192.168.64.0/20 [110/20] via 192.168.30.1, 00:03:42, FastEthernet0/0
O IA 192.168.10.0/24 [110/3] via 192.168.30.1, 00:38:40, FastEthernet0/0
O 192.168.17.0/24 [110/2] via 192.168.30.1, 00:38:40, FastEthernet0/0
O IA 192.168.1.0/24 [110/4] via 192.168.30.1, 00:38:40, FastEthernet0/0
O E2 192.168.64.0/20 [110/20] via 192.168.30.1, 00:03:42, FastEthernet0/0
R5:
R5#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
R5#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
O 192.168.10.0/24 [110/2] via 192.168.1.1, 00:36:21, FastEthernet0/0
C 192.168.66.0/24 is directly connected, FastEthernet1/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.70.0/24 [120/1] via 192.168.66.2, 00:00:03, FastEthernet1/0
O 192.168.64.0/20 is a summary, 00:04:01, Null0
O IA 192.168.16.0/20 [110/3] via 192.168.1.1, 00:05:26, FastEthernet0/0
C 192.168.66.0/24 is directly connected, FastEthernet1/0
C 192.168.1.0/24 is directly connected, FastEthernet0/0
R 192.168.70.0/24 [120/1] via 192.168.66.2, 00:00:03, FastEthernet1/0
O 192.168.64.0/20 is a summary, 00:04:01, Null0
O IA 192.168.16.0/20 [110/3] via 192.168.1.1, 00:05:26, FastEthernet0/0
R6#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
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
R 192.168.10.0/24 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
C 192.168.66.0/24 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
C 192.168.70.0/24 is directly connected, FastEthernet1/0
R 192.168.64.0/20 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
R 192.168.16.0/20 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
C 192.168.66.0/24 is directly connected, FastEthernet0/0
R 192.168.1.0/24 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
C 192.168.70.0/24 is directly connected, FastEthernet1/0
R 192.168.64.0/20 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
R 192.168.16.0/20 [120/3] via 192.168.66.1, 00:00:16, FastEthernet0/0
本文转自 tiger506 51CTO博客,原文链接:http://blog.51cto.com/tiger506/169922,如需转载请自行联系原作者