Using FTP to transfer files between routers and servers is introduced in Cisco IOS Release 12.0. Because FTP is a connection-oriented application using TCP/IP, it provides better throughput and success rate than TFTP. TFTP is a connectionless application that uses UDP/IP for transmission services.
As a connection-oriented application, FTP requires logon and password before transmitting IOS images. Create the login username and password from the vroftp to the FTP server by configuring the privileged mode on the vro. To use FTP for IOS image transmission, the following command sequence is used again to provide the information to the router IOS:
Enable
Enter password xxxxxxxxx
Configure terminal
Ip ftp username login_name
Ip ftp password login_password
End
Write memory
Like using TFTP, The enable command and the subsequent privileged password allow the operator to gain the power to use the privileged mode command. The Configure terminal command executes the configuration mode of the router. In this mode, you can enter any or all options and definitions to modify, add, or delete the router running configuration. The FTP user name associated with the login name on the target FTP server is provided to the router IOS by using the ip ftp username command. The login-name variable in the ip ftp username command defines the Default User login name used by the router when the Copy ftp: command does not specify a login name.
The login-name variable is a valid user name on the target FTP server. The ip ftp password command is the default password associated with the specified login-name on the target FTP server. End command to exit the configuration mode. After executing these commands, the router IOS configuration has the FTP parameters required to connect to the FTP server. The write memory command at the end of the command line writes the running configuration of the vro to the nvram of the vro for permanent storage. Save the running configuration to the memory, and then save the entered configuration information between the power-on restart and the router reload.
Back up the current IOS image to an FTP server and run the following command:
Copy device: filename
Ftp: [[[// login-name [: login-password] @] location]/directory]/filename]
With this command, the router administrator uses the device parameter in the device: filename variable to specify the flash location on the router and the image name through the filename parameter. Filename is an image name found on a flash device.
Download
The login-name and login-password values can be set by the ip ftp username and ip ftp password commands.
However, remember that these commands are only used by default. If these commands are not entered, the FTP server prompts the router administrator to enter the user name and password. The remaining location, directory, and filename variables are defined in the same way as those in TFTP.
For example, to transfer an image from flash memory to an ftp server named ftp server, the router administrator enters the following command:
Copy flash: ios-image
Ftp: // joev: jandj @ FTPSERVER/Cisco/image/ios-image
The image named ios-image is copied to the // cisco/image/directory in the directory structure of the authorized user joev relative to the FTP server. The IP address of the SERVER named ftp server is determined by the router performing a DNS query on the dns server found in the configuration file.
Transmit a new image file to the vro and run the following copy ftp: command:
Copy ftp: [[[// [login-name [: login-password] @] location]/directory]/filename] device: [filename]
Copy ftp: The command uses the same variables as previously discussed. When using this command, you only need to note the following:
Copy ftp: slot1:
For commands in this abbreviated format, the default login-name and default login-password are transferred to the FTP server.
If the default value of the router is not specified, the FTP server will prompt you to enter the user name and user password. The FTP connection is the same as other connections, and the router administrator enters the filename of the file to be retrieved. Note: In this example, the default directory structure associated with the login name must have the requested filename for retrieval. In this example, the requested files are stored in the specified slot1 flash card.