Skip to content

Include bgp remote peer capabilities in the sysdump #40719

Merged
joestringer merged 3 commits intocilium:mainfrom
liyihuang:pr/liyihuang/include_bgp_peer_capabilities
Aug 19, 2025
Merged

Include bgp remote peer capabilities in the sysdump #40719
joestringer merged 3 commits intocilium:mainfrom
liyihuang:pr/liyihuang/include_bgp_peer_capabilities

Conversation

@liyihuang
Copy link
Copy Markdown
Contributor

@liyihuang liyihuang commented Jul 25, 2025

  • Get the remote bgp peer capabilities from GoBGP and change the API so cilium-dbg can get it from agent
  • new flag --caps for cilium-dbg bgp peers to print out remote BGP peer capabilities
  • Include cilium-dbg bgp peers --caps in the bugtool so cilium-sysdump can collect it
  • new flag --caps for cilium bgp peers to print out remote BGP peer capabilities with cilium-cli.

cilium-dbg output

k exec -it ds/cilium -n kube-system -- cilium-dbg bgp peers --caps
BGP neighbor is fd00:10::1, remote AS 65000
  Neighbor capabilities:
    route-refresh
    add-path:
         ipv4-unicast:   receive
         ipv6-unicast:   receive

    fqdn: name: router0, domain:
    long-lived-graceful-restart:
        ipv4-unicast, restart time 0 sec, forward flag set
        ipv6-unicast, restart time 0 sec, forward flag set

    multiprotocol: ipv4-unicast
    multiprotocol: ipv6-unicast
    cisco-route-refresh
    enhanced-route-refresh
    4-octet-as
    UnknownCapability(6)
    graceful-restart:
        restart flag set, notification flag set

Cilium CLI output

cilium bgp peers --caps
Node: bgpv2-cplane-dev-service-control-plane
BGP neighbor is fd00:10::1, remote AS 65000
  Neighbor capabilities:
    multiprotocol: ipv4-unicast
    multiprotocol: ipv6-unicast
    cisco-route-refresh
    enhanced-route-refresh
    4-octet-as
    UnknownCapability(6)
    graceful-restart:
        restart flag set, notification flag set

    route-refresh
    add-path:
         ipv4-unicast:  receive
         ipv6-unicast:  receive

    fqdn: name: router0, domain:
    long-lived-graceful-restart:
        ipv4-unicast, restart time 0 sec, forward flag set
        ipv6-unicast, restart time 0 sec, forward flag set

Node: bgpv2-cplane-dev-service-worker
BGP neighbor is fd00:10::1, remote AS 65000
  Neighbor capabilities:
    cisco-route-refresh
    enhanced-route-refresh
    add-path:
         ipv4-unicast:  receive
         ipv6-unicast:  receive

    graceful-restart:
        restart flag set, notification flag set

    long-lived-graceful-restart:
        ipv4-unicast, restart time 0 sec, forward flag set
        ipv6-unicast, restart time 0 sec, forward flag set

    route-refresh
    4-octet-as
    UnknownCapability(6)
    fqdn: name: router0, domain:
    multiprotocol: ipv4-unicast
    multiprotocol: ipv6-unicast

Fixes: #30785

Include bgp remote peer capabilities in the sysdump 

@liyihuang liyihuang added release-note/misc This PR makes changes that have no direct user impact. area/bgp Impacts the Border Gateway Protocol feature. labels Jul 25, 2025
@github-actions github-actions bot added the cilium-cli This PR contains changes related with cilium-cli label Jul 25, 2025
@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch 3 times, most recently from 59fea50 to b5e54ff Compare July 25, 2025 20:25
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

@liyihuang liyihuang marked this pull request as ready for review July 25, 2025 23:59
@liyihuang liyihuang requested review from a team as code owners July 25, 2025 23:59
Copy link
Copy Markdown
Contributor

@harsimran-pabla harsimran-pabla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @liyihuang for this change. I also suggest adding advertised capabilities, as they are equally important for troubleshooting.

harsimran-pabla

This comment was marked as duplicate.

@liyihuang
Copy link
Copy Markdown
Contributor Author

@harsimran-pabla
I know I still have some unresolved comments, and I can address them all in my next commit, including any new comments you might add.

btw here is the output where I followed and used more codes from gobgp client.

Cilium node: bgpv2-cplane-dev-service-control-plane
BGP neighbor is fd00:10::1, remote AS 65000
Neighbor capabilities:
        multiprotocol:
                ipv4-unicast: advertised and received
                ipv6-unicast: advertised and received
        route-refresh: advertised and received
        extended-nexthop: advertised
                Local:
                        nlri: ipv4-unicast, nexthop: ipv6
        UnknownCapability(6): received
        graceful-restart: advertised and received
                Local:
                        Restart time: 15 sec, notification flag set
                        ipv4-unicast
                        ipv6-unicast
                Remote:
                        notification flag set
        4-octet-as: advertised and received
        add-path: received
                Remote:
                        ipv4-unicast: receive
                        ipv6-unicast: receive
        enhanced-route-refresh: received
        long-lived-graceful-restart: received
                Remote:
                        ipv4-unicast, restart time 0 sec, forward flag set
                        ipv6-unicast, restart time 0 sec, forward flag set

        fqdn: advertised and received
                Local:
                        name: bgpv2-cplane-dev-service-control-plane
                        domain:
                Remote:
                        name: router0
                        domain:
        cisco-route-refresh: received
Cilium node: bgpv2-cplane-dev-service-worker
BGP neighbor is fd00:10::1, remote AS 65000
Neighbor capabilities:
        multiprotocol:
                ipv4-unicast: advertised and received
                ipv6-unicast: advertised and received
        route-refresh: advertised and received
        extended-nexthop: advertised
                Local:
                        nlri: ipv4-unicast, nexthop: ipv6
        UnknownCapability(6): received
        graceful-restart: advertised and received
                Local:
                        Restart time: 15 sec, notification flag set
                        ipv4-unicast
                        ipv6-unicast
                Remote:
                        notification flag set
        4-octet-as: advertised and received
        add-path: received
                Remote:
                        ipv4-unicast: receive
                        ipv6-unicast: receive
        enhanced-route-refresh: received
        long-lived-graceful-restart: received
                Remote:
                        ipv4-unicast, restart time 0 sec, forward flag set
                        ipv6-unicast, restart time 0 sec, forward flag set

        fqdn: advertised and received
                Local:
                        name: bgpv2-cplane-dev-service-worker
                        domain:
                Remote:
                        name: router0
                        domain:
        cisco-route-refresh: received

Copy link
Copy Markdown
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyihuang Nice work! I think this could be cleaned up a bit...

@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch from b5e54ff to 8660097 Compare August 1, 2025 19:35
This commit add the new BgpCapabilities, local-capabilities
remote-capabilities in the API and use make generate-api to
reflect the change.

It also reads the local and remote capability from gobgp server
and pass it to agent so it can be query by client-dbg later.

Signed-off-by: Liyi Huang <liyi.huang@isovalent.com>
@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch 2 times, most recently from 1854d76 to c5feb58 Compare August 1, 2025 21:36
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch from c5feb58 to 2eb63c5 Compare August 6, 2025 17:57
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch from 2eb63c5 to 2a8f16f Compare August 6, 2025 18:13
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

Copy link
Copy Markdown
Contributor

@derailed derailed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@liyihuang Thanks for the updates Liyi!

Copy link
Copy Markdown
Contributor

@harsimran-pabla harsimran-pabla left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @liyihuang Change looks good 🚀

@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 14, 2025
@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch 2 times, most recently from 2377d67 to bfeaf83 Compare August 14, 2025 19:25
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

Copy link
Copy Markdown
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a few comments from a CLI perspective.

@joestringer joestringer removed the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 19, 2025
@maintainer-s-little-helper maintainer-s-little-helper bot added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Aug 19, 2025
This commit introduces a new flag to the BGP peers command to optionally display detailed capabilities of BGP peers.
I referred to and used a lot of code from GoBGP to implement the printer from the following link
https://github.com/osrg/gobgp/blob/master/cmd/gobgp/neighbor.go#L357-L499

update the bugtool config so cilium sysdump can collect the peer's capabilities

Signed-off-by: Liyi Huang <liyi.huang@isovalent.com>
…m CLI

Add new parameters in cilium CLI to print all peer capabilities for
whole cluster.

Signed-off-by: Liyi Huang <liyi.huang@isovalent.com>
@liyihuang liyihuang force-pushed the pr/liyihuang/include_bgp_peer_capabilities branch from bfeaf83 to fd730aa Compare August 19, 2025 19:24
@liyihuang
Copy link
Copy Markdown
Contributor Author

/test

@joestringer joestringer added this pull request to the merge queue Aug 19, 2025
Merged via the queue into cilium:main with commit 27d8676 Aug 19, 2025
68 checks passed
@liyihuang liyihuang deleted the pr/liyihuang/include_bgp_peer_capabilities branch September 19, 2025 14:10
zocimek added a commit to zocimek/home-ops that referenced this pull request Oct 1, 2025
… ) (#222)

This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
|
[aqua:cilium/cilium-cli](https://redirect.github.com/cilium/cilium-cli)
| patch | `0.18.6` -> `0.18.7` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>cilium/cilium-cli (aqua:cilium/cilium-cli)</summary>

###
[`v0.18.7`](https://redirect.github.com/cilium/cilium-cli/releases/tag/v0.18.7)

[Compare
Source](https://redirect.github.com/cilium/cilium-cli/compare/v0.18.6...v0.18.7)

#### What's Changed

## Summary of Changes

**Minor Changes:**

- clustermesh: cli: accept more than one service IPs (excluding when
connecting to NodePort Services) when connecting to remote
clustermesh-apiserver
([cilium/cilium#41253](https://redirect.github.com/cilium/cilium/issues/41253),
[@&#8203;MrFreezeex](https://redirect.github.com/MrFreezeex))
- clustermesh: cli: add support for dict for helm values
`clustermesh.config.clusters`
([cilium/cilium#40879](https://redirect.github.com/cilium/cilium/issues/40879),
[@&#8203;MrFreezeex](https://redirect.github.com/MrFreezeex))
- clustermesh: cli: support outputting `clustermesh.config.clusters` to
the new dict format if the cluster is running Cilium >= 1.20
([cilium/cilium#40959](https://redirect.github.com/cilium/cilium/issues/40959),
[@&#8203;MrFreezeex](https://redirect.github.com/MrFreezeex))

**Bugfixes:**

- Add l7 proxy check to policy-local-cluster-egress connectivity test
([cilium/cilium#40797](https://redirect.github.com/cilium/cilium/issues/40797),
[@&#8203;camrynl](https://redirect.github.com/camrynl))
- cilium-cli: also restart cilium-operator pods on config changes
([cilium/cilium#41067](https://redirect.github.com/cilium/cilium/issues/41067),
[@&#8203;aanm](https://redirect.github.com/aanm))

**CI Changes:**

- Allow Egress Gateway connectivity tests to run concurrently
([cilium/cilium#40980](https://redirect.github.com/cilium/cilium/issues/40980),
[@&#8203;tommyp1ckles](https://redirect.github.com/tommyp1ckles))
- cilium-cli: connectivity tests: Ignore some logs in error log check
([cilium/cilium#40690](https://redirect.github.com/cilium/cilium/issues/40690),
[@&#8203;jrife](https://redirect.github.com/jrife))
- cilium-cli: IPv6 connectivity tests for PodToIngress
([cilium/cilium#39667](https://redirect.github.com/cilium/cilium/issues/39667),
[@&#8203;gentoo-root](https://redirect.github.com/gentoo-root))

**Misc Changes:**

- chore(deps): update all-dependencies (main)
([cilium/cilium#40893](https://redirect.github.com/cilium/cilium/issues/40893),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- chore(deps): update all-dependencies (main)
([cilium/cilium#41046](https://redirect.github.com/cilium/cilium/issues/41046),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- chore(deps): update all-dependencies (main)
([cilium/cilium#41340](https://redirect.github.com/cilium/cilium/issues/41340),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- chore(deps): update all-dependencies (main)
([cilium/cilium#41433](https://redirect.github.com/cilium/cilium/issues/41433),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- chore(deps): update docker.io/library/golang:1.25.0 docker digest to
[`5502b0e`](https://redirect.github.com/cilium/cilium-cli/commit/5502b0e)
(main)
([cilium/cilium#41343](https://redirect.github.com/cilium/cilium/issues/41343),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- chore(deps): update go to v1.24.6 (main)
([cilium/cilium#40992](https://redirect.github.com/cilium/cilium/issues/40992),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- cilium-cli: Optimized feature detection by running cluster-wide checks
once
([cilium/cilium#40715](https://redirect.github.com/cilium/cilium/issues/40715),
[@&#8203;HadrienPatte](https://redirect.github.com/HadrienPatte))
- Include bgp remote peer capabilities in the sysdump
([cilium/cilium#40719](https://redirect.github.com/cilium/cilium/issues/40719),
[@&#8203;liyihuang](https://redirect.github.com/liyihuang))
- Update all-dependencies (main)
([cilium/cilium#41175](https://redirect.github.com/cilium/cilium/issues/41175),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- Update docker.io/alpine/socat:1.8.0.3 Docker digest to
[`29d0f24`](https://redirect.github.com/cilium/cilium-cli/commit/29d0f24)
(main)
([cilium/cilium#41204](https://redirect.github.com/cilium/cilium/issues/41204),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- Update Go to v1.25.0 (main)
([cilium/cilium#41209](https://redirect.github.com/cilium/cilium/issues/41209),
[@&#8203;cilium-renovate](https://redirect.github.com/cilium-renovate)\[bot])
- Update stable release to v0.18.6 by
[@&#8203;tklauser](https://redirect.github.com/tklauser) in
[#&#8203;3075](https://redirect.github.com/cilium/cilium-cli/pull/3075)
- chore(deps): update golangci/golangci-lint docker tag to v2.3.1 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3076](https://redirect.github.com/cilium/cilium-cli/pull/3076)
- chore(deps): update golang docker tag to v1.24.6 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3079](https://redirect.github.com/cilium/cilium-cli/pull/3079)
- chore(deps): update gcr.io/distroless/static:latest docker digest to
[`2e114d2`](https://redirect.github.com/cilium/cilium-cli/commit/2e114d2)
by [@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3077](https://redirect.github.com/cilium/cilium-cli/pull/3077)
- chore(deps): update docker/login-action action to v3.5.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3078](https://redirect.github.com/cilium/cilium-cli/pull/3078)
- chore(deps): update go to v1.24.6 (patch) by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3080](https://redirect.github.com/cilium/cilium-cli/pull/3080)
- chore(deps): update actions/checkout action to v5 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3082](https://redirect.github.com/cilium/cilium-cli/pull/3082)
- chore(deps): update golangci/golangci-lint docker tag to v2.4.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3086](https://redirect.github.com/cilium/cilium-cli/pull/3086)
- chore(deps): update golang docker tag to v1.25.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3085](https://redirect.github.com/cilium/cilium-cli/pull/3085)
- chore(deps): update go to v1.25.0 (minor) by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3088](https://redirect.github.com/cilium/cilium-cli/pull/3088)
- chore(deps): update dependency cilium/cilium to v1.18.1 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3089](https://redirect.github.com/cilium/cilium-cli/pull/3089)
- chore(deps): update dependency kubernetes-sigs/kind to v0.30.0 by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3091](https://redirect.github.com/cilium/cilium-cli/pull/3091)
- chore(deps): update golang-images - autoclosed by
[@&#8203;renovate](https://redirect.github.com/renovate)\[bot] in
[#&#8203;3090](https://redirect.github.com/cilium/cilium-cli/pull/3090)
- Prepare for v0.18.7 release by
[@&#8203;michi-covalent](https://redirect.github.com/michi-covalent) in
[#&#8203;3092](https://redirect.github.com/cilium/cilium-cli/pull/3092)

**Full Changelog**:
<cilium/cilium-cli@v0.18.6...v0.18.7>

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS45NS4wIiwidXBkYXRlZEluVmVyIjoiNDEuMTMyLjUiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbInR5cGUvcGF0Y2giXX0=-->

Co-authored-by: zocimek-renovate[bot] <134739422+zocimek-renovate[bot]@users.noreply.github.com>
Co-authored-by: Łukasz Pospiech <zocimek@users.noreply.github.com>
@cilium-release-bot cilium-release-bot bot moved this to Released in cilium v1.19.0 Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bgp Impacts the Border Gateway Protocol feature. cilium-cli This PR contains changes related with cilium-cli ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact.

Projects

No open projects
Status: Released

Development

Successfully merging this pull request may close these issues.

CFP: Include BGP peer capabilities into sysdump

6 participants