From 22cfee116c9935f4a33da4923eff189f2f646371 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Thu, 6 Aug 2026 21:59:21 +0200 Subject: T3871: make boot-time interface naming deterministic and hw-id aware Multi-vendor PCIe NIC systems could lose or rename Ethernet/wireless interfaces on boot, because naming was decided from a single per-device udev event before all hardware had a chance to enumerate. Replace that with one authoritative pass, run once configuration is available during router startup: wait for configured hardware, apply every hw-id binding, and name whatever has none yet by PCIe distance from the root complex and MAC address - the same result every boot. A node with its hw-id deleted (NIC replacement) or its whole configuration removed is treated as an ordinary open slot, filled the same way - recovering its original hardware whenever the interfaces that vacated slots this boot also show up as candidates. Boot now reports any interface still unresolved, and the pass is covered by a new test suite in vyos-build named: make testifname Assisted-by: Claude:claude-sonnet-5 --- src/systemd/vyos-net-name-resolve.service | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/systemd/vyos-net-name-resolve.service (limited to 'src/systemd') diff --git a/src/systemd/vyos-net-name-resolve.service b/src/systemd/vyos-net-name-resolve.service new file mode 100644 index 000000000..ec7c45636 --- /dev/null +++ b/src/systemd/vyos-net-name-resolve.service @@ -0,0 +1,17 @@ +[Unit] +Description=VyOS deterministic hw-id based interface naming +Documentation=man:vyos-net-name-resolve.py(8) + +# Started explicitly by vyos-router (like frr.service/vyos-netlinkd.service) +# once /opt/vyatta/etc/config is mounted and config.boot exists - which, for +# an encrypted config volume, only happens after vyos-router has unlocked +# and mounted it. It cannot be ordered independently before vyos-router: +# there is no config.boot to read before that point. +DefaultDependencies=no + +[Service] +Type=oneshot +RemainAfterExit=yes +ExecStart=/usr/libexec/vyos/system/vyos-net-name-resolve.py +TimeoutStartSec=90 +StandardOutput=journal+console -- cgit v1.2.3