FTP:
采用C/S架构,建立TCP连接之后即可实现文件的上传、下载。
工作方式有:主动模式(PORT)被动模式(PASV)【三次握手】
服务器端:
开启 FTP 服务器端功能
[Hua wei]ftp [ ipv6 ] server enable
缺省情况下,设备的FTP服务器端功能是关闭的。
配置 FTP 本地用户
[Huawei]aaa
[Huawei]local-user user-name password irreversible-cipher password [Huawei]local-user user-name privilege level level
[Huawei]local-user user-name service-type ftp [Huawei]local-user user-name ftp-directory directory
必须将用户级别配置在3级或者3级以上,否则FTP连接将无法成功。
客户端:
VRP作为FTP客户端访问FTP服务器端
<FTP Client>ftp 10.1.1.1
Trying 10.1.1.1...
Press CTRL+K to abort
Connected to 10.1.1.1.
220 FTP service ready.
User(10.1.1.1:(none)):ftp
331 Password required for ftp.
Enter password:
230 User logged in.
VRP作为FTP客户端的常用命令
ascii Set the file transfer type to ASCII, and it is the default type
binary Set the file transfer type to support the binary image
passive Set the toggle passive mode, the default is on
get Download the remote file to the local host
put Upload a local file to the remote host
Is List the contents of the current or remote directory
TFTP:以小文件为目标【使用UDP进行传输(端口号69) ; 无需认证 ; 只能直接向服务器端请求某个文件或者上传某个文件,无法查看服务器端的文件目录。
设备作为客户端:
VRP 作为TFTP 客户端下载文件
<Huawei> tftp TFTP_Server-IP-address get filename
TFTP 无需登录,直接输入服务器端IP地址以及操作命令即可。
VRP作为TFTP客户端上传文件
<Huawei> tftp TFTP_Server-IP-address put filename
TFTP 无需登录,直接输入服务器端IP 地址以及操作命令即可。
目前VRP设备只支持作为TFTP客户端。