FRRouting / frr

The FRRouting Protocol Suite
https://frrouting.org/
Other
3.35k stars 1.26k forks source link

Specifying the ISIS metric doesn't work correctly when redistributing from BGP to ISIS. #12143

Open abvspace opened 2 years ago

abvspace commented 2 years ago

Hello,

OS version: Ubuntu 22.04.1 LTS. Routers are docker containers running FRR in Ubuntu docker image. Kernel version: 5.4.0-120-generic FRR version: 8.5-dev , Master branch

  1. BGP neighborhood established between R1 and R2. For test purposes, only 1 route is advertised (fd00:100:1900::/64).
  2. Community is added to BGP advertising via route-map (set community 65500:100).
  3. On a R2 is allowed to receive this community and set the tag via RM (set tag 10000).
  4. An eBGP neighborhood has been established between R3 and R1.
  5. There is an ISIS neighborhood between R2 and R3 (there is no BGP between them).
  6. On R2, we redistribute from BGP to ISIS. To do this, we create a route-map, where we set a metric (for example, set metric 60000) based on tag 10000. And we use this RM for redistribution in the global settings of router isis.

Potential bug: when I change the ISIS metric values via RM on R2 (for example, set metric 70000), on the R3 device, the metric value within ISIS doesn't change. However, if I remove the route from BGP (for example, by terminating the BGP session between R1 and R2), then after a new BGP route update, redistribution to ISIS will work correctly with the new metric. And on R3 there will be a metric value of 70000. Note: In fact, the R3 device will have the same ipv6 subnet, with eBGP via R1 and with ISIS via R2. It's only about getting a subnet through ISIS.

R1 device main configuration block:

 interface lo
 ipv6 address fd00:100:1900::1/64
 mpls
exit
!
router bgp 65500
  neighbor 2001:db8:1::2 remote-as 65501 // to R2
  neighbor 2001:d10:1::2 remote-as 65502  // to R3
  !
 address-family ipv6 unicast
  network fd00:100:1900::/64
  neighbor 2001:d10:1::2 activate
  neighbor 2001:d10:1::2 route-map matchany in
  neighbor 2001:d10:1::2 route-map red out
  neighbor 2001:db8:1::2 activate
  neighbor 2001:db8:1::2 route-map matchany in
  neighbor 2001:db8:1::2 route-map red out
!
ipv6 prefix-list red seq 10 permit fd00:100:1900::/64
!
route-map red permit 10
 match ipv6 address prefix-list red
 set community 65500:100
exit  
!
route-map red permit 100
exit

R2 device main configuration block:

  router bgp 65501
    neighbor 2001:db8:1::1 remote-as 65500
    !
 address-family ipv6 unicast
  neighbor 2001:db8:1::1 activate
  neighbor 2001:db8:1::1 route-map red in
  neighbor 2001:db8:1::1 route-map matchany out
  !
  bgp community-list standard red seq 10 permit 65500:100
  !
  route-map red permit 10
 match community red
 set tag 10000
exit
 !
 route-map red permit 100
exit
 !
route-map red-deny permit 10
 match tag 10000
 set distance 15
 set metric 60000
exit
!
route-map red-deny permit 100
exit
!
router isis myisis
 is-type level-1
 net 49.0000.0000.0000.0002.00
 lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
 spf-delay-ietf init-delay 50 short-delay 100 long-delay 500 holddown 3000 time-to-learn 4000
 redistribute ipv6 bgp level-1 route-map red-deny
 mpls-te on
 segment-routing on
 segment-routing global-block 10000 50000 local-block 60000 100000
 segment-routing node-msd 16
exit

R3 device main configuration block: (there is an ISIS neighborhood with R2, and an eBGP neighborhood with R1):

  router bgp 65502
   neighbor 2001:d10:1::1 remote-as 65500
   !
  address-family ipv6 unicast
  neighbor 2001:d10:1::1 activate
  neighbor 2001:d10:1::1 route-map matchany in
  neighbor 2001:d10:1::1 route-map matchany out
!
router isis myisis
 is-type level-1
 net 49.0000.0000.0000.0003.00
 lsp-timers gen-interval 1 refresh-interval 900 max-lifetime 1200
 spf-delay-ietf init-delay 50 short-delay 100 long-delay 500 holddown 3000 time-to-learn 4000
 mpls-te on
 segment-routing on
 segment-routing global-block 10000 50000 local-block 60000 100000
 segment-routing node-msd 16
exit

Command output in screenshots: Screenshot 1 - output from device R3 when metric for route fd00:100:1900::/64 is 60010. 1 Screenshot 2 - changing the metric on R2 to 70000. 2 Screenshot 3 - the metric for the fd00:100:1900::/64 route is still 60010 and doesn't change. 3 Screenshot 4 - we break the eBGP session only between R1 and R2 by disconnecting the link between them. 4 Screenshot 5 - now the metric works correctly on R3, the value is 70010. 5

Please consider this comment as a bug and fix it if possible. Thank you!

donaldsharp commented 2 years ago

looks like someone needs to attach the routemap[add|delete|event]_hook code in isis itself inorder for this to work.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this issue closed.

frrbot[bot] commented 1 year ago

This issue will be automatically closed in the specified period unless there is further activity.