Repository navigation
Interfaces - #77
Open
djothi wants to merge 7 commits into
Open
Interfaces#77djothi wants to merge 7 commits into
djothi wants to merge 7 commits into
Conversation
Put the -rf flag before the operand: BSD rm (macOS) rejects options placed after the first operand.
…face extensions Generate openconfig-if-ip (which pulls openconfig-interfaces, openconfig-if-ethernet and openconfig-vlan) so that interfaces, subinterfaces, addresses and VLANs can be emitted. Add afk-interfaces-ext, the AFK augmentations for SONiC configuration OpenConfig has no leaf for: management flag, use-ipv6-link-local-only, alias, lanes, port index, forced-routes, neighbor-name/neighbor-port, and the FEC_AUTO / FEC_RS fec-mode identities. Bump criteo-oc-deviations to 0.2.0 to prune the openconfig-if-ip subtrees AFK does not generate (VRRP, static neighbors, IPv6 router advertisements). Run the generator with -trimpath so that the generated headers no longer embed the local Go module cache path.
Decode the device_type and role references of the NetBox device inventory, which identify the port layout of a device. NetBox exposes the role as "role" since 3.6 and as "device_role" before: both are accepted through RoleID().
…s and links Add the models and ingestors of the Network CMDB interface objects: - device interfaces (/api/plugins/cmdb/device-interfaces/): the physical interfaces of a device with their Ethernet attributes; - logical interfaces (/api/plugins/cmdb/logical-interfaces/): the L1/L2/L3 units of a device interface with addresses, VRF and VLANs. They are filtered through their parent interface, hence the prefixed datacenter filter; - port layouts (/api/plugins/cmdb/port-layouts/): the front-panel ports of a hardware model in a network role, with their NOS names and ASIC lanes. They are precomputed per (device type, role), not per device; - links (/api/plugins/cmdb/links/): point-to-point links between device interfaces, precomputed as the neighbor table of each device with the remote port resolved through the remote device port layout.
Convert the device and logical interfaces of a device to /interfaces/interface/: - front-panel ports are renamed to the vendor name of their port layout entry and carry its alias, lanes and, for AFK managed devices, the port index derived from the port short name; - the Ethernet attributes (speed, FEC, autonegotiation) are mapped to the OpenConfig identities, auto and rs using the afk-interfaces-ext ones; - logical interfaces become subinterfaces with their IPv4/IPv6 addresses (loopbacks exposed as host prefixes), VRF binding, 802.1Q mode and VLANs, and use-ipv6-link-local-only; - the remote end of each link is emitted as neighbor-name/neighbor-port; - eth0 is flagged as the management interface. The network instance bindings of the subinterfaces are returned alongside the interfaces so that the caller can attach them to their VRF.
…on pipeline Fetch the device interfaces, logical interfaces, port layouts, links and management routes from the CMDB alongside the existing ingestors, precompute them per device (port layouts per hardware model and network role, resolved per device through the inventory) and convert them in the per-device configuration generation: - /interfaces/interface/ is filled from InterfacesToOpenconfig; - the subinterfaces bound to a VRF create or complete the matching network instance, typed as L3VRF; - the management routing table is generated from the CMDB management routes: the static default route becomes a STATIC protocol instance of the network instance the management subinterface is bound to, with the subinterface as interface-ref, and forced routes are emitted on the IPv4 container of the management subinterface (afk-interfaces-ext forced-routes). Devices without management routes are the normal case (not SONiC). ingestorNumber grows from 7 to 13: 5 new ingestors here, plus the NTP one that was added without bumping it.
arn-alt
approved these changes
Oct 15, 2026
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.
Generate interface configuration from the CMDB
This PR adds interfaces to the generated OpenConfig device config. That covers physical and logical interfaces, IP addressing, VRF bindings and management static routes.
What's included
openconfig-interfacesandopenconfig-if-ip, plus a newafk-interfaces-extmodule. The new module holds the SONiC settings OpenConfig has no field for: alias, lanes, index, management, IPv6 link-local only, forced routes, the remote end of each link, and theFEC_AUTO/FEC_RSFECmodes.
criteo-oc-deviationsdrops theif-ipsubtrees we never generate (VRRP, static neighbors, IPv6 router advertisements). The ygot models are regenerated.internal/convertor/interfacespackage converts:openconfig-interfaces. Port names come from the port layout, and the remote end of each link is filled in.L3VRF.Housekeeping
update_yang_models.sh: fixes the order of therm -rfarguments, and passes-trimpathso local paths don't end up in the generated files.