wKioL1Wbu0uBtEWXAABF3pRwqP4019.jpg

真机IP192.168.10.10/24

R1 G0/0/0 IP192.168.10.1/24


在真机上搭建tftp服务器实现路由上传下载


使用tftpd32搭建TFTP服务器


wKiom1Wbu1awc4uyAADvDUagrQk646.jpg


R1配置

<R1>system-view                  //进入系统视图

[R1]interface GigabitEthernet 0/0/0     //进接口

[R1-GigabitEthernet0/0/0]ip address 192.168.10.1 24   // 配置接口IP

[R1-GigabitEthernet0/0/0]undo shutdown           //激活接口

[R1-GigabitEthernet0/0/0]return              //回到用户视图

<R1>ping 192.168.10.10               //检测线路是否正常

  PING 192.168.10.10: 56  data 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:/


  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 

    0  drw-              -  Jul 07 2015 11:07:32   dhcp

    1  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    2  -rw-          2,263  Jul 07 2015 11:07:24   statemach.efs

    3  -rw-        828,482  May 26 2014 09:20:58   ssl***.zip

    4  -rw-            559  Jul 07 2015 11:54:48   vrpcfg.zip

    5  -rw-              0  Jul 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.


wKioL1WbwKbzRnKIAACR9ZKV5V8645.jpg


tftp完成


在R1上搭建ftp服务器实现真机上传下载


R1配置

<R1>system-view     

[R1]ftp server enable    //开启ftp服务

[R1]aaa                 //进入aaa视图

[R1-aaa]local-user test password cipher abc123     //创建用户test 密码为abc123

[R1-aaa]local-user test privilege level 3         //设置用户的级别

[R1-aaa]local-user test ftp-directory flash:     //设置目录

[R1-aaa]local-user test service-type ftp        //设置用户的服务类型为ftp


在真机上打开命令提示符


wKioL1WbxXSg9gICAAE6C9stZQ8299.jpg


wKioL1Wbxu_yzuW6AAK6Tx7iIew742.jpg


在真机上搭建ftp服务器

wKioL1Wbx_GAkO_KAADhbQwJuMA746.jpg


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.


[R1-ftp]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.


[R1-ftp]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.


[R1-ftp]quit            //退出

221 Goodbye.


<R1>dir                 //列出文件

Directory of flash:/


  Idx  Attr     Size(Byte)  Date        Time(LMT)  FileName 

    0  drw-              -  Jul 07 2015 11:07:32   dhcp

    1  -rw-        121,802  May 26 2014 09:20:58   portalpage.zip

    2  -rw-         39,260  Jul 07 2015 12:20:21   test.doc         //上传成功

    3  -rw-              9  Jul 07 2015 12:32:55   123.txt

    4  -rw-          2,263  Jul 07 2015 11:07:24   statemach.efs

    5  -rw-        828,482  May 26 2014 09:20:58   ssl***.zip

    6  -rw-            205  Jul 07 2015 11:54:48   private-data.txt

    7  -rw-              0  Jul 07 2015 11:52:08   abc.txt

    8  -rw-            559  Jul 07 2015 11:54:48   vrpcfg.zip


1,090,732 KB total (784,432 KB free)


wKioL1WbyZ3zz2nqAABph2VKWRI906.jpg


dir 查看文件列表

get 下载

put 上传

binary 切换二进制模式