cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3475
Views
0
Helpful
5
Replies

Filtering host route with ip prefix-list

Wonkyu Lee
Level 1
Level 1

I am trying to filter a host route(/32) with an IP prefix-list. I will use it on OSPF  distribute-list inbound.

 

Right now I am using an access-list and it working. However, the list is getting longer.

 

 

router ospf 1
router-id 192.168.19.2
area 0 authentication message-digest
network 192.168.0.121 0.0.0.0 area 0
distribute-list HOST_ROUTE in

 

ip access-list standard HOST_ROUTE
deny 192.168.1.235
permit any

 

The prefix-list will match any /32 IP address between 192.168.1.2 - 192.168.1.254.

 

 

 

 

 

 

1 Accepted Solution

Accepted Solutions

Jose Lopez
Level 1
Level 1

Could be,

 

ip prefix-list HOST_ROUTES permit 192.168.1.1/32
ip prefix-list HOST_ROUTES permit 192.168.1.255/32
ip prefix-list HOST_ROUTES deny 192.168.1.0/24 ge 32 le 32
ip prefix-list HOST_ROUTES permit 0.0.0.0/0 le 32

 

View solution in original post

5 Replies 5

Hello,

 

so you want to allow 192.168.1.1 and 192.168.1.255, deny everything else from that range, and allow every other route ?

 

ip access-list standard HOSTS
permit 192.168.1.1
permit 192.168.1.255
deny 192.168.1.0 0.0.0.255

permit any

Can I do it with Prefix-list?

 

 

 

 

You want to match all /32 from 192.168.1.0/24 ?
If not please explain again.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Hello,

 

here is the equivalent of the prefix list:

 

ip prefix-list HOST_ROUTES seq 10 permit 192.168.1.1/32
ip prefix-list HOST_ROUTES seq 20 permit 192.168.1.255/32
ip prefix-list HOST_ROUTES seq 30 deny 192.168.1.0/24
ip prefix-list HOST_ROUTES seq 40 permit 0.0.0.0/0

!

router ospf 1
router-id 192.168.19.2
area 0 authentication message-digest
network 192.168.0.121 0.0.0.0 area 0
distribute-list prefix HOST_ROUTES in

Jose Lopez
Level 1
Level 1

Could be,

 

ip prefix-list HOST_ROUTES permit 192.168.1.1/32
ip prefix-list HOST_ROUTES permit 192.168.1.255/32
ip prefix-list HOST_ROUTES deny 192.168.1.0/24 ge 32 le 32
ip prefix-list HOST_ROUTES permit 0.0.0.0/0 le 32

 

Review Cisco Networking for a $25 gift card