12-24-2023 08:18 AM - last edited on 12-25-2023 09:17 PM by Translator
Hello,
I just wanted to confirm below prefix-list will not advertise 10.100.0.0/16 but will advertise all smaller subnets with mask greater than 16.
ip prefix-list xxxx permit 10.100.0.0/16 ge 17
Tks,
Raghavendra
Solved! Go to Solution.
12-25-2023 08:59 PM - last edited on 12-25-2023 09:31 PM by Translator
Hi @raghav.rai ,
The "sh bgp ipv4 uni" lists all of the BGP prefixes. The
sh bgp ipv4 uni prefix-list xxxx
lists all prefixes permitted by the prefix-list xxxx.
The only prefix not present in the output of the second command is "10.100.0.0/16" validating that this prefix is not permitted by the prefix-list.
Regards,
12-24-2023 08:42 AM - last edited on 12-25-2023 09:24 PM by Translator
Hello @raghav.rai
The prefix list ip prefix-list xxxx permit 10.100.0.0/16 ge 17 will indeed permit the /16 subnet along with all smaller subnets with a prefix length greater than or equal to 17. So, it includes the /16 subnet, not excluding it.
If you want to exclude the /16 subnet and permit only smaller subnets, you should use the lt operator.
ip prefix-list xxxx permit 10.100.0.0/16 lt 16
This will permit all subnets with a prefix length less than or equal to 16, excluding the /16 subnet itself.
12-24-2023 09:26 AM
Hi M02@rt37 ,
> The prefix list ip prefix-list xxxx permit 10.100.0.0/16 ge 17 will indeed permit the /16 subnet
> along with all smaller subnets with a prefix length greater than or equal to 17.
10.100.0.0/16 would definitely be rejected by the prefix list. Only prefixes with a prefix length of 17 or longer would be permitted.
Regards,
12-24-2023 11:28 AM
Thanks for that clarification @Harold Ritter
12-24-2023 09:14 AM - edited 12-24-2023 09:27 AM
Hi @raghav.rai ,
If you have for example 10.100.0.0/16, 10.100.0.0/17 and 10.100.128.0/17, only the last 2 prefixes would be permitted through the prefix list.
The first prefix would be rejected because the prefix-list condition is for prefixes to have a prefix length of 17 or greater, which is not met by the first prefix.
Regards,
12-25-2023 12:11 AM
I think this is the answer - however, I would like to test it once. Do you have an option to test this?
12-25-2023 08:02 AM - last edited on 12-25-2023 09:27 PM by Translator
Hi @raghav.rai ,
Here's a quick test that shows the outcome of the prefix-list.
R1#sh runn | sec prefix
ip prefix-list xxxx seq 5 permit 10.100.0.0/16 ge 17
R1#sh bgp ipv4 uni
BGP table version is 28, local router ID is 192.168.12.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,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.100.0.0/17 0.0.0.0 0 32768 i
*> 10.100.0.0/16 0.0.0.0 0 32768 i
*> 10.100.128.0/17 0.0.0.0 0 32768 i
R1#sh bgp ipv4 uni prefix-list xxxx
BGP table version is 28, local router ID is 192.168.12.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,
t secondary path,
Origin codes: i - IGP, e - EGP, ? - incomplete
RPKI validation codes: V valid, I invalid, N Not found
Network Next Hop Metric LocPrf Weight Path
*> 10.100.0.0/17 0.0.0.0 0 32768 i
*> 10.100.128.0/17 0.0.0.0 0 32768 i
Regards,
12-25-2023 08:35 PM
Thanks a lot Harold!
sorry could not decode your show outputs. Is it blocking 10.100.0.0/16 ?
12-25-2023 08:59 PM - last edited on 12-25-2023 09:31 PM by Translator
Hi @raghav.rai ,
The "sh bgp ipv4 uni" lists all of the BGP prefixes. The
sh bgp ipv4 uni prefix-list xxxx
lists all prefixes permitted by the prefix-list xxxx.
The only prefix not present in the output of the second command is "10.100.0.0/16" validating that this prefix is not permitted by the prefix-list.
Regards,
12-25-2023 09:01 PM
Thanks a lot!
12-25-2023 09:12 PM
You are very welcome @raghav.rai and thanks for the feedback
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide