Filtering with Route Map and prefix-list

jskfan
jskfan used Ask the Experts™
on
I have EIGRP routes advertised from R1 to R2 as shown below:

R2#sh ip route eigrp 1      


      10.0.0.0/8 is variably subnetted, 13 subnets, 7 masks
D        10.10.10.10/32 
           [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
      20.0.0.0/32 is subnetted, 1 subnets
D        20.20.20.20 [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
      172.16.0.0/16 is variably subnetted, 5 subnets, 3 masks
D        172.16.0.0/24 [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
D        172.16.2.0/24 [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
D        172.16.3.0/24 [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
D        172.16.12.0/22 
           [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
D        172.16.22.0/26 
           [90/156160] via 192.168.12.1, 00:00:09, FastEthernet0/0
R2#

Open in new window


on R1 I have configured route map and prefix list to block (filter out)network 172.16.0.0 /16 le 26,  but it does not seem to work

route-map FILTER_OUT deny 10
 match ip address prefix-list SMALL_PREFIXES
ip prefix-list SMALL_PREFIXES seq 10 permit 172.16.0.0/16 le 26

route-map FILTER_OUT permit 20

Open in new window


Any Help ?

thank you
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hemil AquinoNetwork Security Engineer
Distinguished Expert 2018
Commented:
Did you apply it to eigrp?

It will look like this:

NewYork(config-router)#distribute-list prefi
NewYork(config-router)#distribute-list ?
  <1-199>      IP access list number
  <1300-2699>  IP expanded access list number
  WORD         Access-list name
  gateway      Filtering incoming address updates based on gateway
  prefix       Filter prefixes in address updates
  route-map    Filter prefixes based on the route-map
Try this on router R1

R1(config)# access-list 1 permit 172.16.0.0 0.0.255.255
R1(config)#
R1(config)# router eigrp 1
R1(config-router)# distribute-list 1 out Exit-Interface
R1(config-router)#

Author

Commented:
route-map FILTER_OUT deny 10
 match ip address prefix-list SMALL_PREFIXES
ip prefix-list SMALL_PREFIXES seq 10 permit 172.16.0.0/16 le 26

route-map FILTER_OUT permit 20

Open in new window


it is route map that matches a prefix list
Ensure you’re charging the right price for your IT

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden using our free interactive tool and use it to determine the right price for your IT services. Start calculating Now!

Author

Commented:
my configuration above should deny 172.16.0.0/16 le 26
but it is not
The configuration which i have written here, doesn’t display 172.16.0.0 network routes in R2 routing table. It will filter out after exiting at R1
Distinguished Expert 2018
Commented:
Tested it, works properly. Compare it to your configuration.
R1:
interface Loopback0
 ip address 172.16.0.1 255.255.255.0
!
interface Loopback1
 ip address 172.16.3.1 255.255.255.0
!
interface Loopback2
 ip address 172.16.2.1 255.255.255.240
!
interface Loopback3
 ip address 172.16.4.1 255.255.255.0
!
interface FastEthernet0/0
 ip address 192.168.0.1 255.255.255.0
!
router eigrp 1
 network 0.0.0.0
 distribute-list route-map FILTER_OUT out
 no auto-summary
!
ip prefix-list SMALL_PREFIXES seq 10 permit 172.16.0.0/16 le 26
!
route-map FILTER_OUT deny 10
 match ip address prefix-list SMALL_PREFIXES
!
route-map FILTER_OUT permit 20

Open in new window

R1 routing table:
R1#sh ip route
     172.16.0.0/16 is variably subnetted, 4 subnets, 2 masks
C       172.16.4.0/24 is directly connected, Loopback3
C       172.16.0.0/24 is directly connected, Loopback0
C       172.16.2.0/28 is directly connected, Loopback2
C       172.16.3.0/24 is directly connected, Loopback1
C    192.168.0.0/24 is directly connected, FastEthernet0/0

Open in new window


R2:
interface FastEthernet0/0
 ip address 192.168.0.2 255.255.255.0
!
router eigrp 1
 network 0.0.0.0
 no auto-summary

Open in new window

R2 routing table:
R2(config-router)#do sh ip route
     172.16.0.0/28 is subnetted, 1 subnets
D       172.16.2.0 [90/409600] via 192.168.0.1, 00:00:02, FastEthernet0/0
C    192.168.0.0/24 is directly connected, FastEthernet0/0

Open in new window

Author

Commented:
router eigrp 1
 network 0.0.0.0
distribute-list route-map FILTER_OUT out

no auto-summary

I did not have the Distribute-List in my Configuration. Do I have to add it ?
Distinguished Expert 2018
Commented:
Without distribution list will not work. :)
Distribute list actually applies filtering to eigrp.

PS
You had it in your configuration few days ago - in this question.

Author

Commented:
Thank you very much Guys!

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial