Using FTP from the Router:
You want to use FTP directly from your router to download configuration or IOS files.
The copy ftp: command lets the router exchange files using FTP:
Notice that we explicitly defined a username and password in this example. If you don’t specify a username, the router will try to connect to the server’s anonymous FTP service.
Several recipes in this chapter have shown how to transfer files between your router and server by using TFTP. However, Cisco routers also support FTP. We find that FTP is better suited for transferring files over busy and congested links. While TFTP file transfers tend to abort if they encounter persistent congestion, FTP appears to be more resilient.
FTP is also somewhat more secure than TFTP because it uses usernames and passwords. TFTP has no user-level security features. However, FTP sends its passwords across the network in unencrypted cleartext, so it is still not highly secure.
In the example, we explicitly configured a FTP username and password on the router. Once this information is defined, using FTP is as easy as using TFTP. You can also override the username and password settings defined in the configuration file by including them on the command line:
Notice that we used URL format to specify the username and password as well as the server address and the filename that we wanted to download. The format of the FTP URL looks like this:
A colon separates the username, ijbrown, from the password, ianpassword. An @ sign then separates the user information from the server information, which can be either an IP address or a DNS name. Then a forward slash, /, separates the filename from the directory and filename.
If you don’t include an FTP username in the configuration or the command line, the router will default to using anonymous FTP. And, if no password is specified in either the router’s configuration or on the command line, the router will send a default password of firstname.lastname@example.org.
It is important to remember that if you specify a username and password on the command line, it will override whatever values you have configured. If you don’t specify a username or password on the command line, the router will use the configured FTP username and password. If you don’t specify a username and password in either place, the router will resort to anonymous FTP.