The protocols side by side
On small screens, swipe sideways or focus the diagram and use the arrow keys.
Copying on a Cisco device
Example commands and output on this page were written from Cisco IOS documentation and generally described behaviour. They were not captured from a live device, so prompts and details can differ on your platform and version.
! Back up the running configuration to a TFTP server
copy running-config tftp://192.0.2.10/R1-config
! Back up with FTP (credentials set globally)
ip ftp username backup
ip ftp password S3cretPass
copy startup-config ftp://192.0.2.10/R1-startup
! Back up with SCP (device must allow SCP and use AAA)
copy running-config scp://admin@192.0.2.10/R1-configThe syntax is the same: copy source destination. The server address 192.0.2.10 is from the documentation range; the credentials are placeholders.
Letting the router accept SCP
aaa new-model
aaa authentication login default local
aaa authorization exec default local
username admin privilege 15 secret ExampleSecret1
ip ssh version 2
ip scp server enableSCP rides on SSH, so SSH must already work. ip scp server enable lets the device receive copies.
How TFTP behaves
A TFTP client sends its request to UDP port 69. The server then answers from a different, random UDP port, and each block of 512 bytes is acknowledged before the next is sent. That makes it slow and awkward to firewall, which is another reason to keep it on a management network.
Choosing
- Bootloader recovery or an isolated lab: TFTP.
- Regular backups across a network you do not fully trust: SCP or SFTP.
- Anything carrying a password across a shared network: never plain FTP or TFTP.
Test yourself
Which protocol sends no username or password and uses UDP port 69?
Which two file transfer methods are both carried inside SSH on TCP 22?
You must send a configuration backup across the internet to a remote server. Which is the best choice?