Interfaces backup & restart

Network~4 minView script

Four utilities that revolve around /etc/network/interfaces: take a manual snapshot, view the live config, restore a previous backup with optional preview, and restart the networking service with explicit consent. Same backup directory used by the guided repair flows.

What this does

Manages the same backup directory used by the guided repair flows (/var/backups/proxmenux/). Lets you take an extra snapshot before any manual change, browse all existing backups, and roll back to any of them — always with a fresh pre-restore backup taken automatically as a second safety net.

The shared backup directory

Every backup taken anywhere in the Network menu lands in the same place:

/var/backups/proxmenux/
├── interfaces_backup_2026-04-26_14-30-12   ← from a guided repair
├── interfaces_backup_2026-04-26_15-08-44   ← from "Create Network Backup" (this page)
├── interfaces_backup_2026-04-26_18-22-09   ← auto-taken before a restore
└── …

Filenames are timestamped, sorted by date, and never overwritten. The directory is created on first use.

Show Network Config File

Prints /etc/network/interfaces verbatim to the terminal. Read-only. Useful as a sanity check before taking a backup or after a restore — there is no separate "diff with previous backup" tool, so eyeballing the live file is the easiest way to confirm what you have.

Create Network Backup

Copies the current /etc/network/interfaces into the backup directory with a fresh timestamp. That's it — no analysis, no prompts, just a snapshot.

When to take a manual backup

Before editing /etc/network/interfaces by hand, before installing a package that may touch the network stack (e.g. NetworkManager, Open vSwitch), or before any hardware change. The guided repairs already snapshot automatically — this option is for the manual moments.

Restore Network Backup

Lists every backup in /var/backups/proxmenux/ sorted from newest to oldest, and walks through a guarded restore:

1. Pick a backup

A menu lists each backup by its timestamp. If no backups exist, the flow exits with a clear message.

2. Optional preview

Offers to open the selected backup in a scrollable view before committing. Yes by default — do not skip it on a remote host.

3. Pre-restore backup

Before overwriting /etc/network/interfaces, takes another backup of the current state. Restoring a backup is itself a destructive action, so the new pre-restore snapshot lets you go back if the chosen backup turns out to be the wrong one.

4. Apply the restore

Copies the chosen backup over /etc/network/interfaces. The file change is on disk; the live kernel state still reflects the previous config.

5. Optional restart

Asks whether to run systemctl restart networking now. Decline to defer the change to the next reboot.

A restore takes its own backup automatically

Selecting Restore Network Backup always creates a fresh snapshot of the current config before overwriting it. If you restore to the wrong backup, the most recent file in /var/backups/proxmenux/ is the state you came from.

Restart Network Service

Runs systemctl restart networking after a yes/no confirmation. Reports the result with msg_ok / msg_error. Most flows in this menu offer their own restart prompt at the end; this option is for restarting after a manual edit or after declining the in-flow restart earlier.

Brief disconnection guaranteed; permanent disconnection possible

Restarting networking tears down and re-applies every interface declared in /etc/network/interfaces. SSH sessions hosted on those interfaces drop. If the new config is invalid, the network never comes back. Run this only when:
  • You have console / IPMI / iKVM access ready, or
  • You are physically next to the machine, or
  • You have just successfully rolled back to a known-good config and want to apply it.

Manual rollback from a console

If you cannot reach the menu (no SSH, dialog crashing, …) but can reach a console, rollback is two commands:

ls -lt /var/backups/proxmenux/interfaces_backup_*  # newest first
cp /var/backups/proxmenux/interfaces_backup_<TIMESTAMP> /etc/network/interfaces
systemctl restart networking

This is the same operation the menu performs, just typed by hand. If networking still fails to start, check journalctl -u networking -b for the underlying syntax / driver error.

Troubleshooting

"No backups found" in Restore

The directory /var/backups/proxmenux/ does not exist or contains no interfaces_backup_* files. Run Create Network Backup at least once, or run any guided repair (which auto-creates one). Confirm with ls /var/backups/proxmenux/.

Restart networking succeeds but the host is still unreachable

Either the new config is wrong, or you restarted into a configuration that does not bind your management IP. Roll back from the console (see above). After rollback, use bridge analysis and config analysis to understand what was wrong before re-applying.

Restore preview shows an empty file

The backup file is empty (0 bytes). This happens if a copy failed silently during a previous run. Pick an older backup, or re-run Create Network Backup right now if the live config is healthy.

Related