07-07-2016
02:57 PM
- last edited on
11-29-2023
09:25 AM
by
Translator
I would like to filter the show ip bgp output on the Local Preference attribute. So I create a route-map that looks like this:
route-map matchLocPref permit 10
match local-preference 150
route-map matchLocPref deny 1000
Than I reference that route-map in the
show ip bgp
command and I expect that this will filter the output only to the routes which are with Local Preference 150.
But it does not?!
Router#show ip bgp route-map matchLocPref
BGP table version is 25662691, local router ID is 94.156.249.178
Status codes: s suppressed, d damped, h history, * valid, > best, i - internal,
r RIB-failure, S Stale
Origin codes: i - IGP, e - EGP, ? - incomplete
Network Next Hop Metric LocPrf Weight Path
*>i1.0.4.0/24 10.1.254.13 71090 100 0 174 4637 1221 38803 56203 i
*>i1.0.5.0/24 10.1.254.13 71090 100 0 174 4637 1221 38803 56203 i
*>i1.0.6.0/24 10.1.254.13 71090 100 0 174 4637 1221 38803 56203 56203 56203 i
*>i1.0.7.0/24 10.1.254.13 71090 100 0 174 4637 1221 38803 ?
* i1.0.64.0/18 10.2.254.5 0 100 0 34224 5580 2516 7670 18144 i
*>i 10.1.254.13 143110 100 0 174 209 2516 7670 18144 i
*>i1.0.128.0/24 10.2.254.5 0 100 0 34224 4651 9737 23969 i
*>i1.0.128.0/19 10.1.254.13 210160 100 0 174 4766 38040 9737 i
*>i1.0.128.0/18 10.1.254.13 210160 100 0 174 4766 38040 9737 i
As you could see from the output above, the output starts with prefixes which are assigned with the default Local Preference of 100.
So why I'm not getting all of those routes filtered? And yet if I don't have any routes with Local Preference of 150, shouldn't the output show zero matches based on the route-map I use? Am I missing something?
Solved! Go to Solution.
05-10-2017
11:59 AM
- last edited on
11-29-2023
09:27 AM
by
Translator
Hi
Im not really sure if I understand the question but if you want to filter you can try with:
show ip bgp | i (.*150)
05-07-2017 09:53 AM
Hi Boyan,
not sure but I did a couple of test and route-map works matching prefix with access-list or path with as-path access-list but it doesn't work match local preference; I guess that route-map in this command can't reference local preference. Are you sure that it sould filter using local-preference ?
Bye,
enrico
05-10-2017 11:42 AM
Hi Enrico,
I'm not sure, I'm just trying :)
But apparently it does not work...
Boyan
05-10-2017
11:59 AM
- last edited on
11-29-2023
09:27 AM
by
Translator
Hi
Im not really sure if I understand the question but if you want to filter you can try with:
show ip bgp | i (.*150)
11-29-2023 02:07 AM
Thank you Julio!
This regex really did what I was looking for.
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