OSPF Route Summarization and Filtering HowTo
About
This document aims to provide example OSPF use-cases where we configure OSPF areas to utilize route summarization and filtering, to reduce the amount of routing information that the ABR propagates to the rest of the OSPF network.
For an overview of all available configuration settings for OSPF refer to the configuration guide:
Introduction
In another howto, an example was provided how the amount routing information each router in an OSPF network need to handle can be reduced by utilizing OSPF areas.
In addition to this the ABR can be configured to further limit the routing information that is propagated from an area into the rest of the OSPF network. This can be done by using route summarization and route filtering.
Note
Being able to efficiently utilize this approach requires that the network have been segmented in a efficient manner.
The following example use-cases are presented in this document:
Case 1: Route Summarization
In this use-case an example will be provided how routing information from different areas can be reduced even more by utilizing route summarization. Route summarization can be applied on ABRs, before route information is distributed into the other areas in the network.
What route summarization entails, is that multiple different devices inside an OSPF area can be represented by a single route to devices outside the area. The reason the network segmentation is important in order to efficiently execute route summarization, is because it is based on subnet sizing.
. . . . . . . . . . . . . . . . . . . . . . . . .
. Area 0.0.0.1 .
. .-------. | 172.16.20.0/24 .
. 172.16.1.0/24 | | | 172.16.21.0/24 .
. . . . . . . . . . . . . . . .--------------+ R2 +-->| 172.16.22.0/24 .
. Area 0.0.0.0 . . | | | | 172.16.23.0/24 .
. . . | '-------' | 172.16.24.0/24 .
. .-------. .-------. | .
. | | | +-' .
. | R1 +--------------+ ABR | .
. | | 10.0.1.0/24 | +-. .
. '-------' '-------' | .
. . . | .-------. | 192.168.20.0/24 .
. . . | | | | 192.168.21.0/24 .
. . . . . . . . . . . . . . . '--------------+ R3 |-->| 192.168.22.0/24 .
. 192.168.1.0/24 | | | 192.168.23.0/24 .
. '-------' | 192.168.24.0/24 .
. .
. . . . . . . . . . . . . . . . . . . . . . . . .
In Figure 1, an example of a OSPF network segmented into two different areas can
be seen. Route summarization will be added on the ABR
router in order to
represent the additional networks that can be accessed from router R2
and
router R3
, as a single route for each of the routers.
The additional networks for R2
can be summarized with 172.16.16.0/20
and the
networks for R3
can be summarized with 192.168.16.0/20
.
Configuration
The route summarization only needs to be configured on the ABR, since the routes are summarized when they are advertised into the backbone area:
ABR:/#> configure ABR:/config/#> router ABR:/config/router/#> ospf ABR:/config/router/ospf/#> area 1 ABR:/config/router/ospf/area-0.0.0.1/#> range 172.16.16.0/20 advertise ABR:/config/router/ospf/area-0.0.0.1/#> range 192.168.16.0/20 advertise ABR:/config/router/ospf/area-0.0.0.1/#> leave ABR:/#>
Resulting Routes
Without any route summarization on the ABR these are the routes that R1 will be assigned by OSPF:
R1:/#> show ip route S - Static | C - Connected | K - Kernel route | > - Selected route O - OSPF | R - RIP | [Distance/Metric] | * - FIB route O 10.0.1.0/24 [110/10] is directly connected, vlan1, 00:12:01 C>* 10.0.1.0/24 is directly connected, vlan1 O>* 172.16.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:08:31 O>* 172.16.20.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.21.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.22.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.23.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.24.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 192.168.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:08:31 O>* 192.168.20.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.21.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.22.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.23.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.24.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06
After routes summarization have been applied on the ABR
the routes on R1
are
assigned like this:
R1:/#> show ip route S - Static | C - Connected | K - Kernel route | > - Selected route O - OSPF | R - RIP | [Distance/Metric] | * - FIB route O 10.0.1.0/24 [110/10] is directly connected, vlan1, 01:59:19 C>* 10.0.1.0/24 is directly connected, vlan1 O>* 172.16.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:01:43 O>* 172.16.16.0/20 [110/30] via 10.0.1.2, vlan1, 00:01:43 O>* 192.168.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:01:43 O>* 192.168.16.0/20 [110/30] via 10.0.1.2, vlan1, 00:01:43
As we can see the routes towards 172.16.20.0/24
, 172.16.21.0/24
,
172.16.22.0/24
, 172.16.23.0/24
, 172.16.24.0/24
are now represented by
172.16.16.0/20
.
In the same manner, the routes towards 192.168.20.0/24
, 192.168.21.0/24
,
192.168.22.0/24
, 192.168.23.0/24
, 192.168.24.0/24
are now represented by
192.168.16.0/20
.
Case 2: Route Filtering
In addition to being able to summarize routes, they can also be filtered out in order to not be advertised outside of the area.
Consider the same setup as in Case 1. Instead of
summarizing the routes towards the networks R1
and R2
are connected to, they
will be filtered out, since we do not want that routing information in any other
areas of the OSPF network.
Configuration
The route filtering needs to be configured on the ABR between the area and the backbone:
ABR:/#> configure ABR:/config/#> router ABR:/config/router/#> ospf ABR:/config/router/ospf/#> area 1 ABR:/config/router/ospf/area-0.0.0.1/#> range 172.16.16.0/20 not-advertise ABR:/config/router/ospf/area-0.0.0.1/#> range 192.168.16.0/20 not-advertise ABR:/config/router/ospf/area-0.0.0.1/#> leave ABR:/#>
Resulting Routes
Without the route filtering, the routes on R1
will look like this:
R1:/#> show ip route S - Static | C - Connected | K - Kernel route | > - Selected route O - OSPF | R - RIP | [Distance/Metric] | * - FIB route O 10.0.1.0/24 [110/10] is directly connected, vlan1, 00:12:01 C>* 10.0.1.0/24 is directly connected, vlan1 O>* 172.16.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:08:31 O>* 172.16.20.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.21.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.22.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.23.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 172.16.24.0/24 [110/30] via 10.0.1.2, vlan1, 00:03:46 O>* 192.168.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:08:31 O>* 192.168.20.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.21.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.22.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.23.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06 O>* 192.168.24.0/24 [110/30] via 10.0.1.2, vlan1, 00:00:06
After the route filtering have been applied on the ABR
, the routes on R1
will look like this:
R1:/#> show ip route S - Static | C - Connected | K - Kernel route | > - Selected route O - OSPF | R - RIP | [Distance/Metric] | * - FIB route O 10.0.1.0/24 [110/10] is directly connected, vlan1, 02:55:46 C>* 10.0.1.0/24 is directly connected, vlan1 O>* 172.16.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:01:50 O>* 192.168.1.0/24 [110/20] via 10.0.1.2, vlan1, 00:01:50
As can be seen, none of the networks connected to R2
and R3
have any routes
towards them propagated outside of their area.