Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FRR 9.1 - route-map not setting local preference #15067

Closed
JMF-Networks opened this issue Dec 27, 2023 · 6 comments
Closed

FRR 9.1 - route-map not setting local preference #15067

JMF-Networks opened this issue Dec 27, 2023 · 6 comments
Assignees
Labels
triage Needs further investigation

Comments

@JMF-Networks
Copy link

  • FRR VERSION = 9.1

  • OPERATING SYSTEM VERSION = Ubuntu 22.04

  • KERNEL VERSION = 6.2.0-1017-lowlatency

route-map IX-PEERING-IN permit 2
match large-community 10
set local-preference 170
set weight 1000

vtysh -c "sh bgp ipv4 unicast neighbors 206.53.170.1 received-routes" | grep 1.0.128.0/17

*> 1.0.128.0/17 206.53.170.15 2165 170 1000 6939 38040 23969 i

vtysh -c "sh bgp ipv4 unicast 1.0.128.0/17" | grep localpref

  Origin IGP, metric 2142, **localpref 0**, valid, internal
  Origin IGP, metric 2165, **localpref 0**, weight 1000, valid, external
  Origin IGP, metric 2165, **localpref 0**, weight 1000, valid, external, bestpath-from-AS 6939, best (Weight)
---------------

** Inbound route-map applied to external routes, does not set local pref. All local pref for external routes is always 0 **

- [x ] Did you check if this is a duplicate issue? - seems others have had this issue in other versions
- [x ] Did you test it on the latest FRRouting/frr master branch? yes


**To Reproduce**
Add a route-map to external peers, set local pref to something, does not work. Setting weight works.

**Expected behavior**
expect route-map set localpref to work as expected.

**Versions**
- OS Version: Ubuntu 22.04
- Kernel: 6.2.0-1017-lowlatency
- FRR Version: FRRouting (version 9.1)
@JMF-Networks JMF-Networks added the triage Needs further investigation label Dec 27, 2023
@ton31337
Copy link
Member

Please show:

show running-config
show ip bgp 1.0.128.0/17

@ton31337 ton31337 self-assigned this Dec 27, 2023
@JMF-Networks
Copy link
Author

JMF-Networks commented Dec 27, 2023

# show ip bgp 1.0.128.0/17
BGP routing table entry for 1.0.128.0/17, version 25
Paths: (3 available, best #2, table default)
  Advertised to non peer-group peers:
  ebr02-atl01(2605:5580:2001:557:108:161:222:202)
  6939 38040 23969, (Received from a RR-client)
    2605:5580:2001:557:108:161:222:202(ebr02-atl01) from ebr02-atl01(2605:5580:2001:557:108:161:222:202) (108.161.222.14)
      Origin IGP, metric 2142, localpref 0, valid, internal
      Community: 65101:10073 65102:10000 65103:840 65104:19 graceful-shutdown
      Large Community: 6695:1000:2 6695:1001:1
      Last update: Wed Dec 27 17:35:05 2023
  6939 38040 23969
    206.53.170.15 from 206.53.170.1 (206.53.170.1)
      Origin IGP, metric 2165, localpref 0, weight 1000, valid, external, bestpath-from-AS 6939, best (Weight)
      Community: 65040:0 65060:11 graceful-shutdown
      Large Community: 64216:1002:3682 64216:1900:0 64216:1903:11
      AddPath ID: RX 45, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0
      Last update: Wed Dec 27 17:34:29 2023
  6939 38040 23969
    206.53.170.15 from 206.53.170.2 (206.53.170.2)
      Origin IGP, metric 2165, localpref 0, weight 1000, valid, external
      Community: 65040:0 65060:11 graceful-shutdown
      Large Community: 64216:1002:3683 64216:1900:0 64216:1903:11
      AddPath ID: RX 71, TX-All 0 TX-Best-Per-AS 0 TX-Best-Selected 0
      Last update: Wed Dec 27 17:34:29 2023

@JMF-Networks
Copy link
Author

JMF-Networks commented Dec 27, 2023

# sh run
Building configuration...

Current configuration:
!
frr version 9.1
frr defaults datacenter
hostname ebr03-atl01-megaix-jmf
log syslog
service integrated-vtysh-config
!
router bgp 40805
 bgp router-id X.X.X.X
 no bgp default ipv4-unicast
 bgp graceful-shutdown
 bgp graceful-restart
 bgp bestpath as-path multipath-relax
 bgp bestpath peer-type multipath-relax
 neighbor ixpeering peer-group
 neighbor ixpeering remote-as external
 neighbor ixpeering description IX Peering Local
 neighbor ixpeering-6 peer-group
 neighbor ixpeering-6 remote-as external
 neighbor ixpeering-6 description IXP Peering 6 local
 neighbor jmf-backbone peer-group
 neighbor jmf-backbone remote-as 40805
 neighbor jmf-backbone description JMF IGP Backbone
 neighbor jmf-backbone bfd
 neighbor jmf-backbone bfd profile BFDCISCO
 neighbor jmf-backbone bfd check-control-plane-failure
 neighbor jmf-backbone-6 peer-group
 neighbor jmf-backbone-6 remote-as 40805
 neighbor jmf-backbone-6 description JMF IGP
 neighbor jmf-backbone-6 bfd
 neighbor jmf-backbone-6 bfd profile BFDCISCO
 neighbor jmf-backbone-6 bfd check-control-plane-failure
 neighbor jmf-backbone-6 capability extended-nexthop
 neighbor jmf-igp peer-group
 neighbor jmf-igp remote-as 65222
 neighbor jmf-igp-6 peer-group
 neighbor jmf-igp-6 remote-as 65222
 neighbor 206.53.170.1 peer-group ixpeering
 neighbor 206.53.170.1 description Megaport MexaIX Ashburn ipv4 A
 neighbor 206.53.170.2 peer-group ixpeering
 neighbor 206.53.170.2 description Megaport MexaIX Ashburn ipv4 B
 neighbor 2606:a980:0:3::1 peer-group ixpeering-6
 neighbor 2606:a980:0:3::1 description Megaport MexaIX Ashburn ipv6 A
 neighbor 2606:a980:0:3::2 peer-group ixpeering-6
 neighbor 2606:a980:0:3::2 description Megaport MexaIX Ashburn ipv6 B
 neighbor X.X.X.X peer-group jmf-igp
 neighbor X.X.X.X description CR01.ATL01
 neighbor X:X:X:X peer-group jmf-igp-6
 neighbor 2X:X:X:X description CR01.ATL01 IPv6
 bgp listen range 206.53.170.21/32 peer-group ixpeering
 bgp listen range 2606:a980:0:3::/64 peer-group ixpeering-6
 bgp listen range 2605:5580:2001:557::/64 peer-group jmf-backbone-6
 !
 address-family ipv4 unicast
  aggregate-address 12.222.200.0/22
  aggregate-address 108.161.208.0/20
  aggregate-address 207.201.202.0/23
  aggregate-address 207.201.215.0/24
  aggregate-address 207.201.216.0/22
  aggregate-address 208.82.160.0/22
  aggregate-address 208.96.176.0/21
  aggregate-address 209.12.70.0/24
  redistribute connected
  neighbor ixpeering activate
  neighbor ixpeering next-hop-self force
  neighbor ixpeering soft-reconfiguration inbound
  neighbor ixpeering route-map IX-PEERING-IN in
  neighbor ixpeering route-map IX-PEERING-LOCAL-OUT out
  neighbor jmf-backbone activate
  neighbor jmf-backbone route-reflector-client
  neighbor jmf-backbone next-hop-self force
  neighbor jmf-backbone soft-reconfiguration inbound
  neighbor jmf-backbone-6 activate
  neighbor jmf-backbone-6 route-reflector-client
  neighbor jmf-backbone-6 next-hop-self force
  neighbor jmf-igp activate
  neighbor jmf-igp next-hop-self force
  neighbor jmf-igp soft-reconfiguration inbound
  neighbor jmf-igp route-map ALLOWALL in
  neighbor jmf-igp route-map JMF-IGP-OUT out
  maximum-paths 32
  maximum-paths ibgp 32
 exit-address-family
 !
 address-family ipv6 unicast
  aggregate-address 2605:5580::/32
  aggregate-address 2605:5580:2000::/36
  redistribute connected
  neighbor ixpeering-6 activate
  neighbor ixpeering-6 next-hop-self force
  neighbor ixpeering-6 soft-reconfiguration inbound
  neighbor ixpeering-6 route-map IPV6-TRANSIT-IN in
  neighbor ixpeering-6 route-map IPV6-TRANSIT-OUT out
  neighbor jmf-backbone-6 activate
  neighbor jmf-backbone-6 route-reflector-client
  neighbor jmf-backbone-6 next-hop-self force
  neighbor jmf-backbone-6 soft-reconfiguration inbound
  neighbor jmf-igp-6 activate
  neighbor jmf-igp-6 next-hop-self force
  neighbor jmf-igp-6 soft-reconfiguration inbound
  neighbor jmf-igp-6 route-map ALLOWALL in
  neighbor jmf-igp-6 route-map IPV6-TRANSIT-OUT out
  maximum-paths 32
  maximum-paths ibgp 32
 exit-address-family
exit
!
access-list jmf-local seq 5 permit 108.161.208.0/20
access-list jmf-local seq 10 permit 10.0.0.0/8
access-list jmf-local seq 15 permit 192.168.0.0/16
access-list jmf-local seq 20 permit 172.16.0.0/12
!
ip prefix-list BGP-CUSTOMER seq 5 permit 23.138.224.0/24
ip prefix-list BGP-CUSTOMER seq 10 permit 23.167.96.0/24
ip prefix-list BGP-CUSTOMER seq 15 permit 23.181.0.0/24
ip prefix-list BGP-CUSTOMER seq 20 permit 23.189.64.0/24
ip prefix-list BGP-CUSTOMER seq 25 permit 23.147.248.0/24
ip prefix-list BGP-CUSTOMER seq 30 permit 38.128.102.0/23 le 24
ip prefix-list BGP-CUSTOMER seq 35 permit 65.154.111.0/24
ip prefix-list BGP-CUSTOMER seq 40 permit 69.85.240.0/24
ip prefix-list BGP-CUSTOMER seq 45 permit 103.202.232.0/22 le 24
ip prefix-list BGP-CUSTOMER seq 50 permit 104.109.13.0/24
ip prefix-list BGP-CUSTOMER seq 55 permit 107.7.255.0/24
ip prefix-list BGP-CUSTOMER seq 60 permit 108.161.211.128/28
ip prefix-list BGP-CUSTOMER seq 65 permit 108.161.211.160/28
ip prefix-list BGP-CUSTOMER seq 70 permit 108.161.211.164/30
ip prefix-list BGP-CUSTOMER seq 75 permit 144.208.104.0/21 le 24
ip prefix-list BGP-CUSTOMER seq 80 permit 157.240.177.0/24
ip prefix-list BGP-CUSTOMER seq 85 permit 170.39.176.0/22
ip prefix-list BGP-CUSTOMER seq 90 permit 170.75.249.0/24
ip prefix-list BGP-CUSTOMER seq 95 permit 199.187.141.0/24
ip prefix-list BGP-CUSTOMER seq 100 permit 199.187.142.0/23 le 24
ip prefix-list BGP-CUSTOMER seq 105 permit 204.49.47.0/24
ip prefix-list BGP-CUSTOMER seq 110 permit 207.201.215.0/24
ip prefix-list BGP-CUSTOMER seq 115 permit 208.82.160.0/24
ip prefix-list BGP-CUSTOMER seq 120 permit 208.82.161.0/24
ip prefix-list BGP-CUSTOMER seq 125 permit 208.96.176.0/21 le 24
ip prefix-list BGP-CUSTOMER seq 130 permit 208.96.188.0/22 le 24
ip prefix-list BGP-CUSTOMER seq 135 permit 208.117.220.0/22 le 24
ip prefix-list BGP-CUSTOMER seq 140 permit 209.12.70.0/24
ip prefix-list BGP-CUSTOMER seq 145 permit 209.12.71.0/24
ip prefix-list BGP-CUSTOMER seq 150 permit 209.12.72.0/24
ip prefix-list BGP-CUSTOMER seq 155 permit 216.238.16.0/20 le 24
ip prefix-list BGP-OUT-MAIN seq 5 permit 12.198.40.0/22 le 24
ip prefix-list BGP-OUT-MAIN seq 10 permit 12.222.200.0/22 le 24
ip prefix-list BGP-OUT-MAIN seq 15 permit 23.181.0.0/24
ip prefix-list BGP-OUT-MAIN seq 35 permit 108.161.208.0/20 le 24
ip prefix-list BGP-OUT-MAIN seq 40 permit 207.201.202.0/23 le 24
ip prefix-list BGP-OUT-MAIN seq 45 permit 207.201.215.0/24
ip prefix-list BGP-OUT-MAIN seq 50 permit 207.201.216.0/22 le 24
ip prefix-list BGP-OUT-MAIN seq 55 permit 208.82.160.0/22 le 24
ip prefix-list BGP-OUT-MAIN seq 60 permit 208.96.176.0/21 le 24
ip prefix-list BGP-OUT-MAIN seq 65 permit 208.117.222.0/24
ip prefix-list BGP-OUT-MAIN seq 70 permit 209.12.70.0/23 le 24
ip prefix-list BGP-TO-CUST-FULL seq 5 permit 0.0.0.0/0 le 24
ip prefix-list BGP-TO-CUST-FULL seq 10 deny 0.0.0.0/0 ge 25
ip prefix-list BGP-TO_TRANSIT-CUST seq 5 deny 10.0.0.0/8 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 10 deny 69.85.240.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 15 deny 80.249.208.0/21 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 20 deny 172.16.0.0/12 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 25 deny 192.168.0.0/16 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 30 deny 206.53.170.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 35 deny 206.53.172.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 40 deny 206.53.200.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 45 deny 206.53.202.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 50 deny 206.81.80.0/23 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 55 deny 206.82.104.0/22 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 60 deny 206.123.24.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 65 deny 216.253.18.0/24 le 32
ip prefix-list BGP-TO_TRANSIT-CUST seq 70 permit 0.0.0.0/0 le 24
ip prefix-list BGP-TO_TRANSIT-CUST seq 75 deny 0.0.0.0/0 ge 25
ip prefix-list DENY-IX-PREFIXES seq 5 permit 23.134.192.0/22
ip prefix-list DENY-IX-PREFIXES seq 10 permit 199.255.76.0/22
ip prefix-list EXT-BGP-IN seq 5 permit 0.0.0.0/0 le 24
ip prefix-list EXT-BGP-IN seq 10 permit 0.0.0.0/0
ip prefix-list IX-BGP-IN seq 5 permit 0.0.0.0/0 le 24
ip prefix-list OSPF-TO-BGP seq 5 deny 80.249.208.0/21
ip prefix-list OSPF-TO-BGP seq 10 permit 0.0.0.0/0 le 32
ip prefix-list JMF-IGP seq 5 permit 108.161.208.0/20 ge 21
ip prefix-list JMF-IGP seq 10 permit 10.0.0.0/8 ge 32
ip prefix-list JMF-IGP seq 15 permit 192.168.0.0/16 ge 32
ip prefix-list JMF-IGP seq 20 permit 172.16.0.0/12 ge 32
!
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 5 permit 2403:f480::/33
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 10 permit 2602:faa4::/36 le 64
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 15 permit 2602:fe58::/36
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 20 permit 2602:fe71::/36
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 25 permit 2602:fec6:10::/44
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 30 permit 2602:ff19::/36
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 35 permit 2604:36c0::/32
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 40 permit 2605:13c0::/32 le 64
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 45 permit 2605:5580:2ffd::/48
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 50 permit 2605:5580:3779::/48
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 55 permit 2605:a280::/36 le 48
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 60 permit 2605:fdc0::/32 le 48
ipv6 prefix-list IPV6-BGP-CUSTOMER seq 65 permit 2607:c480::/32
ipv6 prefix-list IPV6-BGP-TO-CUST-FULL seq 5 permit ::/0 le 64
ipv6 prefix-list IPV6_BGP_IN seq 5 permit ::/0 le 64
ipv6 prefix-list IPV6_BGP_OUT seq 10 permit 2605:5580::/32 le 48
!
bgp as-path access-list AS40805 seq 5 permit ^40805$
!
bgp large-community-list 10 seq 5 permit 6695:1000:1
!
route-map IX-PEERING-OUT permit 10
 match ip address prefix-list BGP-OUT-MAIN
exit
!
route-map IX-PEERING-OUT permit 15
 match community 111
 match ip address prefix-list BGP-CUSTOMER
exit
!
route-map IX-PEERING-OUT deny 20
exit
!
route-map CUSTOMER-IN permit 10
 description Received routes from customers check prefix-list and as-path
 match as-path 111
 match ip address prefix-list BGP-CUSTOMER
 set community 40805:11111
 set local-preference 170
exit
!
route-map CUSTOMER-IN deny 20
exit
!
route-map IX-PEERING-REMOTE-OUT permit 10
 match ip address prefix-list BGP-OUT-MAIN
 set as-path prepend 40805
exit
!
route-map IX-PEERING-REMOTE-OUT permit 15
 match community 111
 match ip address prefix-list BGP-CUSTOMER
 set as-path prepend last-as 2
exit
!
route-map IX-PEERING-REMOTE-OUT deny 20
exit
!
route-map IPV6-TRANSIT-IN permit 10
 match ipv6 address prefix-list IPV6_BGP_IN
 set local-preference 160
 set weight 1000
exit
!
route-map IPV6-TRANSIT-IN deny 20
 match ipv6 address any
exit
!
route-map BGP-TO_TRANSIT-CUST deny 10
 match as-path 300
exit
!
route-map BGP-TO_TRANSIT-CUST deny 15
 match community 121
exit
!
route-map BGP-TO_TRANSIT-CUST permit 20
 match ip address prefix-list BGP-TO_TRANSIT-CUST
exit
!
route-map BGP-TO_TRANSIT-CUST deny 30
exit
!
route-map TRANSIT-OUT-JMF permit 10
 match community 111
exit
!
route-map TRANSIT-OUT-JMF permit 15
 match community 111
 match ip address prefix-list BGP-CUSTOMER
exit
!
route-map TRANSIT-OUT-JMF permit 17
 match ip address prefix-list BGP-OUT-MAIN
exit
!
route-map TRANSIT-OUT-JMF deny 20
exit
!
route-map TRANSIT-IN-FULL permit 10
 match ip address prefix-list TRANSIT-IN-FULL
exit
!
route-map TRANSIT-IN-FULL deny 20
exit
!
route-map IX-PEERING-IN permit 1
 match ip address prefix-list EXT-BGP-IN
 set distance 1
 set local-preference 170
 set weight 1000
exit
!
route-map IX-PEERING-IN permit 2
 match large-community 10
 set local-preference 170
 set weight 1000
exit
!
route-map IX-PEERING-IN permit 10
 match ip address prefix-list IX-BGP-IN
 set local-preference 150
exit
!
route-map IX-PEERING-IN deny 20
exit
!
route-map CUSTOMER-OUT-FULL permit 10
 description Send Full Routes plus Default
 match ip address prefix-list BGP-TO-CUST-FULL
exit
!
route-map CUSTOMER-OUT-FULL deny 20
exit
!
route-map IPV6-TRANSIT-OUT permit 10
 match ipv6 address prefix-list IPV6_BGP_OUT
exit
!
route-map IPV6-TRANSIT-OUT permit 15
 match community 111
 match ipv6 address prefix-list IPV6-BGP-CUSTOMER
exit
!
route-map IPV6-TRANSIT-OUT deny 20
 match ipv6 address any
exit
!
route-map IX-PEERING-BACKUP-IN permit 10
 match ip address prefix-list IX-BGP-IN
 set local-preference 140
exit
!
route-map IX-PEERING-BACKUP-IN deny 20
exit
!
route-map IPV6-CUSTOMER-IN permit 10
 description IPV6 Received routes from customers check prefix-list and as-path
 match as-path 111
 match ipv6 address prefix-list IPV6-BGP-CUSTOMER
 set community 40805:11111
 set local-preference 170
exit
!
route-map IPV6-CUSTOMER-IN deny 20
exit
!
route-map IX-PEERING-LOCAL-OUT permit 10
 match ip address prefix-list BGP-OUT-MAIN
exit
!
route-map IX-PEERING-LOCAL-OUT permit 15
 match community 111
 match ip address prefix-list BGP-CUSTOMER
exit
!
route-map IX-PEERING-LOCAL-OUT deny 20
exit
!
route-map AS40805-IN permit 10
 match as-path AS40805
 set community 65222:40805 additive
exit
!
route-map AS40805-OUT permit 10
 match as-path AS40805
exit
!
route-map ALLOWALL permit 10
exit
!
route-map JMF-IGP-OUT permit 5
 match ip address prefix-list JMF-IGP
exit
!
route-map JMF-IGP-OUT permit 10
 match ip address prefix-list BGP-OUT-MAIN
exit
!
route-map JMF-IGP-OUT permit 15
 match community 111
 match ip address prefix-list BGP-CUSTOMER
exit
!
route-map JMF-IGP-OUT deny 30
exit
!
bfd
 profile BFDCISCO
  transmit-interval 100
  receive-interval 100
 exit
 !
exit

@ton31337
Copy link
Member

ton31337 commented Dec 27, 2023

You have graceful-shutdown (community attached too), which sets local-preference to 0.

@JMF-Networks
Copy link
Author

Wow that was a lot of hair pulling out for something so simple. Had no clue graceful-shutdown would do that.

@JMF-Networks
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs further investigation
Projects
None yet
Development

No branches or pull requests

2 participants