VyOS Configuration Reset Methods
Method 1: Reset to Default Config (Recommended)
# Enter configuration mode
configure
# Load the default configuration
load /opt/vyatta/etc/config.boot.default
# Review changes (optional)
compare
# Commit and save
commit
save
exit
# Reboot to ensure clean state
reboot
Method 2: Delete All Configuration
configure
# Delete everything and start fresh
delete interfaces
delete service
delete system
delete firewall
delete nat
delete qos
# Set minimal config to maintain access
set interfaces ethernet eth0 address 192.168.1.1/24
set system host-name vyos
set service ssh
commit
save
exit
Method 3: Rollback to Previous Config
configure
# Show available rollback points
rollback ?
# Rollback to previous commit (step back 1 change)
rollback 1
commit
save
# Or rollback multiple steps
rollback 5
commit
save
Method 4: Fresh Install Recovery
If you still have the installer ISO:
# Boot from ISO again
# Login with: vyos/vyos
# Reinstall (this WIPES everything)
install image
# Follow prompts, it will format and reinstall
Method 5: Manual Boot Config Restore
# VyOS keeps old configs automatically
ls -lh /config/config.boot*
# You'll see:
# config.boot (current)
# config.boot.0 (previous boot)
# config.boot.1 (2 boots ago)
# etc.
# Copy an old config
sudo cp /config/config.boot.1 /config/config.boot
# Reboot
reboot
Method 6: Complete Factory Reset (Nuclear Option)
# Login as vyos user
# Become root
sudo -i
# Remove all configuration
rm /config/config.boot
# Copy factory default
cp /opt/vyatta/etc/config.boot.default /config/config.boot
# Reboot
reboot
Method 7: Clear Specific Sections Only
configure
# Clear only NAT
delete nat
# Clear only firewall
delete firewall
# Clear only QoS
delete qos
# Clear only DHCP
delete service dhcp-server
# Clear specific interface
delete interfaces ethernet eth2
commit
save
Reset During Boot (Emergency)
If your config is broken and router won’t boot properly:
- At boot menu, you’ll see multiple config versions
- Arrow down to an older config version
- Press Enter to boot with that config
- Once booted:
configure
# Make fixes
commit
save
Quick Reset Script
Create a quick reset to “known good” state:
# Save your working config as baseline
save /config/baseline.config
# When you need to reset later
configure
load /config/baseline.config
commit
save
exit
Comparison Before Reset
Always check what you’re about to change:
configure
# Load the config you want
load /config/config.boot.default
# See what will change (RED = removed, GREEN = added)
compare
# If you like it
commit
save
# If you don't like it
exit discard
What Gets Reset
Full reset removes:
- ✅ All interfaces configurations
- ✅ All services (DHCP, DNS, SSH)
- ✅ All firewall rules
- ✅ All NAT rules
- ✅ All QoS policies
- ✅ System hostname, DNS, NTP
- ❌ Does NOT remove installed packages
- ❌ Does NOT remove system users
Emergency: Can’t Login After Bad Config
If you locked yourself out:
- Physical console access (keyboard + monitor)
- Login with
vyosuser and password - Fix or reset config:
configure
load /opt/vyatta/etc/config.boot.default
set interfaces ethernet eth0 address 192.168.1.1/24
set service ssh
commit
save
Recommended Safe Reset Procedure
# 1. Backup current config first!
save /config/backup-before-reset.config
# 2. Load default
configure
load /opt/vyatta/etc/config.boot.default
# 3. Review changes
compare
# 4. If satisfied, commit
commit
save
# 5. Reboot for clean state
exit
reboot
Quick Reference
| Action | Command |
|---|---|
| Rollback last change | rollback 1 then commit |
| Load factory default | load /opt/vyatta/etc/config.boot.default |
| Discard unsaved changes | exit discard |
| Boot with old config | Select at boot menu |
| Nuclear reset | sudo rm /config/config.boot + reboot |
Pro Tip: Always save /config/backup.config before making major changes so you have an easy rollback point!
Be First to Comment