Complete EdgeRouter recovery guide covering safe commit workflow, rollback mapping, SSH recovery, firmware rollback, TFTP/USB recovery, failsafe mode, config storage paths, and a full model recovery matrix. Works for all EdgeRouter models and all EdgeOS versions.
Canonical URL:
https://gists.mickert.dev/af110cad23a8a38cbfdf4735884b4a5d#file-edgerouter-recovery-guide-safe-commit-rollback-ssh-tftp-usb-md
A production-safe recovery and configuration workflow for EdgeRouter devices running EdgeOS.
This guide helps prevent lockouts, miscommits, and routing failures by combining:
- Safe commit workflow (commit-confirm)
- Rollback mapping & archive structure
- SSH recovery mode
- Firmware rollback
- TFTP & USB recovery
- Failsafe mode (ER-X family)
- Filesystem-level config access
- Model-specific recovery matrix
This is the most complete EdgeRouter Recovery Reference available.
configure
compare
commit-confirm 300
# test routing, services, access
confirm
save- Safe Commit Flow
- Rollback (Configuration History - Requires Reboot)
- Manual Restore from Archive Ring Buffer (No Reboot Required)
- Rollback (Firmware Level)
- Recovery Decision Flow (Quick Guide)
- SSH Recovery (IPv6 Link-Local Access)
- Alternative: Console Access (Serial / Rollover Cable)
- Recovery Options Matrix
- Where EdgeOS Stores Config & Rollback Files
- Product Support Links (Official)
- Recommended Tools & Hardware
- Print This Guide & Prepare Ahead
- Quick Access QR Code
- Sources & Documentation
- Hey visitor – Mick here 👋
- Notice
- License – Apache 2.0
configurecomparecommit-confirm 300If you lose access, the router automatically restores the previous config after 300 seconds.
confirm
saveDo nothing - the router will roll back automatically.
EdgeOS stores configuration history as commit-revisions.
Rolling back to any previous revision always requires a reboot, regardless of EdgeOS version.
Rollback is used when:
- You still have console or SSH access
- A previous known-good config exists
- You accept that the router will reboot to apply it
Use rollback ? to list all available revisions:
ubnt@edgerouter:~$ configure
[edit]
ubnt@edgerouter# rollback ?
Possible completions:
<N> Rollback to revision N (currently requires reboot)
Revisions:
0 2026-01-27 18:56:33 ubnt by rollback/reboot
1 2026-01-26 21:00:51 ubnt by rollback/reboot
2 2026-01-26 20:43:48 ubnt by cli
3 2026-01-26 18:08:39 ubnt by cli
...
9 2026-01-26 17:14:48 ubnt by cliubnt@edgerouter:~$ configure
[edit]
ubnt@edgerouter# rollback 2
Proceed with reboot? [confirm][y]The router will reboot and load the selected configuration revision.
configure
set system commit-revisions
commit
saveconfigure
save commit-revision "description"
exitEdgeOS also keeps a ring buffer of compressed boot configurations in:
/config/archive/config.boot.0.gz ← most recent
/config/archive/config.boot.1.gz
...
/config/archive/config.boot.9.gz ← oldest
These files are not used by the rollback command.
You can manually load one without rebooting:
configure
load /config/archive/config.boot.0.gz
commit
saveThis is useful when:
- You want to restore a config without rebooting
- You know exactly which archived config you want
- You prefer manual control instead of commit-revisions
Use when:
- Routing is broken
- SSH and GUI are unreachable
- Services fail to start
- Config is corrupted
- Session rollback fails
show system image
set system image default-boot <image>
rebootThis restores both firmware and its associated config snapshot.
Recovery Decision Flow
┌──────────────────────────┐
│ Lost access to router? │
└──────────────┬───────────┘
Yes
│
┌───────────────▼────────────────┐
│ Can you still reach SSH/CLI? │
└───────────────┬────────────────┘
Yes
│
┌──────────▼───────────┐
│ Use Session Rollback│
│ rollback <n> │
└──────────────────────┘
No
│
┌───────────────▼────────────────┐
│ Is IPv6 available on client? │
│ (link-local SSH recovery) │
└───────────────┬────────────────┘
Yes
│
┌──────────▼───────────────┐
│ Use SSH Recovery (IPv6) │
│ ssh -p 60257 fe80::... │
└──────────────────────────┘
No
│
┌───────────────▼────────────────┐
│ Do you have a console cable? │
└───────────────┬────────────────┘
Yes
│
┌──────────▼───────────────┐
│ Use Console Access │
│ (bootloader, USB/TFTP) │
└──────────────────────────┘
No
│
┌───────────────▼─────────────────┐
│ Use Hardware Recovery Options │
│ - USB Recovery │
│ - TFTP Recovery │
│ - Failsafe Mode (ER‑X) │
└─────────────────────────────────┘
SSH Recovery provides emergency access to an EdgeRouter when normal login methods fail due to misconfiguration, firewall rules, or disabled services. It works by exposing a temporary SSH daemon on a link-local IPv6 address for 60 seconds after boot.
This method does not require a console cable, and works on all EdgeRouter models with EdgeOS v1.10.0+ and v2.0.0+.
This is often the fastest way to recover from:
- Firewall lockouts
- Interface misconfigurations
- Disabled SSH
- Broken routing
- Bad commits
- The router listens on port
60257via its link-local IPv6 address - The SSH daemon ignores the current config and uses system accounts (
ubnt,admin) - Access is only available for 60 seconds after boot
- Requires a direct Ethernet connection and IPv6 support on the client
- Connect your PC directly to the EdgeRouter’s LAN port
- Boot the EdgeRouter and immediately scan for its IPv6 link-local address
Example (Linux/macOS):ping6 -c 1 ff02::1%eth0
- Connect via SSH using the link-local address and port 60257
Example:ssh -p 60257 ubnt@fe80::aabb:ccff:fedd:ee99%eth0
- Once connected, you can rollback or load a backup:
configure rollback 1 commit save
- Access is read-only unless you explicitly enable config mode
- You must act quickly — the window is short
- Some OSes (especially Windows) may require extra steps to enable IPv6 link-local SSH
If SSH Recovery fails or IPv6 is unavailable, a direct serial console connection is the most reliable fallback.
This allows you to:
- Interrupt the bootloader
- Select firmware images
- Perform USB or TFTP recovery
- Repair broken configurations
Recommended cable:
DB9/RJ45 Console Rollover Cable (RS232 or USB)
This cable provides the correct Cisco-style rollover pinout used by EdgeRouter console ports (and any other industry standard RJ45/8P8C console port) and works with USB-to-serial adapters.
A complete overview of all recovery mechanisms across EdgeRouter models.
| Model Family | SSH Recovery | Session Rollback | Firmware Rollback | Dual-Boot | USB Recovery | TFTP Recovery | Failsafe Mode | Reset Button |
|---------------------|--------------|------------------|-------------------|-----------|--------------|---------------|---------------|--------------|
| ER-Lite / ER-Lite-3 | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |
| ER-4 | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |
| ER-6P | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |
| ER-12 | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |
| ER-Pro-8 | Yes | Yes | Yes | Yes | Yes | Yes | No | Yes |
| ER-X | Yes | Yes | No | No | No | Yes | Yes | Yes |
| ER-X-SFP | Yes | Yes | No | No | No | Yes | Yes | Yes |
| ER-10X | Yes | Yes | No | No | No | Yes | Yes | Yes |
- SSH Recovery - temporary SSH daemon ignoring config
- Session Rollback -
rollback <n> - Firmware Rollback -
set system image default-boot - Dual-Boot - two firmware partitions
- USB Recovery - boot from USB recovery image
- TFTP Recovery - bootloader-level firmware flashing
- Failsafe Mode - MediaTek emergency environment
- Reset Button - password reset / factory reset
These filesystem paths apply to all EdgeRouter models and EdgeOS versions.
/config/config.boot
/config/archive/config.boot.0.gz ← most recent
/config/archive/config.boot.1.gz
...
/config/archive/config.boot.9.gz ← oldest
Rollback mapping:
rollback 1 → config.boot.0.gz
rollback 2 → config.boot.1.gz
...
rollback 10 → config.boot.9.gz
rollback <n>uses commit-revisions in/config/config-revisions/and requires a reboot- Manual restore uses the archive ring buffer in
/config/archive/and does not require a reboot
/config/archive/config.boot-prerollback
/config/archive/config.boot-rollback
Not used by the rollback command.
/config/backup/*.conf
/boot/
Contains kernel, initrd, and system image metadata.
USB boot image:
/boot/ubnt_image
Recommended USB drive:
The Verbatim Metal Executive USB 2.0 (model 98749) can be used as a replacement storage device for the EdgeRouter Lite. USB 2.0 drives are recommended because many EdgeRouter bootloaders enumerate USB 3.0 devices too slowly, which can cause the recovery image or root filesystem to fail to load during boot.
Bootloader loads firmware into RAM before flashing.
- ER-Lite: https://ui.com/edgemax/edgerouter-lite
- ER-4: https://ui.com/edgemax/edgerouter-4
- ER-6P: https://ui.com/edgemax/edgerouter-6p
- ER-12: https://ui.com/edgemax/edgerouter-12
- ER-Pro-8: https://ui.com/edgemax/edgerouter-pro
- ER-X: https://ui.com/edgemax/edgerouter-x
- ER-X-SFP: https://ui.com/edgemax/edgerouter-x-sfp
- ER-10X: https://ui.com/edgemax/edgerouter-10x
Official EdgeRouter Support:
https://help.uisp.com/hc/en-us/sections/22589717213591-EdgeRouter
These items are strongly recommended to keep on hand for safe recovery, emergency access, and hardware-level repair of EdgeRouter devices.
Having these tools ready dramatically reduces downtime when something goes wrong.
- Verbatim Metal Executive USB 2.0 (model 98749)
https://amzn.to/4q3bVfC
Reliable for USB boot and recovery. USB 2.0 is recommended because many EdgeRouter bootloaders enumerate USB 3.0 devices too slowly, causing recovery images or root filesystems to fail to load.
- DB9/RJ45 Console Rollover Cable (RS232 or USB)
https://amzn.to/4qImIg5
Required for bootloader access, TFTP recovery, and deep-level troubleshooting.
Works with all industry-standard RJ45/8P8C console ports.
- FTDI-based USB-to-Serial Adapter
https://amzn.to/3M6IuLA
Fully compatible with Windows, macOS, and Linux.
If your EdgeRouter becomes inaccessible, you may not have internet access to look up recovery steps.
For that reason:
Print this guide and keep a USB 2.0 recovery stick and console cable nearby.
A failed internal USB drive or misconfiguration can happen at any time, and having these tools ready ensures you can recover your router quickly and safely.
Scan this QR code to open the latest version of this guide on your phone or tablet:
█▀▀▀▀▀█ ▄▄▀██▄▄ ▀▀ █▄▀▀ █▀▀▀▀█
█ ███ █ █▀▀ ▀▀█▄▄▀ █▀▄▀█ █ ██ █
█ ▀▀▀ █ █▄▀█▀ █▄█▀▀ ▄▀▄ █ ▀▀ █
▀▀▀▀▀▀▀ █ ▀ ▀ ▄▀ █ ▀▄▀▄▀ ▀▀▀▀▀▀
▀ ██▀█▀▄ ▀██▀▀▀▀▀▄██▄▀▄ ██▀█ ▄
▀▄▀▀▀▄▀ █ ██ ▀▄▀█▄ ▄▀ ▀▄ █▄█
▀▀ ▀ ▄▀▄ ▄▀█▀ █▄▀▀▄▀ ▄▄▀▄▄▀▀█▄▄
▀███ ▄▄ ███▀ ▀▄▀▄▄▀█▀▀█▀██▄ ▄
▄▀ ▄▄▀▄█▀█▄▄▄█ ▀▀██▄▀ ▀█▄▀▄▀
▄▀█ ▄▄ ▄▀▀ ▀█ ▄▀ █▀ ▀█▀▀▀██▀▀
█▀▀▄▄ ▄▄█▀▀ ▄▀█ ▀▀▄▄▀▀ █▀▀ ▄▀
█ █▄ █▄▄▄▀ ▄ █▀▄ ▀▀█▀████▄▄ █
▄▄▄▄▄▄▄ ▀ ▄▀▀▀▄█ ▄▀█▀▄██ ▄ █ ▄▀
█ ▄▄▄ █ █▄ ▄▀ ▀▄▄█▄▀▀▀█▄▄▄██
█ ▀▀▀ █ ▀ ▀▄▄▄▄█ ▄█ ██▀▀▀▄ █▄▀▀
▀▀▀▀▀▀▀ ▀▀ ▀ ▀▀ ▀▀▀ ▀ ▀
Deze sectie bundelt alle officiële documentatie, CLI-referenties, recovery guides en modelinformatie die in deze Gist worden aangehaald.
- EdgeOS CLI Primer (community reference)
- EdgeRouter / EdgeOS User Guide v1.9
- EdgeRouter / EdgeOS User Guide v1.8
- EdgeRouter - SSH Recovery
- EdgeRouter TFTP Recovery Guide
- EdgeRouter - Manual TFTP Recovery (Using Console cable / Rollover cable)
- EdgeRouter Failsafe Mode (ER-X)
- EdgeMax rescue kit (now you can reinstall EdgeOS from scratch) - UI Community
- Replacing Failed USB Flash on Ubiquiti EdgeRouter - Dipak's Docs Diary
- icarusglider - EdgeRouter-Recovery
- EdgeRouter - Archiving and Managing the Configuration Files
- Vyatta Core Documentation (EdgeOS upstream)
- The excellent Ubiquiti Subreddit
If this Gist helped you avoid a lockout, recover a broken config, or improve your workflow, I’d love it if you:
- ⭐ Starring the Gist
- 🔁 Sharing it with other EdgeRouter users
- 🛠 Contributing improvements
- 🕵️ Explore my GitHub projects and Gists and drop a ⭐ or follow
- ☕ Supporting my work:
https://support.mickert.dev/ / https://ko-fi.com/michelsprojects
Your support helps me create more tools, templates, and deep-dives like this.
Happy routing!
This project includes work authored by Michel Sijmons (https://mickert.dev).
Licensed under the Apache License, Version 2.0.
You must retain this NOTICE file when distributing or creating derivative works.
Canonical reference:
https://gists.mickert.dev/af110cad23a8a38cbfdf4735884b4a5d#file-edgerouter-recovery-guide-safe-commit-rollback-ssh-tftp-usb-md
This project is licensed under the Apache License, Version 2.0, a permissive open-source license that:
- Allows commercial use
- Allows modification and redistribution
- Allows closed-source integration
- Requires attribution
- Provides strong patent protection
- Requires inclusion of a NOTICE file
Full license text:
https://www.apache.org/licenses/LICENSE-2.0