Huawei network equipment-configure FTP for file operations

Principle overview

FTP (File Transfer Protocol) is one of the earliest protocols used on the TCP / IP network and the Internet, and belongs to the application layer protocol in the TCP / IP protocol cluster.

It is an Internet standard for file transfer, and mainly provides users with file transfers from local and remote hosts, especially when performing version upgrades, log downloads, and configuration saving services.

FTP adopts C / S (Client / Server) structure. FTP can provide original client access and operation functions. Users can log in to the server through the host to upload and download files.

FTP experiment topology

Insert picture description here

R1 placement

After configuring the IP to test whether the client and the server are reachable, create a folder FTP-Huawei on the local computer as the FTP server folder, create a subfolder Config under the folder, and create a test file test.txt, and start after completion ftp server, use the ftp command to connect to the ftp server on R1. The user name is required by default when logging in. Because the server does not have it, each time you enter it on R1, it is equal to creating the user name and password. This time the user name is 10.0.2.1, and the password is huawei
Insert picture description here

<Huawei>system-view 
<Huawei>sys R1
[R1]inter g0/0/0
[R1-GigabitEthernet0/0/0]ip add 10.0.1.254 24
[R1]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip add 10.0.2.254 24
<R1>ftp 10.0.2.1
User(10.0.2.1:(none)):10.0.2.1
Enter password:

[ftp]   /此状态为已进入ftp配置视图

[ftp]ls     /ls查看FTP服务器文件夹状态
200 Port command okay.
150 Opening ASCII NO-PRINT mode data connection for ls -l.
Config    /创建的文件夹Config
226 Transfer finished successfully. Data connection closed.

[ftp]cd config     /cd进入该文件夹
250 "/config" is current directory.

[ftp]dir         /dir查看详细的文件属性
200 Port command okay.
150 Opening ASCII NO-PRINT mode data connection for ls -l.
-rwxrwxrwx  1 10.0.2.1  nogroup            6 Apr 1  2020 test.txt.txt
226 Transfer finished successfully. Data connection closed.

[ftp]get test.txt    /使用get下载test.txt到本地路由器
200 Port command okay.
150 Sending test.txt.txt (6 bytes). Mode STREAM Type BINARY

100%     
226 Transfer finished successfully. Data connection closed.
FTP: 6 byte(s) received in 0.110 second(s) 54.54byte(s)/sec.

/下载成功

[ftp]put test.txt.txt    /put上传
200 Port command okay.
150 Opening BINARY data connection for test.txt.txt

100%     
226 Transfer finished successfully. Data connection closed.
FTP: 6 byte(s) sent in 0.090 second(s) 66.66byte(s)/sec.

/上传成功

Router is configured as FTP Server

The above router as the client has been successfully downloaded and uploaded, set the ftp login password ftp / huawei, set the folder directory to "flash:", priority 3

<R1>system-view 
Enter system view, return user view with Ctrl+Z.
[R1]aaa
[R1-aaa]local-user ftp password cipher huawei 
[R1-aaa]local-user ftp ftp-directory flash:
[R1-aaa]local-user ftp service-type ftp
[R1-aaa]local-user ftp privilege level 3

After the configuration is complete, create usertext.txt locally, and set the client server address 10.0.1.254, user name ftp, password huawei, click login, after login is complete, you can select the usertext file, and click the right arrow to send to the ftp server, File uploaded successfully

Insert picture description here
View the files in the directory on R1

Insert picture description here

From Huawei HCNA Routing Switching Experimental Guide

Published 41 original articles · praised 65 · 20,000+ views

Guess you like

Origin blog.csdn.net/qq_39689711/article/details/105236149