OSPF prefix-suppression- Configurations and Verification

OSPF prefix-suppression is a useful feature to reduce the number of 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, we are only required to advertise the LSAs related to end hosts. By default OSPF will advertise all the LSAs including the transit link LSAs.
OSPF prefix-suppression feature helps overcome this behavior by reducing the number of type-1(router) and tyep-2(network) LSAs advertised.
This feature can be enabled globally on a router or on per interfaces basis.

OSPF prefix-suppression would help in faster SPF calculation due to less number of prefixes in the database. OSPF Type 3, Type 4, Type 5, or Type 7 LSAs are not suppressed.

Fig 1.1- OSPF Prefix Suppression
Global mode configuration:

!
router ospf 1
prefix-suppression
!

Interface mode configuration:

Configurations on Router 1:

RouteXP_R1:
RouteXP_R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RouteXP_R1(config)#int e0/2
RouteXP_R1(config-if)#ip ospf prefix-suppression 
RouteXP_R1(config-if)#int e0/3
RouteXP_R1(config-if)#ip ospf prefix-suppression 
RouteXP_R1(config-if)#end
RouteXP_R1#

Configurations on Router 2:

RouteXP_R2#
RouteXP_R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RouteXP_R2(config)#int e0/0
RouteXP_R2(config-if)#ip ospf prefix-suppression 
RouteXP_R2(config-if)#int e0/1 
RouteXP_R2(config-if)#ip ospf prefix-suppression 
RouteXP_R2(config-if)#end
RouteXP_R2#
RouteXP_R2#

Configurations on Router 3:

RouteXP_R3#
RouteXP_R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RouteXP_R3(config-if)#int e0/1 
RouteXP_R3(config-if)# ip ospf prefix-suppression 
RouteXP_R3(config-if)#int e0/0 
RouteXP_R3(config-if)# ip ospf prefix-suppression 
RouteXP_R3(config-if)#end
RouteXP_R3#
RouteXP_R3#

Configurations on Router 4:

RouteXP_R4#conf t
Enter configuration commands, one per line. End with CNTL/Z.
RouteXP_R4(config)#int e0/2
RouteXP_R4(config-if)#ip ospf prefix-suppression 
RouteXP_R4(config-if)#int e0/3
RouteXP_R4(config-if)#ip ospf prefix-suppression 
RouteXP_R4(config-if)#end
RouteXP_R4#
RouteXP_R4#

Prior to configure OSPF Prefix Suppression

Show commands on Router R1
RouteXP_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
RouteXP_R1#

RouteXP_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
RouteXP_R1#

Show commands on Router R4

RouteXP_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
RouteXP_R4#

RouteXP_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
RouteXP_R4#

After you configure prefix-suppression

Show commands on Router R1
[110/30] via 10.1.12.2, 00:04:22, Ethernet0/2
RouteXP_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
RouteXP_R1#

RouteXP_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
RouteXP_R1#

Show commands on Router R4
RouteXP_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
RouteXP_R4#

RouteXP_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
RouteXP_R4#