IOS includes a built-in FTP client that can be used to transfer images to and from the Cisco device. Unlike TFTP, FTP supports authentication, and you will need to provide a valid FTP server username and password.
The following steps are required for FTP transfers:
- create an FTP username and password by using the ip ftp username USERNAME and ip ftp password PASSWORD global configuration command. We need to provide the username and password that were already created on the FTP server.
- issue the copy ftp flash exec mode command and follow the wizard.
Here is an example. Let’s say that we want to transfer the image file from the FTP server to a Cisco switch. We can do this using the following set of commands:
SW1(config)#ip ftp username tuna SW1(config)#ip ftp password peyo SW1(config)#end SW1# %SYS-5-CONFIG_I: Configured from console by console SW1#copy ftp flash Address or name of remote host ? 10.0.0.100 Source filename ? c2960-lanbasek9-mz.150-2.SE4.bin Destination filename [c2960-lanbasek9-mz.150-2.SE4.bin]? Accessing ftp://10.0.0.100/c2960-lanbasek9-mz.150-2.SE4.bin... [OK - 4670455 bytes] 4670455 bytes copied in 10.02 secs (37473 bytes/sec)
To verify that the file has indeed been transfered, we can use the show flash: command:
SW1#show flash: Directory of flash:/ 1 -rw- 4414921 c2960-lanbase-mz.122-25.FX.bin 4 -rw- 4670455 c2960-lanbasek9-mz.150-2.SE4.bin 2 -rw- 1052 config.text
We can also transfer files from the IOS device to the FTP server, for example to backup the startup configuration. Here is an example of copying the startup configuration of a switch to the FTP server:
SW1#copy startup-config ftp Address or name of remote host ? 10.0.0.100 Destination filename [SW1-confg]? Writing startup-config... [OK - 1052 bytes] 1052 bytes copied in 0.09 secs (11000 bytes/sec) 64016384 bytes total (54929956 bytes free)