OSPF Route Filtering

What is route filtering and why to use it?

In the context of network routing, route filtering is the process by which certain routes are not considered for inclusion in the local route database, or not advertised to one's neighbours. Route filtering is particularly important for use on large networks or on the Internet where it is used for a variety of reasons. To facilitate route filtering a distribute-list is used to control routing updates either coming to or from a router.

In the example below we will configure only 3 routers that will all participate in dynamic routing. However, behind each router eight unique networks will exist. These networks will only be used for the demonstration but are designed in such a way that makes summarization very easy. For example we are using 172.16.0.0-172.16.7.0 that can easily be summarized as 172.16.0.0 255.255.248.0 or /21 or further subnetted into smaller address spaces such as 172.16.0.0 255.255.252.0 or /22.

Step 3: Repeat steps 1 and 2 on R2 and R3 where R2 will make use of networks 172.16.8.0-172.16.15.0 and R3 will make use of 172.16.16.0-172.16.23.0.

Step 4: On R1 router define the network boundary for 172.16.0.0, 172.16.8.0 and 172.16.16.0 as 255.255.252.0 or /30 by not advertising the next four sequential subnets. This will advertise only the first four networks out of the 255.255.248.0 or /29 address space.

Verify the configuration

Now that the configuration is finished lets verify our neighbors and routes. Using the show ip ospf neighbors and show ip route commands you can verify the remote routes to which your router has formed and adjacency and verify the expected routes are being advertised. Use the ping command to verify connectivity. Per the below routing table on R4 we can view the first four network address spaces behind R1, R2 and R3 have been advertised.

Related Posts

What is load sharing and why to use it?Load balancing with BGP is not possible in a multihomed environment with two ISPs. BGP selects only the single best path to a destination among the BGP Read more…

What is a Dynamic Multipoint VPN and why to use it?DMVPN provides the capability for creating a dynamic-mesh VPN network without having to pre-configure (static) all possible tunnel end-point peers, including IPsec (Internet Protocol Security) Read more…