Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save mickert/af110cad23a8a38cbfdf4735884b4a5d to your computer and use it in GitHub Desktop.

Select an option

Save mickert/af110cad23a8a38cbfdf4735884b4a5d to your computer and use it in GitHub Desktop.
Comprehensive EdgeRouter recovery guide covering safe commit workflow, rollback mapping, SSH recovery mode, firmware rollback, TFTP/USB recovery, failsafe mode, and full config storage paths. Includes a model-by-model recovery matrix and official support links for all EdgeRouter devices and EdgeOS versions. Ideal for restoring broken configurati…

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.

EdgeOS Status SSH Recovery Recovery Matrix License 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.


TL;DR – Minimal Safe Workflow

configure
compare
commit-confirm 300
# test routing, services, access
confirm
save

Table of Contents


Safe Commit Flow

1. Enter configuration mode

configure

2. Review pending changes

compare

3. Apply changes safely (auto-rollback timer)

commit-confirm 300

If you lose access, the router automatically restores the previous config after 300 seconds.

4. Test connectivity, routing, services

5. Finalize the commit

confirm
save

6. If something breaks

Do nothing - the router will roll back automatically.


Rollback (Configuration History - Requires Reboot)

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

Inspect available rollback revisions

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 cli

Perform a rollback (requires reboot)

ubnt@edgerouter:~$ configure
[edit]
ubnt@edgerouter# rollback 2
Proceed with reboot? [confirm][y]

The router will reboot and load the selected configuration revision.


Enable automatic commit-revisions

configure
set system commit-revisions
commit
save

Manually save a revision

configure
save commit-revision "description"
exit

Manual Restore from Archive Ring Buffer (No Reboot Required)

EdgeOS 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
save

This 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

Rollback (Firmware Level)

Use when:

  • Routing is broken
  • SSH and GUI are unreachable
  • Services fail to start
  • Config is corrupted
  • Session rollback fails

Steps

show system image
set system image default-boot <image>
reboot

This restores both firmware and its associated config snapshot.


Recovery Decision Flow (Quick Guide)

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 (IPv6 Link-Local Access)

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

How it works

  • The router listens on port 60257 via 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

Steps to connect

  1. Connect your PC directly to the EdgeRouter’s LAN port
  2. Boot the EdgeRouter and immediately scan for its IPv6 link-local address
    Example (Linux/macOS):
    ping6 -c 1 ff02::1%eth0
  3. Connect via SSH using the link-local address and port 60257
    Example:
    ssh -p 60257 ubnt@fe80::aabb:ccff:fedd:ee99%eth0
  4. Once connected, you can rollback or load a backup:
    configure
    rollback 1
    commit
    save

Limitations

  • 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

Alternative: Console Access (Serial / Rollover Cable)

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.


Recovery Options Matrix

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          |

Legend

  • 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

Where EdgeOS Stores Config & Rollback Files

These filesystem paths apply to all EdgeRouter models and EdgeOS versions.

Active Boot Configuration

/config/config.boot

Rollback Snapshots (Ring Buffer)

/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

Important distinction

  • 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

Installer Artifacts

/config/archive/config.boot-prerollback
/config/archive/config.boot-rollback

Not used by the rollback command.

User Backups

/config/backup/*.conf

Firmware Images

/boot/

Contains kernel, initrd, and system image metadata.

USB Recovery (Cavium/Octeon models)

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.

TFTP Recovery

Bootloader loads firmware into RAM before flashing.


Product Support Links (Official)

Official EdgeRouter Support:
https://help.uisp.com/hc/en-us/sections/22589717213591-EdgeRouter


Recommended Tools & Hardware

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.

1. USB Drive (for Recovery & Replacement Storage)

  • 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.

2. Console / Rollover Cable (for Bootloader Access)

  • 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.

3. USB-to-Serial Adapter (if your PC has no serial port)


Print This Guide & Prepare Ahead

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.


Quick Access QR Code

Scan this QR code to open the latest version of this guide on your phone or tablet:

                                   
  █▀▀▀▀▀█  ▄▄▀██▄▄ ▀▀ █▄▀▀ █▀▀▀▀█  
  █ ███ █ █▀▀ ▀▀█▄▄▀ █▀▄▀█ █ ██ █  
  █ ▀▀▀ █ █▄▀█▀ █▄█▀▀  ▄▀▄ █ ▀▀ █  
  ▀▀▀▀▀▀▀ █ ▀ ▀ ▄▀ █ ▀▄▀▄▀ ▀▀▀▀▀▀  
  ▀ ██▀█▀▄ ▀██▀▀▀▀▀▄██▄▀▄  ██▀█ ▄  
  ▀▄▀▀▀▄▀ █  ██ ▀▄▀█▄ ▄▀ ▀▄  █▄█   
  ▀▀ ▀ ▄▀▄ ▄▀█▀ █▄▀▀▄▀ ▄▄▀▄▄▀▀█▄▄  
  ▀███ ▄▄  ███▀  ▀▄▀▄▄▀█▀▀█▀██▄ ▄  
   ▄▀  ▄▄▀▄█▀█▄▄▄█ ▀▀██▄▀  ▀█▄▀▄▀  
   ▄▀█ ▄▄  ▄▀▀ ▀█ ▄▀ █▀ ▀█▀▀▀██▀▀  
  █▀▀▄▄ ▄▄█▀▀ ▄▀█  ▀▀▄▄▀▀ █▀▀  ▄▀  
  █ █▄ █▄▄▄▀ ▄  █▀▄  ▀▀█▀████▄▄ █  
  ▄▄▄▄▄▄▄ ▀ ▄▀▀▀▄█ ▄▀█▀▄██ ▄ █ ▄▀  
  █ ▄▄▄ █ █▄ ▄▀  ▀▄▄█▄▀▀▀█▄▄▄██    
  █ ▀▀▀ █ ▀ ▀▄▄▄▄█ ▄█ ██▀▀▀▄ █▄▀▀  
  ▀▀▀▀▀▀▀ ▀▀    ▀ ▀▀   ▀▀▀  ▀  ▀   
                                   

Sources & Documentation

Deze sectie bundelt alle officiële documentatie, CLI-referenties, recovery guides en modelinformatie die in deze Gist worden aangehaald.

EdgeOS Configuration & CLI

Recovery & Bootloader

Model Documentation

Filesystem & Config Storage

General


Hey visitor - Mick here 👋

If this Gist helped you avoid a lockout, recover a broken config, or improve your workflow, I’d love it if you:

Your support helps me create more tools, templates, and deep-dives like this.
Happy routing!


NOTICE

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

License – Apache 2.0

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


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment