Skip to main content
RunBook Academy

VyOSLV · Backup, Restore, Disaster RecoveryBackup

Saved configuration — /config/config.boot, scp, off-box copy, versioning

Foundation⏱ ~18 minvyosscpshow configurationcat /config/config.bootsavecompare

What you'll learn

  • Explain the difference between commit and save in VyOS 1.5 LTS
  • Read /config/config.boot and understand its structure
  • Copy the saved configuration off-box via scp
  • Maintain a version-controlled backup of the configuration in Git

Prerequisites

Verified against VyOS 1.5.x LTS (circinus) · VyOS 1.4.x (sagitta) — legacy · FRRouting 10.x (VyOS 1.5) · Linux kernel 6.6 LTS (VyOS 1.5 base) · strongSwan 5.9.x (IPsec) · WireGuard 1.0.x (kernel module + userspace tooling) · 2026-08-15

Not yet marked complete on this device.

Every VyOS router has three configurations: the candidate (in configure mode), the active (running) configuration, and the saved configuration on disk. The saved configuration is what survives a reboot; without it, the router boots with an empty configuration.

The saved configuration lives at /config/config.boot on the router’s persistent storage. The file is a plain-text representation of the configuration tree in VyOS config-file format. The file is written on save and read on boot.

This lesson covers the /config/config.boot file, the difference between commit and save, the off-box copy via scp, and the version-controlled backup that the operator maintains alongside the router’s local file.

Commit vs save

commit applies the candidate configuration to the running configuration. save writes the running configuration to /config/config.boot. Both commands are required for a change to survive reboot.

stateDiagram-v2
  [*] --> Empty: fresh install
  Empty --> Saved: install image\n--no-default-configuration
  Saved --> Candidate: configure
  Candidate --> Candidate: set / delete / edit
  Candidate --> Active: commit
  Candidate --> Empty: discard
  Active --> Saved: save
  Saved --> Active: reboot
  Active --> Candidate: configure

The diagram shows the three-configuration model. A change that is commit-ed but not save-d is in the running configuration; on reboot, the router loads /config/config.boot (the previous saved state), and the un-saved change is lost.

# Apply a change but do not save
configure
set interfaces ethernet eth0 address 192.0.2.50/24
commit
# (do not save)
exit

# Reboot — the change is lost
reboot

# Show running configuration
show interfaces ethernet eth0
# Address 192.0.2.50/24 is NOT present

The change was committed (it was in the running configuration while the router was up) but not saved. On reboot, the router reverts to the saved configuration, and the change is gone.

The defensive idiom: every change is followed by save. A change without save is a change that the next reboot will revert.

/config/config.boot

The saved configuration is at /config/config.boot. The file is a plain-text representation of the configuration tree in VyOS config-file format:

# /config/config.boot
interfaces {
    ethernet eth0 {
        address 192.0.2.50/24
        description "WAN"
        hw-id 00:0c:29:8e:4a:b1
    }
}
protocols {
    static {
        route 0.0.0.0/0 {
            next-hop 192.0.2.1
        }
    }
}
system {
    host-name edge-01
    login {
        user vyos {
            authentication {
                encrypted-password "..."
            }
        }
    }
    name-server 1.1.1.1
    name-server 8.8.8.8
    ntp {
        server 0.pool.ntp.org
    }
    syslog {
        host 10.99.0.100 {
            facility all
            level info
        }
    }
    time-zone UTC
}

The file format is hierarchical: each block is delimited by curly braces, each line is a key-value pair. Comments start with #. The format is human-readable and can be edited directly (though the operator should prefer the VyOS configuration tree to maintain validator invariants).

Off-box copy via scp

The operator copies the saved configuration off-box for backup. The standard mechanism is scp (or rsync for periodic copies):

# Copy /config/config.boot from the router to the operator's workstation
scp vyos@192.0.2.1:/config/config.boot ./edge-01-config.boot

# Or via SSH key-based authentication
scp -i ~/.ssh/edge-01_key vyos@192.0.2.1:/config/config.boot ./edge-01-config.boot

The off-box copy is the operator’s first line of defence against router loss. The local file on the router is vulnerable to disk failure, accidental deletion, or compromise; the off-box copy survives all three.

The defensive idiom: every save is followed by an off-box copy. The copy is automatic (via cron or the configuration-as-code pipeline) and is verified periodically.

Version-controlled backup

The off-box copy is version-controlled in Git. The operator commits the file to a Git repository after every save:

# Copy the saved configuration off-box
scp vyos@192.0.2.1:/config/config.boot ./configs/edge-01-config.boot

# Commit to Git
git add configs/edge-01-config.boot
git commit -m "edge-01: update BGP neighbour"
git push origin main

The Git repository is the operator’s primary backup. The repository has the full history of every configuration change; the operator can recover any previous state by checking out the corresponding commit.

flowchart LR
  ROUTER[Router\n/config/config.boot] -->|scp| OFFBOX[Off-box\nbackup file]
  OFFBOX -->|commit| GIT[Git repository\nfull history]
  GIT -->|checkout| RECOVER[Recovered\nconfiguration]

The diagram shows the backup chain: the router has the local file; the off-box copy is the immediate backup; the Git repository is the versioned history. The operator can recover any previous state from the Git repository.

Failure modes

Change not saved

The operator commits a change but does not save. The change is in the running configuration; on reboot, the change is lost.

Diagnostic: after reboot, the running configuration does not include the change.

Fix: re-apply the change, then save. The defensive idiom: commit followed immediately by save is one operation in the operator’s muscle memory.

Off-box copy not committed to Git

The operator copies the file off-box but does not commit to Git. The off-box copy is the only backup; the next copy overwrites it.

Diagnostic: the off-box file has the current state; the Git repository has the previous state.

Fix: commit the off-box copy to Git immediately. The defensive idiom: the off-box copy and the Git commit are one operation.

/config/config.boot corrupted

The router’s disk has a corruption (e.g. power loss during a write). The /config/config.boot file is partial or unreadable. The router boots in recovery mode.

Diagnostic: the router shows a recovery prompt; the configd process refuses to load the file.

Fix: restore from the Git repository. The defensive idiom: the Git repository has the previous configuration; the operator can copy it to /config/config.boot and reboot.

Rollback

The rollback mechanism is the Git repository: the operator checks out a previous commit and copies the file to /config/config.boot, or runs the configuration-as-code pipeline to apply the previous configuration.

The VyOS commit history (rollback N) is the router’s local rollback; the Git repository is the off-box rollback. Both should be in place.

Production discipline

Cross-course references

  • V-VyOS-ConfigModel (vyos-v-02-candidate-active-saved) covers the three-configuration model in detail.
  • LV-VyOS-Backup (vyos-lv-02-remote-backup, the next lesson) covers the remote backup mechanisms that complement the off-box copy.
  • LIV-VyOS-Automation (vyos-liv-03-config-as-code) covers the configuration-as-code pipeline that integrates with the Git backup.

Quiz

Knowledge check · 4 questions

  1. Q1. What is the difference between `commit` and `save` on VyOS 1.5 LTS?

  2. Q2. A configuration change that is committed but not saved is lost when the router reboots.

  3. Q3. An operator makes a change to edge-01 and commits it. The operator forgets to save. The router reboots 24 hours later for an unrelated reason. The change is gone. The operator is asked to recover the change. What is happening and what is the fix?

    An operator commits a change to edge-01 but forgets to save. The router reboots 24 hours later for an unrelated reason. The change is gone.

  4. Q4. An operator copies /config/config.boot off-box via scp but does not commit it to Git. The next day, a new change is made; the operator copies the new /config/config.boot off-box, overwriting the previous off-box file. The previous off-box file is gone. The operator needs to recover the previous configuration but cannot — only the current configuration is in the off-box copy. What is the discipline failure?

    An operator copies /config/config.boot off-box via scp but does not commit it to Git. The next day's copy overwrites the previous off-box file. The previous off-box file is gone.

Passing score: 75%. Answers are checked in this browser.