配置OSPFv3 ABR路由聚合示例
举例说明通过OSPFv3 ABR实现路由聚合的配置方法。
组网需求
路由聚合是指将多条具有相同IPv6前缀的路由聚合成一条路由。当大规模部署OSPFv3网络时,可能会出现由于OSPFv3路由表规模过大而降低路由查找速度的现象,为了解决这个问题,可以配置路由聚合,减小路由表的规模,降低管理的复杂度。此外,如果被聚合的IPv6地址范围内的某条链路频繁Up和Down,该变化并不会通告到被聚合的IPv6地址范围外的设备。因此,路由聚合还可以避免网络中的路由振荡,在一定程度上提高了网络的稳定性。
如图6-10所示,所有设备上都运行OSPFv3。在ABR上对Area 1内的具有相同前缀(2001:DB8::)的路由聚合为一条路由2001:DB8::/32之后,ABR将只发布这一条路由到Area 0区域中,从而减小路由表的规模,降低管理的复杂度,并提高了网络的稳定性。
数据准备
为完成此配置例,需准备如下的数据:
区域Area 0和Area 1。
Device B的Router ID为1.1.1.1。
ABR的Router ID为2.2.2.2。
Device A的Router ID为3.3.3.3。
Device C的Router ID为4.4.4.4。
操作步骤
- 配置各接口的IP地址(略)
- 配置OSPFv3基本功能
# 配置Device A。
[~DeviceA] ospfv3 1
[*DeviceA-ospfv3-1] router-id 3.3.3.3
[*DeviceA-ospfv3-1] area 0.0.0.1
[*DeviceA-ospfv3-1-area-0.0.0.1] quit
[*DeviceA-ospfv3-1] quit
[*DeviceA] commit
[~DeviceA] interface gigabitethernet0/2/0
[~DeviceA-GigabitEthernet0/2/0] ospfv3 1 area 1
[*DeviceA-GigabitEthernet0/2/0] quit
[*DeviceA] commit
# 配置Device B。
[~DeviceB] ospfv3 1
[*DeviceB-ospfv3-1] router-id 1.1.1.1
[*DeviceB-ospfv3-1] area 0.0.0.0
[*DeviceB-ospfv3-1-area-0.0.0.0] quit
[*DeviceB-ospfv3-1] quit
[*DeviceB] commit
[~DeviceB] interface gigabitethernet0/1/0
[~DeviceB-GigabitEthernet0/1/0] ospfv3 1 area 0
[*DeviceB-GigabitEthernet0/1/0] quit
[*DeviceB] commit
# 配置Device C。
[~DeviceC] ospfv3 1
[*DeviceC-ospfv3-1] router-id 4.4.4.4
[*DeviceC-ospfv3-1] area 0.0.0.1
[*DeviceC-ospfv3-1-area-0.0.0.1] quit
[*DeviceC-ospfv3-1] quit
[*DeviceC] commit
[~DeviceC] interface gigabitethernet0/3/0
[~DeviceC-GigabitEthernet0/3/0] ospfv3 1 area 1
[*DeviceC-GigabitEthernet0/3/0] quit
[*DeviceC] commit
# 配置ABR。
[~ABR] ospfv3 1
[*ABR-ospfv3-1] router-id 2.2.2.2
[*ABR-ospfv3-1] area 0.0.0.0
[*ABR-ospfv3-1-area-0.0.0.0] quit
[*ABR-ospfv3-1] area 0.0.0.1
[*ABR-ospfv3-1-area-0.0.0.1] quit
[*ABR-ospfv3-1] quit
[*ABR] commit
[~ABR] interface gigabitethernet0/1/0
[~ABR-GigabitEthernet0/1/0] ospfv3 1 area 0
[*ABR-GigabitEthernet0/1/0] quit
[*ABR] interface gigabitethernet0/2/0
[*ABR-GigabitEthernet0/2/0] ospfv3 1 area 1
[*ABR-GigabitEthernet0/2/0] quit
[*ABR] interface gigabitethernet0/3/0
[*ABR-GigabitEthernet0/3/0] ospfv3 1 area 1
[*ABR-GigabitEthernet0/3/0] quit
[*ABR] commit
# 配置完成后,执行display ospfv3 peer命令,可以看到Device A、Device B和Device C与ABR之间建立了邻居关系。以ABR的显示结果为例:
[~ABR] display ospfv3 peer OSPFv3 Process (1) OSPFv3 Area (0.0.0.0) Neighbor ID Pri State Dead Time Interface Instance ID 1.1.1.1 1 Full/DR 00:00:35 GE0/1/0 0 OSPFv3 Area (0.0.0.1) Neighbor ID Pri State Dead Time Interface Instance ID 4.4.4.4 1 Full/Backup 00:00:40 GE0/3/0 0 3.3.3.3 1 Full/Backup 00:00:31 GE0/2/0 0
# 在ABR上执行display ospfv3 lsdb命令查看OSPFv3的链路状态数据库信息。Area 1的数据库中Inter-area-prefix LSA的信息没有进行聚合。因此发布到Area 0的路由没有经过聚合。
[~ABR] display ospfv3 lsdb OSPFv3 Router with ID (2.2.2.2) (Process 1) Link-LSA (Interface GE0/1/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.18 1.1.1.1 1740 0x80000010 0x8b9b 1 0.0.0.18 2.2.2.2 1684 0x80000010 0xc249 1 Link-LSA (Interface GE0/3/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.19 2.2.2.2 154 0x80000002 0x33e2 1 0.0.0.19 4.4.4.4 75 0x80000002 0xf927 1 Link-LSA (Interface GE0/2/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.20 2.2.2.2 383 0x8000000e 0x306 1 0.0.0.11 3.3.3.3 232 0x8000000e 0xc146 1 Router-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum Link 0.0.0.1 1.1.1.1 1682 0x80000010 0xb42e 1 0.0.0.1 2.2.2.2 384 0x80000014 0x9148 1 Network-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum 0.0.0.18 1.1.1.1 1682 0x8000000f 0xb741 Inter-Area-Prefix-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum 0.0.0.2 2.2.2.2 154 0x80000001 0x9071 0.0.0.3 2.2.2.2 1726 0x8000000a 0xf315 Intra-Area-Prefix-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum Prefix Reference 0.0.0.1 1.1.1.1 1682 0x8000000f 0xba9 1 Network-LSA Router-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum Link 0.0.0.1 2.2.2.2 70 0x8000000f 0xa0f4 2 0.0.0.1 3.3.3.3 226 0x8000000e 0x904d 1 0.0.0.1 4.4.4.4 71 0x80000002 0xe8f5 1 Network-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum 0.0.0.19 2.2.2.2 70 0x80000001 0x22d3 0.0.0.20 2.2.2.2 225 0x8000000d 0xdd0f Inter-Area-Prefix-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum 0.0.0.1 2.2.2.2 390 0x8000000d 0x6296 Intra-Area-Prefix-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum Prefix Reference 0.0.0.1 2.2.2.2 231 0x8000000d 0x4f5c 1 Network-LSA 0.0.0.2 2.2.2.2 76 0x80000001 0x6b4b 1 Network-LSA
[~ABR] display ospfv3 lsdb inter-prefix OSPFv3 Router with ID (2.2.2.2) (Process 1) Inter-Area-Prefix-LSA (Area 0.0.0.0) LS Age: 197 LS Type: Inter-Area-Prefix-LSA Link State ID: 0.0.0.2 Originating Router: 2.2.2.2 LS Seq Number: 0x80000001 Retransmit Count: 0 Checksum: 0x9071 Length: 36 Metric: 1 Prefix: 2001:DB8:3::/64 Prefix Options: 0 (-|-|-|-|-) LS Age: 1769 LS Type: Inter-Area-Prefix-LSA Link State ID: 0.0.0.3 Originating Router: 2.2.2.2 LS Seq Number: 0x8000000a Retransmit Count: 0 Checksum: 0xf315 Length: 36 Metric: 1 Prefix: 2001:DB8:2::/48 Prefix Options: 0 (-|-|-|-|-) Inter-Area-Prefix-LSA (Area 0.0.0.1) LS Age: 427 LS Type: Inter-Area-Prefix-LSA Link State ID: 0.0.0.1 Originating Router: 2.2.2.2 LS Seq Number: 0x8000000d Retransmit Count: 0 Checksum: 0x6296 Length: 36 Metric: 1 Prefix: 2001:DB8:1::/64 Prefix Options: 0 (-|-|-|-|-)
- 在ABR上配置路由聚合,将Area 1区域内具有相同前缀的路由聚合为一条路由2001:DB8::/32
[~ABR] ospfv3 1
[*ABR-ospfv3-1] area 0.0.0.1
[*ABR-ospfv3-1-area-0.0.0.1] abr-summary 2001:DB8:: 32
[*ABR-ospfv3-1-area-0.0.0.1] quit
[*ABR-ospfv3-1] quit
[*ABR] commit
- 验证配置结果
# 配置完路由聚合后,在ABR上执行display ospfv3 lsdb命令,可以看到Area 1区域内具有相同前缀的路由聚合成了一条路由2001:DB8::/32,这条路由发布到了Area 0区域中。
[~ABR] display ospfv3 lsdb OSPFv3 Router with ID (2.2.2.2) (Process 1) Link-LSA (Interface GE0/1/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.18 1.1.1.1 108 0x80000011 0x899c 1 0.0.0.18 2.2.2.2 52 0x80000011 0xc04a 1 Link-LSA (Interface GE0/3/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.19 2.2.2.2 322 0x80000002 0x33e2 1 0.0.0.19 4.4.4.4 243 0x80000002 0xf927 1 Link-LSA (Interface GE0/2/0) Link State ID Origin Router Age Seq# CkSum Prefix 0.0.0.20 2.2.2.2 551 0x8000000e 0x306 1 0.0.0.11 3.3.3.3 400 0x8000000e 0xc146 1 Router-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum Link 0.0.0.1 1.1.1.1 50 0x80000011 0xb22f 1 0.0.0.1 2.2.2.2 552 0x80000014 0x9148 1 Network-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum 0.0.0.18 1.1.1.1 50 0x80000010 0xb542 Inter-Area-Prefix-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum 0.0.0.3 2.2.2.2 30 0x80000001 0x6dba Intra-Area-Prefix-LSA (Area 0.0.0.0) Link State ID Origin Router Age Seq# CkSum Prefix Reference 0.0.0.1 1.1.1.1 50 0x80000010 0x9aa 1 Network-LSA Router-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum Link 0.0.0.1 2.2.2.2 238 0x8000000f 0xa0f4 2 0.0.0.1 3.3.3.3 394 0x8000000e 0x904d 1 0.0.0.1 4.4.4.4 239 0x80000002 0xe8f5 1 Network-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum 0.0.0.19 2.2.2.2 238 0x80000001 0x22d3 0.0.0.20 2.2.2.2 393 0x8000000d 0xdd0f Inter-Area-Prefix-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum 0.0.0.1 2.2.2.2 552 0x8000000d 0x6296 Intra-Area-Prefix-LSA (Area 0.0.0.1) Link State ID Origin Router Age Seq# CkSum Prefix Reference 0.0.0.1 2.2.2.2 399 0x8000000d 0x4f5c 1 Network-LSA 0.0.0.2 2.2.2.2 244 0x80000001 0x6b4b 1 Network-LSA
[~ABR] display ospfv3 lsdb inter-prefix OSPFv3 Router with ID (2.2.2.2) (Process 1) Inter-Area-Prefix-LSA (Area 0.0.0.0) LS Age: 40 LS Type: Inter-Area-Prefix-LSA Link State ID: 0.0.0.3 Originating Router: 2.2.2.2 LS Seq Number: 0x80000001 Retransmit Count: 0 Checksum: 0x6dba Length: 32 Metric: 1 Prefix: 2001:DB8::/32 Prefix Options: 0 (-|-|-|-|-) Inter-Area-Prefix-LSA (Area 0.0.0.1) LS Age: 562 LS Type: Inter-Area-Prefix-LSA Link State ID: 0.0.0.1 Originating Router: 2.2.2.2 LS Seq Number: 0x8000000d Retransmit Count: 0 Checksum: 0x6296 Length: 36 Metric: 1 Prefix: 2001:DB8:1::/64 Prefix Options: 0 (-|-|-|-|-)
# 在ABR上执行命令display ospfv3 abr-summary-list,可以查看ABR对Area 1区域内的路由进行路由聚合的信息。
[~ABR] display ospfv3 abr-summary-list OSPFv3 Process (1) Area ID : 0.0.0.1 Prefix Prefix-Len Matched Status 2001:DB8:: 32 1 [Active] Advertised
配置文件
DeviceA的配置文件
# sysname Device A # ospfv3 1 router-id 3.3.3.3 area 0.0.0.1 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:2::1/64 ospfv3 1 area 0.0.0.1 # return
DeviceB的配置文件
# sysname Device B # ospfv3 1 router-id 1.1.1.1 area 0.0.0.0 # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:1::2/64 ospfv3 1 area 0.0.0.0 # return
DeviceC的配置文件
# sysname Device C # ospfv3 1 router-id 4.4.4.4 area 0.0.0.1 # interface GigabitEthernet0/3/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:3::1/64 ospfv3 1 area 0.0.0.1 # return
ABR的配置文件
# sysname ABR # ospfv3 1 router-id 2.2.2.2 area 0.0.0.0 area 0.0.0.1 abr-summary 2001:DB8:: 32 # interface GigabitEthernet0/1/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:1::1/64 ospfv3 1 area 0.0.0.0 # interface GigabitEthernet0/2/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:2::2/64 ospfv3 1 area 0.0.0.1 # interface GigabitEthernet0/3/0 undo shutdown ipv6 enable ipv6 address 2001:DB8:3::2/64 ospfv3 1 area 0.0.0.1 # return