祖瑞科技 全国计算机 网络IT运维社区!

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
查看: 5028|回复: 0

HCNA-5 配置通过FTP进行文件操作

[复制链接]

199

主题

212

帖子

1200

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
1200
发表于 2021-2-4 17:54:56 | 显示全部楼层 |阅读模式
HCNA-5 配置通过FTP进行文件操作

1、基本配置
R1
<Huawei>clocktimezone BJ add 8:00:00
<Huawei>clockdatetime 22:34 2020-04-23
<Huawei>system-view
[Huawei]headerlogin information "Welcome to ipgzj.com"
[Huawei]headershell information "Welcome to zurkj.com"
[Huawei]sysnameR1
[R1]interfacegigabitethernet 0/0/0
[R1-GigabitEthernet0/0/0]ipaddress 10.1.1.1 24
[R1-GigabitEthernet0/0/0]quit
[R1]interfacegigabitethernet 0/0/1
[R1-GigabitEthernet0/0/1]ipaddress 10.1.2.1 24
[R1-GigabitEthernet0/0/1]quit
[R1]display ipinterface brief
[R1]return
<R1>save

2、配置FTP Server
使用R1 FTP连接服务器
<R1>ftp10.1.2.100
Trying 10.1.2.100...
Press CTRL+K toabort
Connected to10.1.2.100.
220 FtpServerTryFtpD for free
User(10.1.2.100: (none)):zurkj  //初次登录创建用户名
331 Passwordrequired for zurkj .
Enter password:    //创建密码
230 User zurkjlogged in , proceed
[R1-ftp]

[R1-ftp]ls  //LS 查看FTP服务器文件状态
200 Portcommand okay.
150 OpeningASCII NO-PRINT mode data connection for ls -l.
Config
226Transfer finished successfully. Data connection closed.
FTP: 8byte(s) received in 0.200 second(s) 40.00byte(s)/sec.

[R1-ftp]cdconfig  //进入config文件夹
250"/config" is current directory.

[R1-ftp]dir //查看文件属性
200 Portcommand okay.
150 OpeningASCII NO-PRINT mode data connection for ls -l.
-rwxrwxrwx  1 zurkj    nogroup           20 Apr 23  2020 test.txt
226Transfer finished successfully. Data connection closed.
FTP: 68byte(s) received in 0.140 second(s) 485.71byte(s)/sec.

[R1-ftp]gettest.txt  //下载test.txt到本地路由器
200 Portcommand okay.
150 Sendingtest.txt (20 bytes). Mode STREAM Type BINARY

100%   
_226Transfer finished successfully. Data connection closed.
FTP: 20byte(s) received in 0.110 second(s) 181.81byte(s)/sec.

[R1-ftp]puttest.txt ipgzj.txt  //上传test.txt到FTP服务器并重命名文件为ipgzj.txt
200 Portcommand okay.
150 OpeningBINARY data connection for ipgzj.txt

100%   
226Transfer finished successfully. Data connection closed.
FTP: 20byte(s) sent in 0.110 second(s) 181.81byte(s)/sec.

[R1-ftp]cd..  //返回上一级
[R1-ftp]ls
200 Portcommand okay.
150 OpeningASCII NO-PRINT mode data connection for ls -l.
Config
ipgzj.txt
226Transfer finished successfully. Data connection closed.
FTP: 19byte(s) received in 0.210 second(s) 90.47byte(s)/sec.
[R1-ftp]quit
221Goodbye.

3、配置路由器为FTPServer
[R1]ftpserver enable  //FTP服务开启
配置FTP的用户名和密码:
[R1-aaa]local-userzurkj password cipher admin1234 privilege level 15  //配置本地用户 密码为密文显示 特权级别15
[R1-aaa]local-userzurkj service-type ftp  //配置本地用户 服务类型 FTP
[R1-aaa]local-userzurkj ftp-directory flash:  //配置本地FTP用户可访问的目录

使用PC FTP Clinet 上传文件到FTP路由器


注意PC FTP Clinet登录的FTP用户名和密码为路由器上创建的。


<R1>dir  //查看文件属性
Directoryof flash:/

  Idx Attr     Size(Byte)  Date       Time(LMT)  FileName
    0  drw-              - Apr 23 2020 14:27:37   dhcp
   1  -rw-              0 Apr 23 2020 23:23:49  www.ipgzj.com.txt
    2 -rw-        121,802  May 26 2014 09:20:58   portalpage.zip
    3 -rw-             20  Apr 23 2020 22:58:42   test.txt
   4  -rw-              0 Apr 23 2020 23:24:48  www.zurkj.com.txt
    5 -rw-          2,263  Apr 23 2020 14:27:27   statemach.efs
    6 -rw-        828,482  May 26 2014 09:20:58   sslvpn.zip
    7 -rw-            249  Apr 23 2020 22:42:09   private-data.txt
    8 -rw-            591  Apr 23 2020 22:42:09   vrpcfg.zip

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

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
祖瑞(上海)网络科技有限公司
我们在全国范围提供企业IT运维、网络工程、弱电安装、监控安防、计算机产品收售、办公设备耗材等服务!
期待与您的合作!
邮箱:sanne@zurkj.com
电话:021-51850021 18918292296
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

公司网站

QQ|Archiver|手机版|小黑屋|祖瑞科技 全国计算机 网络IT运维社区! ( 沪ICP备16021636号-2 )

GMT+8, 2024-5-2 17:39 , Processed in 0.061878 second(s), 19 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表