11.4.2.7 Lab - Managing Device Configuration Files
11.4.2.7 Lab - Managing Device Configuration Files
11.4.2.7 Lab - Managing Device Configuration Files
Lab Ma
anaging
g Device
e Configuration Files Us
sing TFT
TP, Flas
sh
a
and USB
B
T
Topology
F0/5
G0/1
S1
1
R1
TFTP
T
TFTP
Cllient
Clien
TFTP
P Server
t
P
PCA
A
Addressing
g Table
Device
Interface
IP Ad
ddress
Subnet Mas
sk
Default Gateway
R1
G0/1
G
192.168
8.1.1
25
55.255.255.0
0
N/A
S1
VLAN
V
1
192.168
8.1.11
25
55.255.255.0
0
192.168.1.1
PC
C-A
NIC
N
192.168
8.1.3
25
55.255.255.0
0
192.168.1.1
O
Objectives
Part 1: Bu
uild the Netw
work and Con
nfigure Basic
c Device Setttings
Part 2: (O
Optional) Dow
wnload TFTP
P Server Softtware
Part 3: Us
se TFTP to Back
B
Up and Restore the Switch Run ning Configu
uration
Part 4: Us
se TFTP to Back
B
Up and Restore the Router Runn
ning Configu
uration
Part 5: Ba
ack Up and Restore
R
Running Configu
urations Usin
ng Router Fllash Memory
y
Part 6: (O
Optional) Use
e a USB Drive to Back Up
p and Restorre the Runnin
ng Configura
ation
B
Backgroun
nd / Scenarrio
Cisco netw
working devic
ces are often upgraded or swapped outt for a numberr of reasons. It is importan
nt to
maintain backups
b
of the latest devic
ce configuratio
ons, as well a
as a history off configuration changes. A TFTP
server is often
o
used to backup configuration files and IOS ima
ages in producction networkks. A TFTP se
erver is a
centralize
ed and secure
e method used
d to store the backup copie
es of the filess and restore them as nece
essary.
Using a ce
entralized TFTP server, yo
ou can back up
u files from m
many different Cisco devicces.
In addition
n to a TFTP server,
s
most of
o the current Cisco routerss can back up
p and restore files locally frrom
memory module that has rreplaced
CompactF
Flash (CF) me
emory or a US
SB flash drive
e. The CF is a removable m
the limited
d internal flash memory of earlier routerr models. The
e IOS image ffor the router resides in the
e CF
memory, and
a the route
er uses this IO
OS Image for the boot proccess. With the
e larger size o
of the CF mem
mory,
additional files can be stored
s
for bac
ckup purpose
es. A removab
ble USB flash
h drive can alsso be used fo
or backup
purposes..
In this lab
b, you will use TFTP serverr software to back
b
up the C
Cisco device rrunning config
guration to the TFTP
server or flash memory
y. You can ed
dit the file usin
ng a text edito
or and copy th
he new config
guration backk to a
vice.
Cisco dev
P
Page 1 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
Note: The routers used with CCNA hands-on labs are Cisco 1941 ISRs with Cisco IOS Release 15.2(4)M3
(universalk9 image). The switches used are Cisco Catalyst 2960s with Cisco IOS Release 15.0(2) (lanbasek9
image). Other routers, switches and Cisco IOS versions can be used. Depending on the model and Cisco IOS
version, the commands available and output produced might vary from what is shown in the labs. Refer to the
Router Interface Summary table at the end of the lab for the correct interface identifiers.
Note: Make sure that the routers and switches have been erased and have no startup configurations. If you
are unsure contact your instructor.
Required Resources
1 Router (Cisco 1941 with Cisco IOS software, release 15.2(4)M3 universal image or comparable)
1 Switch (Cisco 2960 with Cisco IOS Release 15.0(2) lanbasek9 image or comparable)
1 PC (Windows 7, Vista, or XP with terminal emulation program, such as Tera Term, and a TFTP server)
Console cables to configure the Cisco IOS devices via the console ports
d. Configure the passwords and allow login for console and vty lines using the cisco as the password.
e. Configure the default gateway for the switch.
f.
g. Configure the IP address, subnet mask, and default gateway for PC-A.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 2 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
Note: Downloading a TFTP server from a website requires Internet access.
If a TFTP server is not found, a TFTP server can be downloaded from the Internet.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 3 of 14
L
Lab Managing Device Configuration
C
n Files Using
g TFTP, Flash
h and USB
c.
Click Browse to ch
hoose a direc
ctory where yo
ou have write
e permission, such as C:\Users\User1, o
or the
Deskttop.
S
Step 3: Explore the co
opy comma
and on a Cis
sco device.
a. Conso
ole into switch
h S1 and, from
m the privileg
ged EXEC mo
ode prompt, e
enter copy ? tto display the
e options
for so
ource or from
m location and
d other availa
able copy optio
ons. You can
n specify flash
h: or flash0: as the
sourc
ce, however, iff you simply provide
p
a filen
name as the ssource, flash0: is assumed and is the d
default.
Note that
t
running--config is als
so an option fo
or the source location.
S1# copy
c
?
/er
rase
/er
rror
/no
overify
/ve
erify
arc
chive:
cns
s:
fla
ash0:
fla
ash1:
fla
ash:
ftp
p:
htt
tp:
htt
tps:
nul
ll:
nvr
ram:
rcp
p:
run
nning-config
g
scp
p:
sta
artup-config
g
sys
stem:
tar
r:
Erase de
estination file
f
system
m.
Allow to
o copy error
r file.
Don't ve
erify image signature before relo
oad.
Verify image
i
signat
ture before
e reload.
Copy fro
om archive: file syste
em
Copy fro
om cns: file
e system
Copy fro
om flash0: file
f
system
m
Copy fro
om flash1: file
f
system
m
Copy fro
om flash: fi
ile system
Copy fro
om ftp: file
e system
Copy fro
om http: fil
le system
Copy fro
om https: fi
ile system
Copy fro
om null: fil
le system
Copy fro
om nvram: fi
ile system
Copy fro
om rcp: file
e system
Copy fro
om current system
s
conf
figuration
Copy fro
om scp: file
e system
Copy fro
om startup configurati
c
ion
Copy fro
om system: file
f
system
m
Copy fro
om tar: file
e system
P
Page 4 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
tftp:
tmpsys:
xmodem:
ymodem:
Copy
Copy
Copy
Copy
from
from
from
from
b. Use the ? to display the destination options after a source file location is chosen. The flash: file system
for S1 is the source file system in this example.
S1# copy flash: ?
archive:
flash0:
flash1:
flash:
ftp:
http:
https:
idconf
null:
nvram:
rcp:
running-config
scp:
startup-config
syslog:
system:
tftp:
tmpsys:
xmodem:
ymodem:
Step 4: Transfer the running-config file from switch S1 to TFTP server on PC-A.
a. From the privileged EXEC mode on the switch, enter the copy running-config tftp: command. Provide
the remote host address of the TFTP server (PC-A), 192.168.1.3. Press Enter to accept default
destination filename (s1-confg) or provide your own filename. The exclamation marks (!!) indicate the
transfer process is in progress and is successful.
S1# copy running-config tftp:
Address or name of remote host []? 192.168.1.3
Destination filename [s1-confg]?
!!
1465 bytes copied in 0.663 secs (2210 bytes/sec)
S1#
The TFTP server also displays the progress during the transfer.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 5 of 14
L
Lab Managing Device Configuration
C
n Files Using
g TFTP, Flash
h and USB
You can
c change th
he current dire
ectory in TFTP server by cclicking Brows
se and choossing a differen
nt folder.
Note: Other issues
s, such as a fiirewall blockin
ng TFTP trafffic, can prevent the TFTP ttransfer. Plea
ase check
with your
y
instructorr for further as
ssistance.
b. In the
e Tftpd32 serv
ver window, click Show Dir to verify tha
at the s1-con
nfg file has be
een transferre
ed to your
curren
nt directory. Click
C
Close when
w
finished.
P
Page 6 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
c.
F70D0101 05050030
6E65642D 43657274
D2C59E23 102EC12E
35B38D90 E6F07CD4
0AF27EDC 6D6FA0E5
Save this file as a plain text file with a new filename, Switch1-confg.txt, in this example.
Note: When saving the file, an extension, such as .txt, may be added to the filename automatically.
d. In the Tftpd32 server window, click Show Dir to verify that the Switch1-confg.txt file is located in the
current directory.
Step 6: Upload running configuration file from TFTP server to switch S1.
a. From the privileged EXEC mode on the switch, enter the copy tftp running-config command. Provide
the remote host address of the TFTP server, 192.168.1.3. Enter the new filename, Switch1-confg.txt.
The exclamation mark (!) indicates the transfer process is in progress and is successful.
S1# copy tftp: running-config
Address or name of remote host []? 192.168.1.3
Source filename []? Switch1-confg.txt
Destination filename [running-config]?
Accessing tftp://192.168.1.3/Switch1-confg.txt...
Loading Switch1-confg.txt from 192.168.1.3 (via Vlan1): !
[OK - 1580 bytes]
[OK]
1580 bytes copied in 9.118 secs (173 bytes/sec)
*Mar 1 00:21:16.242: %PKI-4-NOAUTOSAVE: Configuration was modified.
memory" to save new certificate
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Issue "write
Page 7 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
*Mar 1 00:21:16.251: %SYS-5-CONFIG_I: Configured from tftp://192.168.1.3/Switch1confg.txt by console
Switch1#
After the transfer has completed, the prompt has changed from S1 to Switch1, because the running
configuration is updated with the hostname Switch1 command in the modified running configuration.
b. Enter the show running-config command to examine running configuration file.
Switch1# show running-config
Building configuration...
Current configuration : 3062 bytes
!
! Last configuration change at 00:09:34 UTC Mon Mar 1 1993
!
version 15.0
no service pad
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Switch1
!
boot-start-marker
boot-end-marker
<output omitted>
Note: This procedure merges the running-config from the TFTP server with the current running-config in
the switch or router. If changes were made to the current running-config, the commands in the TFTP copy
are added. Alternatively, if the same command is issued, it updates the corresponding command in the
switch or router current running-config.
If you want to completely replace the current running-config with the one from the TFTP server, you must
erase the switch startup-config and reload the device. You will then need to configure the VLAN 1
management address, so there is IP connectivity between the TFTP server and the switch.
Step 2: Transfer the running configuration from router R1 to TFTP server on PC-A.
a. From the privileged EXEC mode on R1, enter the copy running-config tftp command. Provide the
remote host address of the TFTP server, 192.168.1.3, and accept the default filename.
b. Verify that the file has been transferred to the TFTP server.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 8 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
Size(b)
260153344
262136
-
Free(b)
64499712
242776
-
Type
opaque
opaque
opaque
opaque
network
disk
disk
nvram
opaque
opaque
opaque
network
network
network
network
opaque
Flags
rw
rw
rw
rw
rw
rw
rw
rw
wo
rw
rw
rw
rw
rw
rw
ro
Prefixes
archive:
system:
tmpsys:
null:
tftp:
flash0: flash:#
flash1:
nvram:
syslog:
xmodem:
ymodem:
rcp:
http:
ftp:
scp:
tar:
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 9 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
-
network
opaque
rw
ro
https:
cns:
b. Use dir command to verify the running-config has been copied to flash.
R1# dir flash:
Directory of flash0:/
1 drw0
<output omitted>
20 -rw67998028
4.M3.bin
22 -rw2169
24 -rw5865
25 -rw6458
ipsdir
c1900-universalk9-mz.SPA.152R1-running-config-backup
lpnat
lpIPSec
c.
Use the more command to view the running-config file in flash memory. Examine the file output and scroll
to the Interface section. Notice the no shutdown command is not included with the GigabitEthernet0/1.
The interface is shut down when this file is used to update the running configuration on the router.
R1# more flash:R1-running-config-backup
<output omitted>
interface GigabitEthernet0/1
ip address 192.168.1.1 255.255.255.0
duplex auto
speed auto
<output omitted>
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 10 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
b. Copy the saved running-config file from flash to update the running-config.
Router# copy flash:R1-running-config-backup running-config
c.
Use the show ip interface brief command to view the status of the interfaces. The interface
GigabitEthernet0/1 was not enabled when the running configuration was updated, because it is
administratively down.
R1# show ip interface brief
Interface
Embedded-Service-Engine0/0
GigabitEthernet0/0
GigabitEthernet0/1
Serial0/0/0
Serial0/0/1
IP-Address
unassigned
unassigned
192.168.1.1
unassigned
unassigned
OK?
YES
YES
YES
YES
YES
Method
unset
unset
TFTP
unset
unset
Status
administratively
administratively
administratively
administratively
administratively
down
down
down
down
down
Protocol
down
down
down
down
down
The interface can be enabled using the no shutdown command in the interface configuration mode on
the router.
Another option is to add the no shutdown command for the GigabitEthernet0/1 interface to the saved file
before updating the router running configuration file. This will be done in Part 6 using a saved file on a
USB flash drive.
Note: Because the IP address was configured by using a file transfer, TFTP is listed under the Method
heading in the show ip interface brief output.
Part 6: (Optional) Use a USB Drive to Back Up and Restore the Running
Configuration
A USB flash drive can be used to backup and restore files on a router with an available USB port. Two USB
ports are available on the 1941 routers.
Note: USB ports are not available on all routers, but you should still become familiar with the commands.
Note: Because some ISR G1 routers (1841, 2801, or 2811) use File Allocation Table (FAT) file systems, there
is a maximum size limit for the USB flash drives that can be used in this part of the lab. The recommended
maximum size for an ISR G1 is 4 GB. If you receive the following message, the file system on the USB flash
drive may be incompatible with the router or the capacity of the USB flash drive may have exceed maximum
size of the FAT file system on the router.
*Feb 8 13:51:34.831: %USBFLASH-4-FORMAT: usbflash0 contains unexpected values in
partition table or boot sector. Device needs formatting before use!
Step 1: Insert a USB flash drive into a USB port on the router.
Notice the message on the terminal when inserting the USB flash drive.
R1#
* *Feb
Free(b)
-
Type
opaque
opaque
opaque
Flags
rw
rw
rw
Prefixes
archive:
system:
tmpsys:
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 11 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
260153344
262136
7728881664
64512000
244676
7703973888
opaque
network
disk
disk
nvram
opaque
opaque
opaque
network
network
network
network
opaque
network
opaque
usbflash
rw
rw
rw
rw
rw
wo
rw
rw
rw
rw
rw
rw
ro
rw
ro
rw
null:
tftp:
flash0: flash:#
flash1:
nvram:
syslog:
xmodem:
ymodem:
rcp:
http:
ftp:
scp:
tar:
https:
cns:
usbflash0:
Step 3: Copy the running configuration file to the USB flash drive.
Use the copy command to copy the running configuration file to the USB flash drive.
R1# copy running-config usbflash0:
Destination filename [running-config]? R1-running-config-backup.txt
2198 bytes copied in 0.708 secs (3105 bytes/sec)
-rw-rw-rw-rw-rw-rw-
16216
2462
24810439
71
65327
2198
Nov 15
May 26
Apr 16
Jun 4
Mar 11
Feb 5
2006
2006
2010
2010
2008
2013
09:34:04
21:33:40
10:28:00
11:23:06
10:54:26
21:36:40
+00:00
+00:00
+00:00
+00:00
+00:00
+00:00
ConditionsFR.txt
Nlm.ico
Twice.exe
AUTORUN.INF
ConditionsEN.txt
R1-running-config-backup.txt
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 12 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
c.
Modify the file using a text editor. The no shutdown command is added to the GigabitEthernet0/1
interface. Save the file as a plain text file on to the USB flash drive.
!
interface GigabitEthernet0/1
ip address 192.168.1.1 255.255.255.0
no shutdown
duplex auto
speed auto
!
-rw-rw-rw-rw-rw-rw-
16216
2462
24810439
71
65327
2344
Nov 15
May 26
Apr 16
Jun 4
Mar 11
Feb 6
2006
2006
2010
2010
2008
2013
09:34:04
21:33:40
10:28:00
11:23:06
10:54:26
14:42:30
+00:00
+00:00
+00:00
+00:00
+00:00
+00:00
ConditionsFR.txt
Nlm.ico
Twice.exe
AUTORUN.INF
ConditionsEN.txt
R1-running-config-backup.txt
c.
IP-Address
unassigned
unassigned
192.168.1.1
unassigned
unassigned
OK?
YES
YES
YES
YES
YES
Method
unset
unset
TFTP
unset
unset
Status
administratively
administratively
up
administratively
administratively
Protocol
down down
down down
up
down down
down down
The G0/1 interface is enabled because the modified running configuration included the no shutdown
command.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 13 of 14
Lab Managing Device Configuration Files Using TFTP, Flash and USB
Reflection
1. What command do you use to copy a file from the flash to a USB drive?
copy flash:filename usbflash0:
2. What command do you use to copy a file from the USB flash drive to a TFTP server?
copy usbflash0:filename tftp:
Ethernet Interface #1
Ethernet Interface #2
Serial Interface #1
Serial Interface #2
1800
1900
2801
2811
2900
Note: To find out how the router is configured, look at the interfaces to identify the type of router and how many
interfaces the router has. There is no way to effectively list all the combinations of configurations for each router
class. This table includes identifiers for the possible combinations of Ethernet and Serial interfaces in the device.
The table does not include any other type of interface, even though a specific router may contain one. An
example of this might be an ISDN BRI interface. The string in parenthesis is the legal abbreviation that can be
used in Cisco IOS commands to represent the interface.
2013 Cisco and/or its affiliates. All rights reserved. This document is Cisco Public.
Page 14 of 14