OSPF – Filtering routes from a specfic source

In OSPF we can filter routes from a specific source through the use of a route-map. In this example we have 3 routers (R1, R2 and R3) on a common subnet. R2 and R3 are both advertising the same route In this example we will filter coming from R3 leaving the route from R2 in the routing table.

R1(config-router)#do sh ip route osp is subnetted, 1 subnets
O [110/11] via, 00:03:27, FastEthernet0/0
[110/11] via, 00:03:27, FastEthernet0/0

To configure

1) Create a prefix-list to match on the route

R1(config)#ip prefix-list Lo1 permit

2) Create an ACL match the next hop of the route.

R1(config)#access-list 3 permit host

3) Create a route-map that matches on the route in the prefix list plus matches on the IP next-hop of the route and denies them. Add an extra permit to the route-map to allow the rest of the routes.

R1(config)#route-map Filter deny 10

R1(config-route-map)#match ip add prefix-list Lo1

R1(config-route-map)#match ip next-hop 3

R1(config-route-map)#route-map Filter permit 90

4) Configure the distribute-list with the route-map statement under the OSPF process

R1(config-route-map)#router os 1

1(config-router)#distribute-list route-map Filter in

When we check the routing table we see that the route from R3 is now filtered

     R1(config-router)#do sh ip route osp is subnetted, 1 subnets
O [110/11] via, 00:00:08, FastEthernet0/0


Nice and easy filtering !


About ccie4all
Hello, and welcome to the first post of my CCIE blog This blog has got one simple goal and that is to improve our skills in Cisco Networking field so we can become best engineers on a job market. Wordpress Blog https://ccie4all.wordpress.com/ information about the changes made to Gns3 BGP , MPLS and R&S CCIE labs. In order to access and download all provided materials and receive important updates from Gns3 BGP , MPLS and R&S CCIE labs under GNS3 tab in the main header please go ahead and subscribe to https://ccie4all.wordpress.com/ ! All other posts have not been affected and can be accessed at any given time. Enjoy ! Tom

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: