diff options
| author | Christian Breunig <christian@breunig.cc> | 2026-10-07 19:56:51 +0200 |
|---|---|---|
| committer | Christian Breunig <christian@breunig.cc> | 2026-10-31 09:58:29 +0000 |
| commit | f5c844e8a6c2238555b8e519fe929a64e56b3388 (patch) | |
| tree | 4688ed6540ccc9e6d801fc87729b24f07d91f086 /src/system | |
| parent | 035d0260f65ad327c5a6a512a37157e96ca50fcf (diff) | |
| download | vyos-1x-f5c844e8a6c2238555b8e519fe929a64e56b3388.tar.gz vyos-1x-f5c844e8a6c2238555b8e519fe929a64e56b3388.zip | |
interfaces: T3871: warn about a replaced card when it is swapped, not only at boot
A card which takes over a slot also takes over the addresses configured under
that name. The boot script says so by reading the status file, but a card
swapped on a running system is only ever seen by the naming pass itself, and
by the next boot it is already on record with nothing left to report. The
warning could therefore never reach an operator who replaced a card without
rebooting. Log it where the decision is taken, which covers both.
Diffstat (limited to 'src/system')
| -rwxr-xr-x | src/system/vyos-net-name-resolve.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/system/vyos-net-name-resolve.py b/src/system/vyos-net-name-resolve.py index df1f10f72..aa0e74c74 100755 --- a/src/system/vyos-net-name-resolve.py +++ b/src/system/vyos-net-name-resolve.py @@ -198,6 +198,15 @@ def main(): for name, mac in sorted(report.get('bootstrapped', {}).items()): logger.info(f"new hardware {mac} named '{name}'") + + # A card which took over a slot also took over the addresses configured + # under that name. vyos-router says so for a boot, but a card swapped on + # a running system is only ever seen here. + for name, mac in sorted(report.get('replaced', {}).items()): + logger.warning( + f"'{name}' was matched to new hardware {mac} by slot - verify it " + 'is the port you expect before relying on its configuration' + ) applied = safe_bulk_rename(plan) persisted = save_store(store) |
