码迷,mamicode.com
首页 > 其他好文 > 详细

HCNA ftp配置

时间:2018-07-19 16:08:20      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:inter   sci   ip add   1.5   stat   本地   pac   bsp   上传文件   

技术分享图片

一、配置R1和R2的IP地址

R1:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]sysn R1

[R1]int g0/0/0

[R1-GigabitEthernet0/0/0]ip add 10.0.12.1 24

Jul 19 2018 10:33:33-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP 

on the interface GigabitEthernet0/0/0 has entered the UP state. 

[R1-GigabitEthernet0/0/0]quit


R2:

<Huawei>sys

Enter system view, return user view with Ctrl+Z.

[Huawei]sysn R2

[R2]int g0/0/0

[R2-GigabitEthernet0/0/0]ip add 10.0.12.2  24

[R2-GigabitEthernet0/0/0]

Jul 19 2018 10:40:54-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 

on the interface GigabitEthernet0/0/0 has entered the UP state. 

[R2-GigabitEthernet0/0/0]return

<R2>


二、配置R1为ftp 服务器,R2为客户端

[R1]ftp server enable     //启用ftp服务功能

Info: Succeeded in starting the FTP server

[R1]set default ftp-directory flash:     //配置ftp的工作目录

[R1]aaa                    //启用aaa认证

[R1-aaa]local-user ftp password cipher huawei   //设置ftp用户名和密码

Info: Add a new user.

[R1-aaa]local-user ftp privilege level 15    //设置用户权限为15

[R1-aaa]local-user ftp ftp-directory flash:

[R1-aaa]dis ftp-server              //查看ftp服务器配置

   FTP server is running          

   Max user number                 5

   User count                      0

   Timeout value(in minute)        30

   Listening port                  21

   Acl number                      0

   FTP server's source address     0.0.0.0



三、客户端R2登录ftp服务器端R1

<R2>ftp 10.0.12.1

Trying 10.0.12.1 ...


Press CTRL+K to abort

Connected to 10.0.12.1.

220 FTP service ready.

User(10.0.12.1:(none)):ftp    //输入用户名

331 Password required for ftp.

Enter password:               //输入密码

230 User logged in.


[R2-ftp]         //此时已经登录ftp服务器了


四、ftp的上传文件和下载

[R2-ftp]dir    //查看目录

200 Port command okay.

150 Opening ASCII mode data connection for *.

drwxrwxrwx   1 noone    nogroup         0 Jul 19 02:30 dhcp

-rwxrwxrwx   1 noone    nogroup    121802 May 26  2014 portalpage.zip

-rwxrwxrwx   1 noone    nogroup      2263 Jul 19 02:30 statemach.efs

-rwxrwxrwx   1 noone    nogroup    828482 May 26  2014 ssl***.zip

-rwxrwxrwx   1 noone    nogroup       205 Jul 19 03:05 private-data.txt

drwxrwxrwx   1 noone    nogroup         0 Jul 19 03:05 .

-rwxrwxrwx   1 noone    nogroup       635 Jul 19 03:05 vrpcfg.zip

226 Transfer complete.

FTP: 467 byte(s) received in 0.150 second(s) 3.11Kbyte(s)/sec.


(1)从ftp服务器下载文件


[R2-ftp]get vrpcfg.zip 11vrpcfg.zip     //下载vrpcfg.zip文件到本地并命名为11vrpcfg.zip

200 Port command okay.

150 Opening ASCII mode data connection for vrpcfg.zip.

226 Transfer complete.

FTP: 635 byte(s) received in 0.710 second(s) 894.36byte(s)/sec.


(2)退出查看

[R2-ftp]bye

221 Server closing.


<R2>dir

Directory of flash:/


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

    0  drw-              -  Jul 19 2018 02:30:30   dhcp

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

    2  -rw-            635  Jul 19 2018 06:50:02   11vrpcfg.zip    //此处已有该文件,说明已经成功下载

    3  -rw-          2,263  Jul 19 2018 02:30:22   statemach.efs

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

    5  -rw-            205  Jul 19 2018 06:48:31   private-data.txt

    6  -rw-            556  Jul 19 2018 06:48:30   vrpcfg.zip


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

<R2>


(3)将11vrpcfg.zip文件上传至ftp服务器

<R2>ftp 10.0.12.1               连接到ftp服务器

Trying 10.0.12.1 ...


Press CTRL+K to abort

Connected to 10.0.12.1.

220 FTP service ready.

User(10.0.12.1:(none)):ftp

331 Password required for ftp.

Enter password:

230 User logged in.


[R2-ftp]put 11vrpcfg.zip       //上传11vrpcfg.zip文件

200 Port command okay.

150 Opening ASCII mode data connection for 11vrpcfg.zip.


 100%     

226 Transfer complete.

FTP: 635 byte(s) sent in 0.250 second(s) 2.54Kbyte(s)/sec.


[R2-ftp]dir                     //查看

200 Port command okay.

150 Opening ASCII mode data connection for *.

drwxrwxrwx   1 noone    nogroup         0 Jul 19 02:30 dhcp

-rwxrwxrwx   1 noone    nogroup    121802 May 26  2014 portalpage.zip

-rwxrwxrwx   1 noone    nogroup       635 Jul 19 07:01 11vrpcfg.zip            //此处已有,说明上传成功

-rwxrwxrwx   1 noone    nogroup      2263 Jul 19 02:30 statemach.efs

-rwxrwxrwx   1 noone    nogroup    828482 May 26  2014 ssl***.zip

-rwxrwxrwx   1 noone    nogroup       205 Jul 19 03:05 private-data.txt

drwxrwxrwx   1 noone    nogroup         0 Jul 19 07:01 .

-rwxrwxrwx   1 noone    nogroup       635 Jul 19 03:05 vrpcfg.zip

226 Transfer complete.

FTP: 536 byte(s) received in 0.140 second(s) 3.82Kbyte(s)/sec.


HCNA ftp配置

标签:inter   sci   ip add   1.5   stat   本地   pac   bsp   上传文件   

原文地址:http://blog.51cto.com/12184141/2147193

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!