Filtering routers from a neighbor using prefix-lists


Filtering routers from a neighbor using prefix-lists

The this post I’m going to filter routes allow only those from R1 specifically with prefix length between 17 – 19 long into the routing table of R3

The routing table on R3 looks like this at the moment:

17.0.0.0/19 is subnetted, 2 subnets
R       17.0.0.0 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0
R       17.2.0.0 [120/1] via 10.1.1.2, 00:00:02, FastEthernet0/0
1.0.0.0/32 is subnetted, 1 subnets
R       1.1.1.1 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
C       3.3.3.3 is directly connected, Loopback0
10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, FastEthernet0/0
12.0.0.0/18 is subnetted, 2 subnets
R       12.0.0.0 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0
R       12.2.0.0 [120/1] via 10.1.1.2, 00:00:02, FastEthernet0/0
13.0.0.0/17 is subnetted, 2 subnets
R       13.0.0.0 [120/1] via 10.1.1.1, 00:00:08, FastEthernet0/0
R       13.2.0.0 [120/1] via 10.1.1.2, 00:00:03, FastEthernet0/0
14.0.0.0/9 is subnetted, 2 subnets
R       14.0.0.0 [120/1] via 10.1.1.1, 00:00:08, FastEthernet0/0
R       14.128.0.0 [120/1] via 10.1.1.2, 00:00:03, FastEthernet0/0

Configuration steps

1) Configure a prefix-list to filter routes

R3(config)#ip prefix-list R1-Filter permit 0.0.0.0/0 ge 17 le 19

2) Configure a prefix-list that identifies the routing source

R3(config)#ip prefix-list R1 seq 5 permit 10.1.1.1/32    

3) Apply the distribute-list prefix

R3(config)#router rip

R3(config-router)#distribute-list prefix R1-Filter gateway R1 in f0/0

The result is just those routes in the perfix-list are allowed and only from R1 (10.1.1.1)

R3(config-router)#do sh ip ro rip
17.0.0.0/19 is subnetted, 1 subnets
R       17.0.0.0 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0
12.0.0.0/18 is subnetted, 1 subnets
R       12.0.0.0 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0
13.0.0.0/17 is subnetted, 1 subnets
R       13.0.0.0 [120/1] via 10.1.1.1, 00:00:07, FastEthernet0/0

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: