cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2424
Views
25
Helpful
6
Replies

BGP Local Pref attributes not showing up on destination router

I have a simple sim. Router A and Router B.

 

Router A receives tagged OSPF routes and sets Local-Pref values via route-map based on those tags.

These Local-Pref values show up in the show ip bgp nei 10.3.1.78 advertised-routes command:

 

DRDC-WANRTR01#show ip bgp nei 10.3.1.78 advertised-routes
BGP table version is 15, local router ID is 10.254.255.77
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
*> 10.3.1.76/30     0.0.0.0                  0         32768 ?
*> 10.250.1.0/24    10.254.255.78            2     20  32768 ?
*> 10.254.255.32/30 10.254.255.78            4     10  32768 ?
*> 10.254.255.36/30 10.254.255.78            4     10  32768 ?
*> 10.254.255.40/30 10.254.255.78            3     10  32768 ?
*> 10.254.255.44/30 10.254.255.78            3     10  32768 ?
*> 10.254.255.76/30 0.0.0.0                  0         32768 ?
*> 10.254.255.200/30
                    10.254.255.78            2     10  32768 ?
*> 10.254.255.204/30
                    10.254.255.78            2     10  32768 ?
*> 10.254.255.208/30
                    10.254.255.78           12     10  32768 ?

Total number of prefixes 10

but they do not show up in the show ip bgp nei 10.3.1.77 received-routes on Router B:

 

 

ATT-WAN#show ip bgp nei 10.3.1.77 received-routes
BGP table version is 15, local router ID is 10.3.1.158
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
*  10.3.1.76/30     10.3.1.77                0             0 65218 ?
*  10.250.1.0/24    10.3.1.77                2             0 65218 ?
*  10.254.255.32/30 10.3.1.77                4             0 65218 ?
*  10.254.255.36/30 10.3.1.77                4             0 65218 ?
*  10.254.255.40/30 10.3.1.77                3             0 65218 ?
*  10.254.255.44/30 10.3.1.77                3             0 65218 ?
*  10.254.255.76/30 10.3.1.77                0             0 65218 ?
*  10.254.255.200/30
                    10.3.1.77                2             0 65218 ?
*  10.254.255.204/30
                    10.3.1.77                2             0 65218 ?
*  10.254.255.208/30
                    10.3.1.77               12             0 65218 ?

Total number of prefixes 10

 

 

On Router A, here is the BGP Config:

 

DRDC-WANRTR01#show run | s r bgp
router bgp 65218
 no synchronization
 bgp log-neighbor-changes
 redistribute connected
 redistribute ospf 20 route-map OSPF-to-BGP-RM
 neighbor 10.3.1.78 remote-as 13979
 no auto-summary

And here is hte OSPF-to-BGP-RM handling Local-Pref assignment:

 

 

route-map OSPF-to-BGP-RM permit 10
 description Match Tag 100 set Local Pref 10
 match tag 100
 set local-preference 10
route-map OSPF-to-BGP-RM permit 20
 description Match Untagged set Local Pref 20
 match route-type internal
 set local-preference 20

And here is Router B's BGP config:

 

 

ATT-WAN#show run | s r bgp
router bgp 13979
 no synchronization
 bgp log-neighbor-changes
 network 10.3.1.0 mask 255.255.255.252
 redistribute connected
 neighbor 10.3.1.2 remote-as 65073
 neighbor 10.3.1.2 soft-reconfiguration inbound
 neighbor 10.3.1.77 remote-as 65218
 neighbor 10.3.1.77 soft-reconfiguration inbound
 neighbor 10.3.1.153 remote-as 65217
 neighbor 10.3.1.153 soft-reconfiguration inbound
 neighbor 10.3.1.157 remote-as 65217
 neighbor 10.3.1.157 soft-reconfiguration inbound
 no auto-summary

 

 

So again, I need to know:

A) Why isn't Router B (ATT-WAN) receiving the modified local-pref attributes that show up in the advertised routes on Router A?

B) If it's because local-pref values aren't actually sent to neighboring routers when they're applied during redistribution into BGP, does anyone know a good way to apply Local-Pref values based on received OSPF route tags?  I'm trying to avoid keeping a long ACL or Prefix List.

 

Thanks!

1 Accepted Solution

Accepted Solutions

Francesco Molino
VIP Alumni
VIP Alumni

Hi

 

Local-pref won't be transmitted over ebgp peering.

Here the config you should do:

Router A

 

ip bgp-community new-format
route-map OSPF-to-BGP-RM permit 10 description Match Tag 100 set Local Pref 10 match tag 100 set community 65218:10 route-map OSPF-to-BGP-RM permit 20 description Match Untagged set Local Pref 20 match route-type internal set community 65218:20

 

Then on router B:

 

ip bgp-community new-format

ip community-list standard RTR-A-PREF10 permit 65218:10
ip community-list standard RTR-A-PREF20 permit 65218:20

route-map BGP-IN-RTR-A permit 10

  match community RTR-A-PREF10

  set local-pref 10

route-map BGP-IN-RTR-A permit 20

  match community RTR-A-PREF20

  set local-pref 20

route-map BGP-IN-RTR-A permit 30

!

router bgp 13979

  neighbor 10.3.1.77 route-map BGP-RTR-A in

 

 

 

I've done it quickly over my phone. Just take a re-read to make sure there's no misspelled commands.

Just for you to know, default local preference is 100 then choosing 10 or 20 will make these prefixes the less preferred. If you want them to be the highest preferred then increment these values above 100.

 

Hope this helps.

 

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

View solution in original post

6 Replies 6

Router A and Router B are eBGP peers, and local-preference will not be exchanged between external BGP routers. So, local-preference will not help you to accomplish what you are planning to do. You can use "community" to pass on the route tags.

HTH,
Meheretab

HTH,
Meheretab

Francesco Molino
VIP Alumni
VIP Alumni

Hi

 

Local-pref won't be transmitted over ebgp peering.

Here the config you should do:

Router A

 

ip bgp-community new-format
route-map OSPF-to-BGP-RM permit 10 description Match Tag 100 set Local Pref 10 match tag 100 set community 65218:10 route-map OSPF-to-BGP-RM permit 20 description Match Untagged set Local Pref 20 match route-type internal set community 65218:20

 

Then on router B:

 

ip bgp-community new-format

ip community-list standard RTR-A-PREF10 permit 65218:10
ip community-list standard RTR-A-PREF20 permit 65218:20

route-map BGP-IN-RTR-A permit 10

  match community RTR-A-PREF10

  set local-pref 10

route-map BGP-IN-RTR-A permit 20

  match community RTR-A-PREF20

  set local-pref 20

route-map BGP-IN-RTR-A permit 30

!

router bgp 13979

  neighbor 10.3.1.77 route-map BGP-RTR-A in

 

 

 

I've done it quickly over my phone. Just take a re-read to make sure there's no misspelled commands.

Just for you to know, default local preference is 100 then choosing 10 or 20 will make these prefixes the less preferred. If you want them to be the highest preferred then increment these values above 100.

 

Hope this helps.

 

 


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Hello

 

Just like to add to @Francesco Molino suggested configuration so that to be able to send/receive community attribute values you also need to specify that to the bgp peer.

 

example:
router bgp 65218
neighbor 10.3.1.78 send-community both


router bgp 13979
neighbor 10.3.1.77  send-community both


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

Thanks Paul.
Your right i forgot send-community commands on neighbor statement.


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Thanks, I had completely forgotten that local-pref needs to stay w/i the ASN.  

 

Here's a followup question:  Say I redistribute OSPF routes into BGP and tag them with a Community variable, like this:

route-map OSPF-to-BGP-RM permit 10
 description Match Tag 100 set Community 100
 match tag 100
 set community 100
route-map OSPF-to-BGP-RM permit 20
 description Match Untagged set Community 200
 match route-type internal
 set community 200

Then, say I want to use those Community tags to identify which routes should have the as-prepended, like this:

route-map BGP-OUT-RM permit 10
 match community 100
 set as-path prepend 65218 65218 65218 65218
route-map BGP-OUT-RM permit 20
 match community 200

 

And I apply that route-map to a BGP neighbor outbound. When I do this, my router advertises 0 routes to its peer.  None of the routes match the route-map, even though I can issue show ip bgp community 100 or 200 and get the correct results.  Any ideas as to why that might be?

 

Thanks in advance.

When you match community WORD in the route-map, you are not matching the community value. You are actually matching community-list named WORD. Please follow the example provided by Fancesco. Also, do not forget to add neighbor X.X.X.X send-community both (both to include extended communities as well) if you are sending communities as suggested by Paul.

 

HTH,

Meheretab

HTH,
Meheretab
Review Cisco Networking products for a $25 gift card