Hands-On Lab: Backing Up and Restoring Router Configuration Files

This hands-on lab backs up a router's running configuration to a TFTP server, deliberately makes an unwanted configuration change, and restores the router to its previous known-good state from the backup.

TFTP Configuration BackupConfiguration RestoreDisaster Recovery

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۱ مهر ۱۴۰۵

Lab Objective

Back up a router's current configuration to a TFTP server, make a deliberate unwanted change to the configuration, then restore the router to its previously backed-up state and verify the unwanted change is gone.

Lab Purpose

A configuration backup taken before a risky change is standard practice before any significant maintenance activity, providing a fast, reliable way to revert if something goes wrong rather than manually reconstructing a configuration from memory or scattered notes.

Lab Topology

R1 ---- Gi0/0: 192.168.85.1/24

TFTP server: 192.168.85.100/24

Task 1: Configure Basic Addressing

Configure R1's interface connecting to the TFTP server's segment.

Task 2: Back Up the Current Configuration

Copy R1's running configuration to the TFTP server.

Task 3: Make an Unwanted Configuration Change

Deliberately change R1's hostname and remove a loopback interface, simulating an unintended or mistaken configuration change.

Task 4: Verify the Unwanted State

Confirm the hostname has changed and the loopback interface is gone.

Task 5: Restore from the Backup

Copy the backed-up configuration from the TFTP server back onto R1.

Task 6: Verify the Restoration

Confirm the hostname and loopback interface match the original backed-up state.

Solution and Verification

R1(config)# interface gigabitethernet0/0
R1(config-if)# ip address 192.168.85.1 255.255.255.0
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface loopback0
R1(config-if)# ip address 10.99.1.1 255.255.255.255
R1(config-if)# exit
R1(config)# end

R1# copy running-config tftp:

Address or name of remote host []? 192.168.85.100
Destination filename [r1-confg]? R1-backup.txt

Writing R1-backup.txt !!
1284 bytes copied in 1.294 secs

R1(config)# hostname R1-BROKEN
R1-BROKEN(config)# no interface loopback0
R1-BROKEN(config)# end

R1-BROKEN# show ip interface brief | include Loopback
-- (no output -- loopback0 is gone)

R1-BROKEN# show running-config | include hostname
hostname R1-BROKEN

R1-BROKEN# copy tftp: running-config

Address or name of remote host []? 192.168.85.100
Source filename []? R1-backup.txt
Destination filename [running-config]?

Accessing tftp://192.168.85.100/R1-backup.txt...
Loading R1-backup.txt from 192.168.85.100
1284 bytes copied in 1.156 secs

R1# show running-config | include hostname
hostname R1
-- Hostname restored

R1# show ip interface brief | include Loopback
Loopback0    10.99.1.1    YES manual up    up
-- Loopback interface restored

Key Takeaway

Restoring from a backup with copy tftp: running-config merges the backup into the currently running configuration rather than fully replacing it — any configuration added after the backup was taken but not present in the backed-up file may still remain, so verifying the final state after a restore, as done here, is essential rather than assuming a restore perfectly recreates the exact backed-up state.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه