From 6bef88ed9c11210855689bd78a39ee032fb27731 Mon Sep 17 00:00:00 2001 From: Christian Breunig Date: Wed, 28 Oct 2026 22:17:13 +0100 Subject: interfaces: T3871: keep the address policy the distribution ships Only the first matching link file is applied, and ours sets just the name, so the address policy shipped with the system never ran on any interface. Hardware with a permanent address was unaffected - there was nothing to apply - but a modem, which has none, was left on whatever random address its driver had picked that boot, a different one every time. Spell the policy out again. A permanent address is still kept where there is one, and a device without one is given an address derived from the machine and the device, which is the same on every boot of that machine. An address set through the CLI is applied later and is unaffected. --- python/vyos/ifconfig/ifname_store.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'python') diff --git a/python/vyos/ifconfig/ifname_store.py b/python/vyos/ifconfig/ifname_store.py index e9c204e6c..b527c7348 100644 --- a/python/vyos/ifconfig/ifname_store.py +++ b/python/vyos/ifconfig/ifname_store.py @@ -628,6 +628,11 @@ def render_link(name: str, key: str, driver: str = '') -> str: A MAC is not unique to one interface: an accelerated-networking VF carries its NIC's MAC, and matched the NIC's file - udev then tried to give the VF the NIC's name. The driver tells them apart. + + Only the first matching file is applied, so this one shadows the address + policy the distribution ships. Spell it out again, or a device with no + permanent address - a modem - is left on the random one its driver gave + it, which is a different address on every boot. """ match_driver = f'Driver={driver}\n' if driver else '' return ( @@ -640,6 +645,7 @@ def render_link(name: str, key: str, driver: str = '') -> str: '\n' '[Link]\n' f'Name={name}\n' + 'MACAddressPolicy=persistent\n' ) -- cgit v1.2.3