Four ways to copy a file
| Protocol | Transport | Login | Encrypted |
|---|---|---|---|
| TFTP | UDP 69 | None | No |
| FTP | TCP 21 (control) + 20 (data) | User name and password, in clear text | No |
| SCP | TCP 22 (SSH) | SSH user | Yes |
| SFTP | TCP 22 (SSH) | SSH user | Yes |
TFTP is simple and needs nothing set up, which makes it handy in a lab, but anyone can read or overwrite files on the server. Use SCP or SFTP for real backups.
Back up the configuration
copy running-config tftp: asks for the server and a file name. copy running-config scp: also asks for the user and password:
In NetLab
▶ R1 R1>enable R1#copy running-config tftp: Address or name of remote host []? 10.1.1.50 Destination filename [r1-confg]? !! 625 bytes copied in 0.066 secs (9470 bytes/sec) R1#copy running-config scp: Address or name of remote host []? 10.1.1.50 Destination username [R1]? backup Destination filename [r1-confg]? r1-backup.cfg Password: Writing r1-backup.cfg ! 625 bytes copied in 0.066 secs (9470 bytes/sec) ▶ NMS student@NMS:~$ ls -l /srv/tftp total 4 -rw-r--r-- 1 root root 625 Mar 1 00:00 r1-confg student@NMS:~$ ls /home/backup r1-backup.cfg
Restore
copy tftp: running-config merges the file into the running configuration (like typing it); copy tftp: startup-config replaces the saved one, used at the next reload.
Remember: TFTP = UDP 69, no login. FTP = TCP 21, clear-text login. SCP and SFTP = TCP 22, encrypted. Prefer SCP/SFTP.