我们也可以通过搭建FTP服务器,路由器做客户端来实现对路由器文件系统的维护。
第一步:搭建环境
路由器为客户端,用户在微机上运行FTP服务器程序作为FTP服务器。并设置好FTP服务器的路径,同时为路由器添加用户名和密码。
配置两边IP地址为同一网络,本节在服务器一端设置为192.168.1.1,与其相连的路由器以太网口(本例为Ethernet 0/0,任何以太网口均可)设置为192.168.1.2。双方可以用ping命令检验是否连接成功。
第二步:通过连接在路由器Console口的终端对路由器进行维护
本例如下:
ftp 192.168.1.1
Trying 192.168.1.1 ...
Press CTRL+K to abort
Connected to 192.168.1.1.
220 3Com 3CDaemon FTP Server Version 2.0
User(192.168.1.1:(none)):guest
331 User name ok, need password
Password:
230 User logged in
[ftp]
连接成功后,我们通过如下命令完成对路由器的维护
同样我们是通过get和put的命令实现对文件的备份和恢复:
[ftp]get main.bin main.bin
flash:/main.bin has been existing. Overwrite it?[Y/N]:y
200 PORT command successful.
150 File status OK ; about to open data connection
226 Closing data connection; File transfer successful.
FTP: 14323376 byte(s) received in 69.256 second(s) 206.00K byte(s)/sec.
[ftp]put main.bin main.bin
200 PORT command successful.
150 File status OK ; about to open data connection
226 Closing data connection; File transfer successful.
FTP: 14323376 byte(s) sent in 15.974 second(s) 896.00Kbyte(s)/sec.
[ftp]quit
221 Service closing control connection
注意事项