Support BGP sessions in VRF context (BGP VRF peering) #50
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The current schema models
BGPSessionexclusively underBGPRouterConfig(global BGP process). However, the reference topology includes BGP peerings within a VRF context, specifically:neighbor 10.90.90.1 remote-as 64999undervrf goldinrouter bgp 65004This is a common pattern in EVPN-VXLAN fabrics where border leafs peer with external routers (firewalls, WAN routers, etc.) inside a tenant VRF to inject routes (e.g. default route) that are then distributed across the EVPN overlay.
Current Limitation
BGPSessionis scoped underBGPRouterConfigwhich represents the global BGP process. There is no way to associate a BGP session with a specific VRF, making it impossible to model:Proposed Solution
Two approaches are possible:
Option A — Add optional
vrfrelation onBGPSessionRelationshipfromBGPSessiontoVRFConfig(optional, cardinality one)vrfis set, the session is rendered under the VRF block in the BGP configvrfis null, the session belongs to the global BGP process (current behavior)VRFConfigOption B — Create a
BGPVRFConfignodeBGPVRFConfigwith relations toVRFConfigandBGPRouterConfigBGPVRFConfigowns VRF-scoped BGP sessions, rd, route-targets, redistribute policiesBGPVRFConfigRecommendation
Option A is simpler and sufficient for the current topology. It can be evolved to Option B later if needed. The VRF-level BGP attributes (rd, route-target) are already on
VRFConfig/EVPNInstance, so only the session placement is missing.Reference Config (from overlaid.net topology)
Acceptance Criteria
infrahubctl schema checkRelated
feature/41-infrahub-schemaImplémenté ✅
Commit:
e32da46Changements dans
schemas/bgp.yml— BGPSessionvrf→InfraVRF(kind: Attribute, cardinality: one, optional: true)vrfest null : session dans le processus BGP global (comportement existant)vrfest défini : session dans le contexte VRF (ex: leaf7 → AS 64999 dans VRF gold)Option A retenue comme recommandé dans l'issue.
Validation
Schema check passé. Le peering border leaf7/8 → AS 64999 dans VRF gold est maintenant modélisable.