12-19-2018 05:37 PM - edited 03-05-2019 11:07 AM
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!
Solved! Go to Solution.
12-19-2018 07:58 PM
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.
12-19-2018 06:47 PM
12-19-2018 07:58 PM
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.
12-20-2018 01:21 AM
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
12-20-2018 08:46 PM
12-20-2018 05:49 PM
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.
12-20-2018 08:39 PM
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
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