summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2026-10-28 22:17:13 +0100
committerChristian Breunig <christian@breunig.cc>2026-10-31 09:58:29 +0000
commit6bef88ed9c11210855689bd78a39ee032fb27731 (patch)
treed8dc8dcd6ec3b0cdb6be1e3704ebaeb209d83439 /python
parent015663a3188727e2a16900cf5496c931770979a2 (diff)
downloadvyos-1x-6bef88ed9c11210855689bd78a39ee032fb27731.tar.gz
vyos-1x-6bef88ed9c11210855689bd78a39ee032fb27731.zip
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.
Diffstat (limited to 'python')
-rw-r--r--python/vyos/ifconfig/ifname_store.py6
1 files changed, 6 insertions, 0 deletions
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'
)