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

bgpd: Fix show neighbor X advertised-routes detail #17674

Conversation

ton31337
Copy link
Member

No description provided.

@frrbot frrbot bot added bgp tests Topotests, make check, etc labels Dec 19, 2024
@ton31337 ton31337 marked this pull request as draft December 19, 2024 09:59
@ton31337 ton31337 force-pushed the fix/bgp_show_advertised_routes_detail branch 3 times, most recently from 9df7500 to 64b6fd6 Compare December 19, 2024 15:02
…utes detail`

If we have a route-map that sets some attributes e.g. community or large-community,
and the route-map is applied for outgoing direction, everything is fine, but
we missed the point that `advertised-routes detail` was not using the applied
attributes to display and instead it uses what is received from the peer (original).

Let's fix this, and use what's already applied (advertise attributes), and
we can now see:

```
route-map r3 permit 10
 match ip address prefix-list p1
 set community 65001:65002
 set extcommunity bandwidth 100
 set large-community 65001:65002:65003
exit
!
...
 address-family ipv4 unicast
  neighbor 192.168.2.3 route-map r3 out
 exit-address-family
...
```

The output:

```
r2# show bgp ipv4 neighbors 192.168.2.3 advertised-routes detail
BGP table version is 1, local router ID is 192.168.2.2, vrf id 0
Default local pref 100, local AS 65002
BGP routing table entry for 10.10.10.1/32, version 1
Paths: (1 available, best #1, table default)
  Advertised to non peer-group peers:
  192.168.1.1 192.168.2.3
  65001
    0.0.0.0 from 192.168.1.1 (192.168.1.1)
      Origin IGP, valid, external, best (First path received)
      Community: 65001:65002
      Extended Community: LB:65002:12500000 (100.000 Mbps)
      Large Community: 65001:65002:65003
      Last update: Thu Dec 19 17:00:40 2024
```

Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337 ton31337 force-pushed the fix/bgp_show_advertised_routes_detail branch from 64b6fd6 to 708f08c Compare December 19, 2024 15:10
E.g.:
```
r1# sh bgp ipv4 unicast neighbors 192.168.1.2 routes json
{
 "vrfId": 0,
 "vrfName": "default",
 "tableVersion": 2,
 "routerId": "192.168.1.1",
 "defaultLocPrf": 100,
 "localAS": 65001,
 "routes": { "172.16.16.254/32": [{"valid":true,"bestpath":true,"selectionReason":"Nothing left to compare","pathFrom":"external","prefix":"172.16.16.254","prefixLen":32,"network":"172.16.16.254\/32","version":2,"weight":0,"peerId":"192.168.1.2","path":"65002 65006","origin":"incomplete","nexthops":[{"ip":"192.168.1.2","hostname":"r2","afi":"ipv4","used":true}]},{"valid":true,"multipath":true,"pathFrom":"external","prefix":"172.16.16.254","prefixLen":32,"network":"172.16.16.254\/32","version":2,"weight":0,"peerId":"192.168.1.2","path":"65002 65005","origin":"incomplete","nexthops":[{"ip":"192.168.1.2","hostname":"r2","afi":"ipv4","used":true}]}]
 } , "totalRoutes": 1, "totalPaths": 2 }
```

Signed-off-by: Donatas Abraitis <[email protected]>
@ton31337 ton31337 marked this pull request as ready for review December 19, 2024 17:20
@Jafaral Jafaral merged commit f7fcc44 into FRRouting:master Dec 20, 2024
11 checks passed
@ton31337 ton31337 deleted the fix/bgp_show_advertised_routes_detail branch December 20, 2024 20:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bgp master size/L tests Topotests, make check, etc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants