ospf的路由聚合
这个拓扑中AR1上3个loopback在area1中宣告,AR4上的2个loopback模拟lsa5(lsa7)重分布进ospf中,现在分别在ABR(AR2)和ASBR(AR4)上做内部路由聚合以及外部路由聚合,当area2区域被配置成NSSA时,那么在AR4上聚合的路由就是lsa7型,普通区域则聚合lsa5型。
ospf内部路由聚合配置实例如下,AR1上配置
ospf 1 router-id 1.1.1.1
area 0.0.0.1
abr-summary 1.1.1.0 255.255.255.0 聚合路由将3条32位主机路由聚合成一条24位网路路由(由AR2)发布出去,聚合那个区域的路由就进入那个区域进行配置
network 1.1.1.1 0.0.0.0
network 1.1.1.2 0.0.0.0
network 1.1.1.3 0.0.0.0
network 12.1.1.1 0.0.0.0
#
聚合后在AR4上查看lsdb和路由
<AR4>display ospf lsdb
OSPF Process 1 with Router ID 4.4.4.4
Link State Database
Area: 0.0.0.2
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 4.4.4.4 4.4.4.4 1144 36 80000005 1
Router 3.3.3.3 3.3.3.3 1145 36 80000004 1
Network 34.1.1.4 4.4.4.4 1144 32 80000001 0
Sum-Net 12.1.1.0 3.3.3.3 1186 28 80000001 2
Sum-Net 23.1.1.0 3.3.3.3 1186 28 80000001 1
Sum-Net 1.1.1.0 3.3.3.3 665 28 80000001 2
AS External Database
Type LinkState ID AdvRouter Age Len Sequence Metric
External 4.4.4.4 4.4.4.4 1019 36 80000008 1
External 34.1.1.0 4.4.4.4 1019 36 80000008 1
<AR4>
<AR4>display ip routing-table protocol ospf
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : OSPF
Destinations : 3 Routes : 3
OSPF routing table status : <Active>
Destinations : 3 Routes : 3
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 OSPF 10 3 D 34.1.1.3 GigabitEthernet0/0/0
12.1.1.0/24 OSPF 10 3 D 34.1.1.3 GigabitEthernet0/0/0
23.1.1.0/24 OSPF 10 2 D 34.1.1.3 GigabitEthernet0/0/0
OSPF routing table status : <Inactive>
Destinations : 0 Routes : 0
<AR4>
ospf外部路由聚合配置实例如下,AR4上配置
ospf 1 router-id 4.4.4.4
asbr-summary 4.4.4.0 255.255.255.0
聚合lsa5类外部路由,这里不在ospf任何区域内不用进入区域中配置
import-route direct
area 0.0.0.2
network 34.1.1.4 0.0.0.0
#
在AR1上查看聚合的外部路由
[Huawei]display ospf 1 lsdb
OSPF Process 1 with Router ID 1.1.1.1
Link State Database
Area: 0.0.0.1
Type LinkState ID AdvRouter Age Len Sequence Metric
Router 2.2.2.2 2.2.2.2 1223 36 8000000D 1
Router 1.1.1.1 1.1.1.1 479 72 80000011 1