cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3934
Views
2
Helpful
4
Replies

Filter show ip bgp output on Local Preference BGP attribute?

Boyan Sotirov
Level 1
Level 1

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?

1 Accepted Solution

Accepted Solutions

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)

 




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

View solution in original post

4 Replies 4

e.ciollaro
Level 4
Level 4

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

Hi Enrico, 

I'm not sure, I'm just trying :)

But apparently it does not work...

Boyan

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)

 




>> Marcar como útil o contestado, si la respuesta resolvió la duda, esto ayuda a futuras consultas de otros miembros de la comunidad. <<

Boyan Sotirov
Level 1
Level 1

Thank you Julio!

This regex really did what I was looking for.

Review Cisco Networking products for a $25 gift card