Transferring Files Using FTP/TFTP
During system maintenance such as software upgrade and configuration file backup, files must be transferred between a PC and the device. FTP/TFTP is used to transfer files.
When transferring files using FTP/TFTP, the roles of PC and device vary in different methods:
- PC functioning as an FTP server: You must install the FTP server software on your PC.
- PC functioning as a TFTP server: You must install the TFTP server software on your PC. TFTP is easy to configure but this method has low security and transmission speed.
- Device functioning as an FTP server: You can perform configurations on the device without installing any software. When there are a large number of devices on a network, the first two methods are recommended.
PC Functioning as an FTP Server
- Run the FTP server software on the FTP server and configure the FTP service. For details, see relevant help documentation.
- Connect the device and the FTP server. (The IP addresses are used as an example.)
- Connect the FTP server to GE0/0/0 of the device using a network cable.
- Configure an IP address 192.168.0.1/24 for GE0/0/0.
- Configure an IP address 192.168.0.2/24 for the FTP server. (Configure an IP address for the network adapter of the PC. The configuration details are omitted.)
<AC> system-view [AC] interface gigabitethernet 0/0/0 [AC-GigabitEthernet0/0/0] ip address 192.168.0.1 24 [AC-GigabitEthernet0/0/0] ping 192.168.0.2 PING 192.168.0.2: 56 data bytes, press CTRL_C to break Reply from 192.168.0.2: bytes=56 Sequence=1 ttl=128 time=4 ms Reply from 192.168.0.2: bytes=56 Sequence=2 ttl=128 time=3 ms Reply from 192.168.0.2: bytes=56 Sequence=3 ttl=128 time=18 ms Reply from 192.168.0.2: bytes=56 Sequence=4 ttl=128 time=3 ms Reply from 192.168.0.2: bytes=56 Sequence=5 ttl=128 time=3 ms --- 192.168.0.2 ping statistics --- 5 packet(s) transmitted 5 packet(s) received 0.00% packet loss round-trip min/avg/max = 3/6/18 ms [AC-GigabitEthernet0/0/0] return
- In this example, the FTP server and the device are directly connected. If they are not directly connected, you must ensure that they have reachable routes to each other.
- After the configuration is complete, run the ping command to test the connectivity between the FTP server and device.
- Log in to the FTP server using FTP.
<AC> ftp 192.168.0.2 Trying 192.168.0.2 ... Press CTRL+K to abort Connected to 192.168.0.2. 220 FTP Server ready. User(192.168.0.2:(none)):ftpuser 331 Password required for ftpuser. Enter password: 230 User logged in. [AC-ftp]
- Run the put command to upload files to the FTP server or run the get command to download files from the FTP server to the device.
[AC-ftp] put vrpcfg.zip 200 Port command okay. 150 Opening ASCII mode data connection for vrpcfg.zip. 226 Transfer complete. FTP: 8174 byte(s) sent in 0.099 second(s) 82.56Kbyte(s)/sec. [AC-ftp] binary 200 Type set to I. [AC-ftp] get devicesoft.cc 200 Port command okay. 150 Opening ASCII mode data connection for devicesoft.cc. 226 Transfer complete. FTP: 141952 byte(s) received in 6.796 second(s) 20.88Kbyte(s)/sec.
PC Functioning as a TFTP Server
- Run the TFTP server software on the TFTP server (PC) and configure the TFTP service. For details, see relevant help documentation.
- Connect the TFTP server and the device and configure IP addresses for them. For details, see Transferring Files Using FTP/TFTP.
- Run the tftp put command to upload files to the TFTP server or run the tftp get command to download files from the TFTP server to the device.
<AC> tftp 192.168.0.2 get vrpcfg.zip vrpcfg1.zip Info: Transfer file in binary mode. Downloading the file from the remote TFTP server. Please wait...\ TFTP: Downloading the file successfully. 8174 bytes received in 1 second. <AC> tftp 192.168.0.2 put vrpcfg.zip vrpcfg2.zip Info: Transfer file in binary mode. Uploading the file to the remote TFTP server. Please wait...| TFTP: Uploading the file successfully. 8174 bytes send in 1 second.
Device Functioning as an FTP Server
- Connect the PC and the device and configure IP addresses for them. For details, see Transferring Files Using FTP/TFTP.
- Enable FTP on the device, and create a user name, password, and FTP path.
You must set the user level to level 3 or above to establish an FTP connection.
The AC6605 supports the flash memory, the AC6005 supports the SD card and USB flash drive, the ACU2 supports the flash memory and USB flash drive, and the AC6800V supports the hard disk and USB flash drive. This chapter uses the flash memory of AC6605 as an example.
<AC> system-view [AC] ftp server enable [AC] aaa [AC-aaa] local-user huawei password irreversible-cipher huawei@123 [AC-aaa] local-user huawei service-type ftp [AC-aaa] local-user huawei ftp-directory flash: [AC-aaa] local-user huawei privilege level 15 [AC-aaa] quit [AC] quit
- Log in to the device by running the ftp command on the PC. Run the get command to download files from the device to the PC or run the put command to upload files to the device.
For example, on an FTP server with the Windows operating system, choose Start > Run, enter cmd, and click OK.
C:\Documents and Settings\Administrator> ftp 192.168.0.1 Connected to 192.168.0.1. 220 FTP service ready. User (192.168.0.1:(none)): huawei 331 Password required for huawei. Password: 230 User logged in. ftp> get vrpcfg.zip 200 Port command okay. 150 Opening ASCII mode data connection for vrpcfg.zip. 226 Transfer complete. ftp: receive 5203 bytes in 0.01 seconds 346.87Kbytes/sec. ftp> lcd Local directory now C:\Documents and Settings\Administrator. ftp> put vrpcfg.zip 200 Port command okay. 150 Opening ASCII mode data connection for vrpcfg.zip. 226 Transfer complete. ftp: send 5203 bytes in 0.01 seconds 346.00Kbytes/sec.
If you use the user name Administrator to log in to the PC, the output differs from the above.
You can run the lcd command to view the path where backup configuration files are saved.
The commands vary with the operating system. For details, see relevant help documentation of each operating system.