準備好軟件IPOP、用ENSP模擬一下華為交換機
啟動交換機
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname FTPClient
[FTPClient]interface vlanif 1
[FTPClient-Vlanif1]ip add
[FTPClient-Vlanif1]ip address 192.168.198.23 24
打開IPOP軟件,找到服務-FTP
修改本地服務端目錄
添加一個ftp用戶名和密碼
啟動FTP服務
查看交換機上的目錄文件
<FTPClient>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time FileName
0 drw- - Aug 06 2015 21:26:42 src
1 drw- - Dec 13 2021 22:55:23 compatible
2 -rw- 483 Dec 13 2021 23:24:08 vrpcfg.zip
32,004 KB total (31,968 KB free)
<FTPClient>
交換機上ftp連接FTP服務端
<FTPClient>ftp 192.168.198.1
Trying 192.168.198.1 ...
Press CTRL+K to abort
Connected to 192.168.198.1.
220 FTP Server ready.
User(192.168.198.1:(none)):ftp
331 Password required for ftp.
Enter password:
230 User ftp logged in.
[ftp]dir #現(xiàn)在本地FTP服務端目錄里面是空的
200 Port command successful.
150 Opening data connection for directory list.
drw-rw-rw- 1 ftp ftp 0 Dec 13 23:17 .
drw-rw-rw- 1 ftp ftp 0 Dec 13 23:17 ..
226 File sent ok
[ftp]
把交換機上的配置文件放到本地FTP服務端目錄
[ftp]put vrpcfg.zip
200 Port command successful.
150 Opening data connection for vrpcfg.zip.
100%
226 File received ok
FTP: 483 byte(s) sent in 0.190 second(s) 2.54Kbyte(s)/sec.
[ftp]
如圖所示:
可以復制一份改一下名字,比如改成
vrpcfg-from-FTP-Server.zip
把改名字之后的
vrpcfg-from-FTP-Server.zip放到交換機里面
[ftp]get vrpcfg-from-FTP-Server.zip
200 Port command successful.
150 Opening data connection for vrpcfg-from-FTP-Server.zip.
226 File sent ok
FTP: 483 byte(s) received in 0.130 second(s) 3.71Kbyte(s)/sec.
[ftp]
交換機里查詢目錄文件
<FTPClient>dir
Directory of flash:/
Idx Attr Size(Byte) Date Time FileName
0 drw- - Aug 06 2015 21:26:42 src
1 drw- - Dec 13 2021 22:55:23 compatible
2 -rw- 483 Dec 13 2021 23:27:37 vrpcfg-from-ftp-server.zip
3 -rw- 483 Dec 13 2021 23:24:08 vrpcfg.zip
32,004 KB total (31,964 KB free)
如圖所示:
這樣就實現(xiàn)了交換機與本地ftp服務端目錄的文件互傳
備注:
ENSP里面的Cloud1的配置如下:
注意這里不要綁定外網(wǎng)網(wǎng)卡(上Internet的網(wǎng)卡),如果沒有其他網(wǎng)卡的話,可以添加一個本地環(huán)回端口。我綁定了外網(wǎng)網(wǎng)卡與交換機不通,難道外網(wǎng)網(wǎng)卡不能直連到交換機嗎,太晚了,下次再試。