cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1913
Views
20
Helpful
5
Replies

Prefix-list

star1
Spotlight
Spotlight

Hello all,

I am trying to redistribute static route into the ospf and use prefix-list.

I have 20 static routes need to be advertised through the prefix-list and all the subnets are have different subnet masks. for example they have /8, /24, /26, , /27, /28, /21, /32

I am bit confused about how to use le and ge at the end of the prefix-list.

for example if i write,

 

ip prefix-list static-ospf seq 5 permit 127.0.0.0/8 le 24 is that mean everything from /8,to /24 is permitted to be advertised? or do i have to use ip prefix-list static-ospf seq 5 permit 127.0.0.0/8 ge 24.

 

Note: This changes will be happening on Nexus 5k.

 

I am confused not sure if i should be use LE or GE.

can someone help please? thank you.

 

1 Accepted Solution

Accepted Solutions

Cristian Matei
VIP Alumni
VIP Alumni

Hi,

   

     Here's your options (le stands for less or equal to, while ge stands for greater than or equal to):

              - 192.168.10.0/24 will match on the 192.168.10.x prefix with a prefix-length/mask of exactly /24

              - 192.168.10.0/24 le 26 will match on the 192.168.10.x prefix with a prefix-length/mask between /24 and /26, which means /24, or /25, or /26

              - 192.168.10.0/24 ge 26 will match on 192.168.10.x prefix with a prefix-length/mask between /26 and /32, which means /26, or /27, or /28, or /29, or /30, or /31, or /32

 

Regards,

Cristian Matei.

View solution in original post

5 Replies 5

rais
Level 7
Level 7

permit 127.0.0.0/8 le 24

means to advertise subnets of length 8-24

 

127.0.0.0/8 ge 24

means to advertise subnets of length 24-32

I believe you are simply using 127/8 as an example...as this is the subnet on each IP device.

HTH.

Cristian Matei
VIP Alumni
VIP Alumni

Hi,

   

     Here's your options (le stands for less or equal to, while ge stands for greater than or equal to):

              - 192.168.10.0/24 will match on the 192.168.10.x prefix with a prefix-length/mask of exactly /24

              - 192.168.10.0/24 le 26 will match on the 192.168.10.x prefix with a prefix-length/mask between /24 and /26, which means /24, or /25, or /26

              - 192.168.10.0/24 ge 26 will match on 192.168.10.x prefix with a prefix-length/mask between /26 and /32, which means /26, or /27, or /28, or /29, or /30, or /31, or /32

 

Regards,

Cristian Matei.

Hello All,

 

Thanks to all of you for the quick answers. Now is make more senses.

However, I'me still confused that which value I should be using?

 

For example, le, ge or eq? I understand the difference between them as you guys explained but in my case not sure which one i should use.

In my understanding, I should be using the eq because this will matches the static routes. I'm I right please?

Thank you guys. 

Hello,

 

'eq' will match the exact static route, while 'le' and 'ge' will match any route with a lesser/equal and/or greater/equal mask, so you might inadvertently block or allow routes you do not want to block or allow.

 

I would use 'eq'...although that makes your prefix list longer.

Hello,

 

on a side note, if you really just want to block specific routes, you could use sequence numbers and match on the exact subnet and mask:

 

ip prefix-list PREFIXES_ALLOWED seq 5 permit x.x.x.x/8 eq 8
ip prefix-list PREFIXES_ALLOWED seq 10 permit x.x.x.x/21 eq 21
ip prefix-list PREFIXES_ALLOWED seq 15 permit x.x.x.x/24 eq 24
ip prefix-list PREFIXES_ALLOWED seq 20 permit x.x.x.x/26 eq 26
ip prefix-list PREFIXES_ALLOWED seq 25 permit x.x.x.x/27 eq 27
ip prefix-list PREFIXES_ALLOWED seq 30 permit x.x.x.x/28 eq 28
ip prefix-list PREFIXES_ALLOWED seq 35 permit x.x.x.x/32 eq 32

etc.

etc.

etc.