Conversation
ofrzeta
marked this pull request as draft
September 17, 2026 05:32
Allow a BGPPeer to name an Interface instead of a peer address, so an eBGP session can run over the peers' IPv6 link-local addresses and the transit link needs no addressing of its own. The referenced Interface must set spec.ipv6.useLinkLocalOnly. spec.address becomes optional and is mutually exclusive with the new spec.interfaceRef; spec.localAddress is meaningless for such a peer. Both rules are enforced by CEL and by the webhook. A peer's identity, its address, interfaceRef or bgpRef, is immutable, as the finalizer only knows the current identity and would leave the previous peer behind on the device. spec.asNumber accepts the sentinel "external" for dynamic AS discovery, which only applies to interface-based peers. On NX-OS the peer maps to a PeerIf object under peerif-items, keyed by the interface name. The device reports an empty asn with asnType external, which the omitempty payload matches, so reconciliation stays idempotent. The device-level interface name is recorded in status.peerInterface, so the finalizer can still remove the peer after its Interface was deleted. The openconfig and iosxr providers reject interfaceRef as unsupported and skip the deletion of such peers as they were never configured on the device. The BGPPeer controller now watches Interfaces through a field index covering both interface references, so a peer converges as soon as its Interface appears instead of waiting for the periodic requeue. The NX-OS interface address items are replaced instead of merged, so addresses removed from the spec, such as global addresses when switching to link-local only, are removed from the device. As a gNMI Set applies replace before update operations, they are sent in a separate Set after the interface itself has been created. Signed-off-by: Oliver Frommel <oliver.frommel@bwi.de>
ofrzeta
force-pushed
the
support-unnumbered-bgp-peering
branch
from
September 17, 2026 12:36
731e5b3 to
fea40a3
Compare
ofrzeta
marked this pull request as ready for review
September 17, 2026 12:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Allow a BGPPeer to name an Interface instead of a peer address, so an eBGP session can run over the peers' IPv6 link-local addresses and the transit link needs no addressing of its own. The referenced Interface must set spec.ipv6.useLinkLocalOnly.
spec.address becomes optional and is mutually exclusive with the new spec.interfaceRef; spec.localAddress is meaningless for such a peer. Both rules are enforced by CEL and by the webhook.
spec.asNumber accepts the sentinel "external" for dynamic AS discovery, which only applies to interface-based peers.
On NX-OS the peer maps to a PeerIf object under peerif-items, keyed by the interface name. The device reports an empty asn with asnType external, which the omitempty payload matches, so reconciliation stays idempotent. The openconfig and iosxr providers reject interfaceRef as unsupported.
The BGPPeer controller now watches Interfaces through a field index covering both interface references, so a peer converges as soon as its Interface appears instead of waiting for the periodic requeue.