华为设备,通过tftp和ftp上传下载文件
真机IP192.168.10.10/24
R1 G0/0/0 IP192.168.10.1/24
在真机上搭建tftp服务器实现路由上传下载
使用tftpd32搭建TFTP服务器
R1配置
<R1>system-view //进入系统视图
interface GigabitEthernet 0/0/0 //进接口
ip address 192.168.10.1 24 // 配置接口IP
undo shutdown //激活接口
return //回到用户视图
<R1>ping 192.168.10.10 //检测线路是否正常
PING 192.168.10.10: 56data bytes, press CTRL_C to break
Reply from 192.168.10.10: bytes=56 Sequence=1 ttl=64 time=10 ms
Reply from 192.168.10.10: bytes=56 Sequence=2 ttl=64 time=10 ms
Reply from 192.168.10.10: bytes=56 Sequence=3 ttl=64 time=10 ms
Reply from 192.168.10.10: bytes=56 Sequence=4 ttl=64 time=1 ms
Reply from 192.168.10.10: bytes=56 Sequence=5 ttl=64 time=10 ms
--- 192.168.10.10 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 1/8/10 ms
<R1>tftp 192.168.10.10 get abc.txt //下载服务器上abc.txt文件
Info: Transfer file in binary mode.
Downloading the file from the remote TFTP server. Please wait...
100%
0 bytes received in 1 second.
TFTP: Downloading the file successfully.
<R1>dir //显示文件列表
Directory of flash:/
IdxAttr Size(Byte)Date Time(LMT)FileName
0drw- -Jul 07 2015 11:07:32 dhcp
1-rw- 121,802May 26 2014 09:20:58 portalpage.zip
2-rw- 2,263Jul 07 2015 11:07:24 statemach.efs
3-rw- 828,482May 26 2014 09:20:58 sslvpn.zip
4-rw- 559Jul 07 2015 11:54:48 vrpcfg.zip
5-rw- 0Jul 07 2015 11:52:08 abc.txt //下载成功
1,090,732 KB total (784,528 KB free)
<R1>tftp 192.168.10.10 put vrpcfg.zip //下载路由器配置文件
Info: Transfer file in binary mode.
Uploading the file to the remote TFTP server. Please wait...
91%
TFTP: Uploading the file successfully.
559 bytes send in 1 second.
tftp完成
在R1上搭建ftp服务器实现真机上传下载
R1配置
<R1>system-view
ftp server enable //开启ftp服务
aaa //进入aaa视图
local-user test password cipher abc123 //创建用户test 密码为abc123
local-user test privilege level 3 //设置用户的级别
local-user test ftp-directory flash: //设置目录
local-user test service-type ftp //设置用户的服务类型为ftp
在真机上打开命令提示符
在真机上搭建ftp服务器
R1登录
<R1>ftp 192.168.10.10 //登录ftp服务器
Trying 192.168.10.10 ...
Press CTRL+K to abort
Connected to 192.168.10.10.
220 http://idchh.com
User(192.168.10.10:(none)):test //输入用户名
331 Password required for test.
Enter password: //密码
230 User test logged in.
put test.doc //上传test.doc到ftp服务器
200 Port command successful.
150 Opening data connection for test.doc.
41%83%
100%
226 File received ok
FTP: 39260 byte(s) sent in 0.190 second(s) 206.63Kbyte(s)/sec.
get 123.txt //从服务器上下载文件
200 Port command successful.
150 Opening data connection for 123.txt.
226 File sent ok
FTP: 9 byte(s) received in 0.080 second(s) 112.50byte(s)/sec.
quit //退出
221 Goodbye.
<R1>dir //列出文件
Directory of flash:/
IdxAttr Size(Byte)Date Time(LMT)FileName
0drw- -Jul 07 2015 11:07:32 dhcp
1-rw- 121,802May 26 2014 09:20:58 portalpage.zip
2-rw- 39,260Jul 07 2015 12:20:21 test.doc //上传成功
3-rw- 9Jul 07 2015 12:32:55 123.txt
4-rw- 2,263Jul 07 2015 11:07:24 statemach.efs
5-rw- 828,482May 26 2014 09:20:58 sslvpn.zip
6-rw- 205Jul 07 2015 11:54:48 private-data.txt
7-rw- 0Jul 07 2015 11:52:08 abc.txt
8-rw- 559Jul 07 2015 11:54:48 vrpcfg.zip
1,090,732 KB total (784,432 KB free)
dir 查看文件列表
get 下载
put 上传
binary 切换二进制模式
百度云附件:绿色小server-U.zip
页:
[1]