Introduction
This document describes Open Shortest Path First (OSPF) prefix-suppression feature for IOS® and IOS® -XE.
Background Information
OSPF prefix-suppression is a useful feature in order to reduce the number of Link State Advertisement (LSA) that are flooded within an area. In an OSPF area which has multiple transit links between hosts and actual communication is between the hosts. There is no need to advertise the transit link LSAs to all the routers. You can only advertise the LSAs related to end hosts. By default, OSPF advertises all the LSAs that include the transit link LSAs.
OSPF prefix-suppression feature helps to overcome this behavior and reduces the number of Type 1(router) and Type 2(network) LSAs advertised.
This feature can be enabled globally on a router or on per interfaces basis.
OSPF prefix-suppression helps in faster Shortest Path First (SPF) calculation due to less number of prefixes in the database (DB). OSPF Type 3, Type 4, Type 5, or Type 7 LSAs are not suppressed.
Prerequisites
Requirements
There are no specific requirements for this document.
Components Used
This document is not restricted to specific software and hardware versions.
The information in this document was created from the devices in a specific lab environment. All of the devices used in this document started with a cleared (default) configuration. If your network is live, ensure that you understand the potential impact of any command.
Configure
Network Diagram
ospf prefix suppression Area 0
Configurations
In this diagram, there are 2 PCs, PC1 and PC2 which are connected via a network which has 4 routers, R1, R2, R3, and R4. As the goal here is to ensure end-to-end reachability, you can enable OSPF prefix-suppression on backbone links of R1, R2, R, and R4 which will help in reduction of a number of LSAs.
OSPF prefix-suppression can be configured in either global mode or interface mode:
Global mode configuration:
!
router ospf 1
prefix-suppression
!
Interface mode configuration:
R1:
R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#int e0/2
R1(config-if)#ip ospf prefix-suppression
R1(config-if)#int e0/3
R1(config-if)#ip ospf prefix-suppression
R1(config-if)#end
R1#
R2:
R2#
R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#int e0/0
R2(config-if)#ip ospf prefix-suppression
R2(config-if)#int e0/1
R2(config-if)#ip ospf prefix-suppression
R2(config-if)#end
R2#
R2#
R3:
R3#
R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config-if)#int e0/1
R3(config-if)# ip ospf prefix-suppression
R3(config-if)#int e0/0
R3(config-if)# ip ospf prefix-suppression
R3(config-if)#end
R3#
R3#
R4:
R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)#int e0/2
R4(config-if)#ip ospf prefix-suppression
R4(config-if)#int e0/3
R4(config-if)#ip ospf prefix-suppression
R4(config-if)#end
R4#
R4#
Note: You might need to exclude the management or loopback interfaces from OSPF prefix-suppression if you advertise the management or loopback interfaces via OSPF.
Verify
Use this section in order to confirm that your configuration works properly.
Before you configure prefix-suppression:
R1:
R1#sh ip route
Codes: L - local, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.254/32 is directly connected, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/2
L 10.1.12.1/32 is directly connected, Ethernet0/2
C 10.1.13.0/24 is directly connected, Ethernet0/3
L 10.1.13.1/32 is directly connected, Ethernet0/3
O 10.1.24.0/24 [110/20] via 10.1.12.2, 00:02:29, Ethernet0/2
O 10.1.34.0/24 [110/20] via 10.1.13.3, 00:02:12, Ethernet0/3
O 10.2.2.0/24 [110/30] via 10.1.13.3, 00:04:22, Ethernet0/3
[110/30] via 10.1.12.2, 00:04:22, Ethernet0/2
R1#
R1#show ip ospf database network | i Mask|Attached Router|State ID
Link State ID: 10.1.12.2 (address of Designated Router)
Network Mask: /24
Attached Router: 10.1.24.2
Attached Router: 10.1.13.1
Link State ID: 10.1.13.3 (address of Designated Router)
Network Mask: /24
Attached Router: 10.1.34.3
Attached Router: 10.1.13.1
Link State ID: 10.1.24.4 (address of Designated Router)
Network Mask: /24
Attached Router: 10.2.2.254
Attached Router: 10.1.24.2
Link State ID: 10.1.34.4 (address of Designated Router)
Network Mask: /24
Attached Router: 10.2.2.254
Attached Router: 10.1.34.3
R1#
R4:
R4#sh ip route
Codes: L - local, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 9 subnets, 2 masks
O 10.1.1.0/24 [110/30] via 10.1.34.3, 00:04:59, Ethernet0/3
[110/30] via 10.1.24.2, 00:04:59, Ethernet0/2
O 10.1.12.0/24 [110/20] via 10.1.24.2, 00:04:59, Ethernet0/2
O 10.1.13.0/24 [110/20] via 10.1.34.3, 00:04:59, Ethernet0/3
C 10.1.24.0/24 is directly connected, Ethernet0/2
L 10.1.24.4/32 is directly connected, Ethernet0/2
C 10.1.34.0/24 is directly connected, Ethernet0/3
L 10.1.34.4/32 is directly connected, Ethernet0/3
C 10.2.2.0/24 is directly connected, Ethernet0/1
L 10.2.2.254/32 is directly connected, Ethernet0/1
R4#
R4#show ip ospf database network | i Mask|Attached Router|State ID
Link State ID: 10.1.12.2 (address of Designated Router)
Network Mask: /24
Attached Router: 10.1.24.2
Attached Router: 10.1.13.1
Link State ID: 10.1.13.3 (address of Designated Router)
Network Mask: /24
Attached Router: 10.1.34.3
Attached Router: 10.1.13.1
Link State ID: 10.1.24.4 (address of Designated Router)
Network Mask: /24
Attached Router: 10.2.2.254
Attached Router: 10.1.24.2
Link State ID: 10.1.34.4 (address of Designated Router)
Network Mask: /24
Attached Router: 10.2.2.254
Attached Router: 10.1.34.3
R4#
After you configure prefix-suppression:
Please note that now we see only one OSPF route on Router1 and Router4.
R1:
[110/30] via 10.1.12.2, 00:04:22, Ethernet0/2
R1#sh ip route
Codes: L - local, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
C 10.1.1.0/24 is directly connected, Ethernet0/1
L 10.1.1.254/32 is directly connected, Ethernet0/1
C 10.1.12.0/24 is directly connected, Ethernet0/2
L 10.1.12.1/32 is directly connected, Ethernet0/2
C 10.1.13.0/24 is directly connected, Ethernet0/3
L 10.1.13.1/32 is directly connected, Ethernet0/3
O 10.2.2.0/24 [110/30] via 10.1.13.3, 00:07:38, Ethernet0/3
[110/30] via 10.1.12.2, 00:07:38, Ethernet0/2
R1#
R1#show ip ospf database network | i Mask|Attached Router|State ID
Link State ID: 10.1.12.1 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.13.1
Attached Router: 10.1.24.2
Link State ID: 10.1.13.1 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.13.1
Attached Router: 10.1.34.3
Link State ID: 10.1.24.2 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.24.2
Attached Router: 10.2.2.254
Link State ID: 10.1.34.4 (address of Designated Router)
Network Mask: /32
Attached Router: 10.2.2.254
Attached Router: 10.1.34.3
R1#
R4:
R4#sh ip route
Codes: L - local, 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, H - NHRP, l - LISP
+ - replicated route, % - next hop override
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 7 subnets, 2 masks
O 10.1.1.0/24 [110/30] via 10.1.34.3, 01:15:37, Ethernet0/3
[110/30] via 10.1.24.2, 01:15:47, Ethernet0/2
C 10.1.24.0/24 is directly connected, Ethernet0/2
L 10.1.24.4/32 is directly connected, Ethernet0/2
C 10.1.34.0/24 is directly connected, Ethernet0/3
L 10.1.34.4/32 is directly connected, Ethernet0/3
C 10.2.2.0/24 is directly connected, Ethernet0/1
L 10.2.2.254/32 is directly connected, Ethernet0/1
R4#
R4#show ip ospf database network | i Mask|Attached Router|State ID
Link State ID: 10.1.12.1 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.13.1
Attached Router: 10.1.24.2
Link State ID: 10.1.13.1 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.13.1
Attached Router: 10.1.34.3
Link State ID: 10.1.24.2 (address of Designated Router)
Network Mask: /32
Attached Router: 10.1.24.2
Attached Router: 10.2.2.254
Link State ID: 10.1.34.4 (address of Designated Router)
Network Mask: /32
Attached Router: 10.2.2.254
Attached Router: 10.1.34.3
R4#
Troubleshoot
There is currently no specific troubleshooting information available for this configuration.