You are about to edit the tunnel that carries your own session, so the work that saves you happens before the change, not during the scramble after it. The safety net is not on the VPN page: it is the restore screen, a console, or a second path that does not run through the device you are editing. I plan all three on the same router interface I am about to edit, and I use the path once while everything still works. This is the walkthrough I follow, in order.

Walk the restore flow before you need it

Open the page that would undo your change. On pfSense that is Diagnostics > Backup & Restore; on OpenWrt it is System > Backup / Flash Firmware; on OPNsense it is System > Configuration > Backups, which also keeps previous revisions you can revert to without a file. You are not restoring anything yet. You are checking whether that page opens from the path you will have during the change, whether it wants a reboot afterwards, and whether it rejects an archive written by a different firmware release. Netgate documents its own export and restore flow at docs.netgate.com.

A restore swaps the whole configuration, so it is not an undo for one rule. The archive carries users, certificates, VPN keys, firewall rules, and the admin interface settings that decide who may log in. That is why I export immediately before the change and name the file with the date and the single setting I intend to touch. Restoring a month-old file also restores a month-old tunnel and a month-old key.

If the platform only loads archives from the same release, note it now: a firmware upgrade plus a VPN edit in one window leaves you holding a file the router will not accept.

Prove a way in that skips the tunnel

A second SSH session from the same laptop to the same public address is not a second path; both die together. The independent path is one of these: a serial or KVM console, a hypervisor or cloud console, a management VLAN reachable from a host that is not behind the tunnel, a second WAN or LTE modem with its own administrative rule, or a person on site.

Test the chosen path while the router is healthy. Log in over it, open the VPN page, and stop before saving. If a lock-down rule only lets it reach the dashboard, you still have time to fix that, and the correction has to sit above the deny rule in the rule order.

Most routers bind the admin service to an interface or an address family, so an out-of-band route has to arrive where that service listens. Widening the binding for the window does work, but it is itself a change to the path you depend on.

Export the file and write the trigger

Move the export off the router and off the machine that might lose its tunnel. A backup stored on the router filesystem disappears in exactly the failure you are planning for, and one sitting on the laptop that is about to lose connectivity is barely better.

Treat that file as a credential. It holds private keys, preshared secrets, certificate material, and password hashes, so encrypt it or store it with the same care as the router login.

Then write one sentence: if I cannot open a new management session from PATH within N minutes of the change, I restore FILE and reboot. The sentence forces the scope down to one variable. Route, DNS, and firewall edits committed together are quick to save and slow to bisect when you get one more attempt.

Use a commit timer where the platform has one

Several platforms will undo the change for you if you fail to confirm it. RouterOS Safe Mode, entered with Ctrl+X in a terminal, reverts the changes made in that session when the session drops. Junos rolls back an unconfirmed commit confirmed. Cisco IOS pairs reload in with reload cancel. Enterprise firewalls commonly stage pending changes with an auto-revert timer. OpenWrt and most consumer firmware have nothing equivalent, so there the timer has to be external: a scheduled restore, a cron job that swaps a file back and restarts the service, or a reboot into the previous configuration.

Do not assume a similarly named feature covers the same scope. One product's auto-revert may cover only firewall rules; another may cover the entire configuration, including the management rule you just changed to keep yourself reachable. Read what the timer reverts before you rely on it.

A timer is no substitute for an exported file. It fails in the case that matters most here: the session survives, the management plane does not, and nothing ever triggers the revert.

Test a brand-new connection, not the open one

An established session often keeps working through changes that block every new handshake, because its state already exists and policy is evaluated when a connection is created. After the change, create new connections from the remote side: a fresh SSH session, a fresh VPN handshake from a client, a normal page load to the router LAN address.

# run these from the remote machine, in a new shell
ssh -o ConnectTimeout=8 admin@"$ROUTER_WAN"
nc -vz "$ROUTER_WAN" 443
dig +short example.internal "@$ROUTER_LAN"

Then test downstream of the tunnel rather than the tunnel itself: name resolution, a TCP connection to an internal service, and the application you actually use. A tunnel that establishes but hands out no usable DNS looks healthy in the client status and broken in the browser, and that difference decides whether you restore the file or fix one rule.

Repeat after a forced disconnect and reconnect, and once more after a reboot if the platform reapplies state at boot. Some configurations pass every live test and fail on the first boot with the new rules in place.

Close the doors you opened for the window

Remove the temporary any-source admin rule, the throwaway account, the widened binding, the permissive DNS rule, and the debug logging. That removal is itself a change on the path you depend on, so rerun the fresh-connection test after it, from the remote side.

Keep the exported file until the change has survived a reboot and a real client reconnect, then rotate anything you shared while the window was open. A configuration that works until the next boot is a quiet way to lose a router a week later, when nobody remembers which rule was temporary.

Write the change down where the next person looks: what moved, which file undoes it, which path reaches the console, and which rule was temporary.

Before you open the VPN page, four things must exist: a restore flow you have tested, a second path you have proven, an exported file you can actually reach, and a written trigger. If any one is missing, fix that first. The change can wait an hour; a lockout cannot.

Artiglyn mynjee