Hi,
We briefly introduced the FTP protocol and the DHCP protocol before. Through the previous introduction, we know that FTP is mainly used to transfer files between the server and the client. DHCP is mainly used to allocate IP addresses for users.
In this chapter, we will separately introduce the configuration of the device as an FTP and DHCP server and client to learn to manage the file and IP address allocation and acquisition on the device (the following configuration will take the S5720 as an example).
Configure Device as the FTP server
When FTP is used as the server, FTP client access is allowed to download or upload files to the flash of the local device. By default, the server-side function of the device is not enabled. Please refer to the following steps for related configuration.

Figure 1: Procedures of configuring the device as the FTP server
Configure the device as the FTP client
When the device functions as an FTP client, it can download or upload files from the FTP server. Generally, when the device is upgraded or exported configuration files, we can configure the device as an FTP client to easily obtain the upgrade package from the local PC or export the configuration file to the local PC for backup. By default, the device supports an FTP client to access other FTP servers for file transfer operations. Just execute the ftp command on the device to connect to the FTP server.
<HUAWEI> ftp 10.1.1.1
[ftp] binary //Set the file transfer mode to Binary.
[ftp] get devicesoft.cc //Download file devicesoft.cc from the FTP server.
[ftp] put vrpcfg.zip //Upload file vrpcfg.zip to the FTP server.
[ftp] quit //Disconnect the FTP client from the FTP server and return to the user view.
Configure the device as the DHCP server
Configuring the device as a server can enable the device to allocate IP addresses for access users. Please refer to the figure below for the detailed configuration process.

Figure 2: Configure the device as the DHCP server
It is worth pointing out that in addition to using the global address pool, we can also configure the interface address to further simplify the DHCP server configuration

Figure 3: Configure the DHCP server based on the interface address pool
Configure the device as the DHCP client
When the device acts as a DHCP client, it can easily obtain an IP address from the DHCP server, avoiding the complexity of manual configuration. ZTP deployment is a typical application of the device as a DHCP client.
[Switch_1] interface vlanif 10
[Switch_1-Vlanif10] ip address dhcp-alloc
[Switch_1-Vlanif10] quit


