FTP配置过程
路由器端口设置IP地址,和PC网卡在同一网段:
[RT-1]interface Ethernet 0/0
[RT-1-Ethernet0/0]
[RT-1-Ethernet0/0]ip address 192.168.0.1 255.255.255.0
[RT-1-Ethernet0/0]q
配置完后ping PC验证:
[RT-1]ping 192.168.0.144
PING 192.168.0.144: 56 data bytes, press CTRL_C to break
Reply from 192.168.0.144: bytes=56 Sequence=1 ttl=128 time=1 ms
Reply from 192.168.0.144: bytes=56 Sequence=2 ttl=128 time=1 ms
Reply from 192.168.0.144: bytes=56 Sequence=3 ttl=128 time=1 ms
Reply from 192.168.0.144: bytes=56 Sequence=4 ttl=128 time=2 ms
Reply from 192.168.0.144: bytes=56 Sequence=5 ttl=128 time=1 ms
--- 192.168.0.144 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/1/2 ms
路由器上启用FTP服务:
[RT-2]ftp server enable
路由器上建立FTP的用户:
[RT-2]local-user 123
[RT-2-luser-123]service-type ftp
[RT-2-luser-123]service-type ftp ftp-directory flash:/
[RT-2-luser-123]password simple 123
[RT-2-luser-123]q
打开PC 命令提示符 :
ftp 192.168.0.1 FTP路由器的IP地址
User (192.168.0.1:(none)): 123 输入用户名123
331 Password required for 123.
Password: 输入密码123
ftp> bin 输入bin命令,以二进制格式传输文件
ftp> lcd e:/file 设置主机文件所在目录
ftp> put 123.txt 从PC往路由器上传文件(PC下载路由器上文件为 get)
回到路由器上dir 查看 123.txt:
[RT-2]
Ftp server is currently writing to flash , please wait...
\
Ftp server writing to flash is done.
[RT-2]q
<RT-2>dir
Directory of flash:/
1 -rw- 0 May 25 2010 07:19:19 123.txt
删除123.txt:
<RT-2>delete flash:/123.txt
Delete flash:/123.txt?[Y/N]:y