cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1472
Views
20
Helpful
10
Replies

Help me interpret this prefix-list

hfakoor222
Spotlight
Spotlight
ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 32
!

Does that mean any prefix that has 100.68.x.x    where the x.x  has to be filled out?

for example it includes   100.68.10.1   and not   100.68.10.0

and so does  

 

ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 24

mean  100.68.x.y   where it has to be 100.68.x   with y 0-255?

i.e  it includes both   100.68.10.0    and 100.68.10.1   

 

 

am I right in my assumptions?

 

Thank you

 

1 Accepted Solution

Accepted Solutions

SinghRaminder
Level 1
Level 1
 

So i created some LoopBacks on R2, some with /17 and some with /24 and then some with /32 subnet mask, like this :

 

int lo1

ip address 100.68.0.1 255.255.128.0

int lo2

ip address 100.68.128.1 255.255.128.0

int lo3

ip address 100.68.129.1 255.255.255.0

int lo4

ip address 100.68.130.1 255.255.255.0

int lo10

ip address 100.68.250.1 255.255.255.255

int lo11

ip address 100.68.251.1 255.255.255.255

int lo12

ip address 100.68.252.1 255.255.255.255




###PREFIX-LIST###

ip prefix-list RTBH-filter seq 5 permit 100.68.0.0/16 ge 32

###ROUTE-MAP###

R2#show run | s route-map
redistribute connected route-map RM-RTBH
route-map RM-RTBH permit 10
match ip address prefix-list RTBH-filter




####ROUTER BGP####




R2#show run | s router bgp
router bgp 20
bgp log-neighbor-changes
neighbor 192.168.1.1 remote-as 10
!
address-family ipv4
redistribute connected route-map RM-RTBH
neighbor 192.168.1.1 activate
exit-address-family


 

I am redistributing all the connected routes but if you check the routes on other side, only /32 routes are learned

 

R1#show bgp ipv4 unicast
BGP table version is 6, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 100.68.250.1/32 192.168.1.2 0 0 20 ?
*> 100.68.251.1/32 192.168.1.2 0 0 20 ?
*> 100.68.252.1/32 192.168.1.2 0 0 20 ?


Rest of the routes are not learend

Thanks
Raminder
PS: If this answered your question, please don't forget to rate and select as validated answer

View solution in original post

10 Replies 10

The article was very helpful, I think I need more practice and so I will do a cisco created lab on prefix lists

The-power-of-prefix-lists.png

this photo I make it as reference for me 

NOW for your statement 

ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 32
/16 the prefix-list don't care about what you enter
32<- this value is wrong

 if we change the statement into 

ip prefix-list RTBH-filter permit 100.68.0.0/0 ge 16

here the prefix-list will include all subnet form 
100.68.0.0/16-------100.68.0.0/32

Hi

ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 32

 This prefix list dont make sense to me as "ge" is "greater than" and how can you have a net mask greater than 32? 

 Should be ge /16 or le  /32.

Ayye Ok, it is what was included in the lab

I think the prefix will only allow 32 prefixes on the 10.16.0.0/16. You do that if you want to deny any other prefix

 

See the example in the picture attached from the ENCORE book.

 

 

 

SinghRaminder
Level 1
Level 1

As others mentioned, ge 32 does not makes sense in this. But let's say it was given to you as ge /24 , then 100.68.0.0/16 will act as basé and any route with /24 or more was going to be matched and rest not.

For example 100.68.10.0/17 was not going to be matched but 100.68.10.0/25 was going to be matched with your statemenr

Thanks
Raminder
PS: If this answered your question, please don't forget to rate and select as validated answer

Hello


@hfakoor222 wrote:
ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 32
!

This prefix-list states - Allow all 100.68.x.x routes/network that has a prefix-length that is greater or equal to /32

meaning any 100.68.x.x host routes

100.68.x.x/32

 


@hfakoor222 wrote:
 

 

ip prefix-list RTBH-filter permit 100.68.0.0/16 ge 24

 


This prefix-list states -  Allow all 100.68.x.x routes/networks that has a prefix-length that is greater or equal to /24

 

100.68.x.x/24
100.68.x.x/25
100.68.x.x/26
etc..
100.68.x.x/32

 


Please rate and mark as an accepted solution if you have found any of the information provided useful.
This then could assist others on these forums to find a valuable answer and broadens the community’s global network.

Kind Regards
Paul

SinghRaminder
Level 1
Level 1

To explain what Paul mentioned... I will lab it up for you. Stay tuned

Thanks
Raminder
PS: If this answered your question, please don't forget to rate and select as validated answer

SinghRaminder
Level 1
Level 1
 

So i created some LoopBacks on R2, some with /17 and some with /24 and then some with /32 subnet mask, like this :

 

int lo1

ip address 100.68.0.1 255.255.128.0

int lo2

ip address 100.68.128.1 255.255.128.0

int lo3

ip address 100.68.129.1 255.255.255.0

int lo4

ip address 100.68.130.1 255.255.255.0

int lo10

ip address 100.68.250.1 255.255.255.255

int lo11

ip address 100.68.251.1 255.255.255.255

int lo12

ip address 100.68.252.1 255.255.255.255




###PREFIX-LIST###

ip prefix-list RTBH-filter seq 5 permit 100.68.0.0/16 ge 32

###ROUTE-MAP###

R2#show run | s route-map
redistribute connected route-map RM-RTBH
route-map RM-RTBH permit 10
match ip address prefix-list RTBH-filter




####ROUTER BGP####




R2#show run | s router bgp
router bgp 20
bgp log-neighbor-changes
neighbor 192.168.1.1 remote-as 10
!
address-family ipv4
redistribute connected route-map RM-RTBH
neighbor 192.168.1.1 activate
exit-address-family


 

I am redistributing all the connected routes but if you check the routes on other side, only /32 routes are learned

 

R1#show bgp ipv4 unicast
BGP table version is 6, local router ID is 192.168.1.1
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale, m multipath, b backup-path, f RT-Filter,
x best-external, a additional-path, c RIB-compressed,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found

Network Next Hop Metric LocPrf Weight Path
*> 100.68.250.1/32 192.168.1.2 0 0 20 ?
*> 100.68.251.1/32 192.168.1.2 0 0 20 ?
*> 100.68.252.1/32 192.168.1.2 0 0 20 ?


Rest of the routes are not learend

Thanks
Raminder
PS: If this answered your question, please don't forget to rate and select as validated answer
Review Cisco Networking products for a $25 gift card