Skip to content

VyOS Configuration Reset Methods

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:

  1. At boot menu, you’ll see multiple config versions
  2. Arrow down to an older config version
  3. Press Enter to boot with that config
  4. 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:

  1. Physical console access (keyboard + monitor)
  2. Login with vyos user and password
  3. 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

ActionCommand
Rollback last changerollback 1 then commit
Load factory defaultload /opt/vyatta/etc/config.boot.default
Discard unsaved changesexit discard
Boot with old configSelect at boot menu
Nuclear resetsudo rm /config/config.boot + reboot

Pro Tip: Always save /config/backup.config before making major changes so you have an easy rollback point!

Published inUncategorized

Be First to Comment

Leave a Reply