Bridge analysis & guided repair
Audits every vmbrX bridge declared in /etc/network/interfaces, verifies that its physical ports actually exist, and offers a step-by-step repair when they don't. The analysis is read-only; the repair is gated, previewed and backed up.
What this does
/etc/network/interfaces, looks at its bridge-ports line and checks whether each declared port (e.g. enp3s0) actually exists on the host. If a port is missing, proposes a substitute and — with explicit consent — applies the change with a backup, preview, apply, verify flow.When you need this
Linux assigns predictable interface names from PCI topology and slot order. Several events shuffle them and leave /etc/network/interfaces referring to names that no longer exist:
- Adding or removing a PCIe card (a NIC, a GPU, a HBA, an NVMe carrier).
- Moving an existing card to a different PCIe slot.
- BIOS / UEFI updates that re-enumerate PCI devices.
- Migrating the boot disk to different hardware.
After the next boot, the bridge tries to attach to a port that no longer exists, fails to come up, and the host loses its network. Persistent interface names prevents this from happening again — but if you are already locked out, this page is the recovery path.
The big picture
Step 1: analysis (read-only)
Selecting Analyze Bridge Configuration aborts immediately if the host is not on the classic Debian/Proxmox stack. Otherwise it walks every bridge and reports:
- Bridge name, current status (UP / DOWN), assigned IP.
- Each declared port and whether it currently exists (
ip link show <port>). - For each invalid port: a proposed replacement (the first available physical interface) plus the exact
sedcommand to apply it manually. - Bridges with no
bridge-portsat all and orphanautoentries (no matchingifaceblock).
🔍 BRIDGE CONFIGURATION ANALYSIS ================================================== 🌉 Bridge: vmbr0 📍 Status: DOWN 🌐 IP: No IP assigned 🔌 Configured Ports: enp3s0 ❌ Port enp3s0: NOT FOUND 🔧 SUGGESTION FOR vmbr0: Replace invalid port(s) 'enp3s0' with: eno1 Command: sed -i 's/bridge-ports.*/bridge-ports eno1/' /etc/network/interfaces 📊 ANALYSIS SUMMARY ========================= Bridges analyzed: 1 Issues found: 1 Physical interfaces available: 2 ⚠️ IMPORTANT: No changes have been made to your system Use the Guided Repair option to fix issues safely
Read-only guarantee
sed commands and apply them manually if you prefer — or accept the next prompt to enter the guided repair.Step 2: guided repair (5 steps)
Only entered if you accept the prompt at the end of the analysis. Each step shows what will happen and asks for confirmation before continuing.
Copies /etc/network/interfaces to /var/backups/proxmenux/interfaces_backup_<TIMESTAMP>. The exact backup path is shown before the copy and again after, with the rollback command.
Opens the live /etc/network/interfaces in a scrollable dialog so you can see exactly what is about to be changed.
Lists exactly which bridges will be touched and which port substitutions will happen. If the analysis decides nothing actually needs fixing (race condition: the port came back), the flow exits cleanly with "No changes needed."
For each affected bridge, runs sed -i "/iface $bridge/,/bridge-ports/ s/bridge-ports.*/bridge-ports $new_ports/" against /etc/network/interfaces. If a bridge had no valid replacement available, the substitution is skipped and reported in step 5.
Re-reads the file and confirms each bridge's new port now exists. Prints the rollback command (cp <backup> /etc/network/interfaces). Finally offers a Restart networking prompt — accept only if you have console fallback.
Restarting networking ≠ a free undo
systemctl restart networking applies the change now, which can drop your SSH session if the new port is wrong. If you decline the restart, the change still takes effect on the next reboot — confirm the new config first or roll back from the printed command.What gets edited (exactly)
Only the bridge-ports line of each affected bridge. Other directives (address, netmask, gateway, bridge-stp, …) are left untouched. The script never creates new iface blocks and never removes existing ones in this flow — that is the job of Config analysis & cleanup.
Troubleshooting
Analysis aborts with "Unsupported Network Stack"
/etc/network/interfaces. Switch the host to the classic stack first, or edit the configuration with the manager's native tooling (e.g. netplan apply).No suggestion is printed for an invalid port
bridge-ports none so the bridge can at least come up without a port. Add a NIC or migrate ports between bridges manually before re-running.The repair completes but the bridge is still DOWN
sed updated the file but systemctl restart networking was declined. Run it manually once the new config is verified, or reboot. If the restart was accepted and the bridge is still DOWN, run ip link show to confirm the new port exists, then check journalctl -u networking for the actual error (cable unplugged, link not negotiated, port already a member of another bridge).I lost SSH access right after restarting networking
cp /var/backups/proxmenux/interfaces_backup_<TIMESTAMP> /etc/network/interfaces systemctl restart networkingThen re-run the analysis from the console to figure out why the suggestion did not work (typically: the replacement port is not actually plugged in).
Related
- Persistent interface names — pin names to MAC addresses so this scenario stops happening.
- Config analysis & guided cleanup — for orphaned
ifaceblocks (the other half of the same problem). - Interfaces backup & restart — manual snapshots and the restore browser.