Configure DHCP server on S series switch based on the global address pool

1

For S series switches (except S1700 switches), after a DHCP server based on the global address pool is configured, that is, an IP address pool is created in the system view, IP addresses in the address pool can be allocated to DHCP clients connected to all interfaces.
This configuration mode applies to scenarios where the DHCP server and clients are on different network segments and a DHCP relay exists. In addition, this configuration mode is used to allocate IP addresses to DHCP clients connected to multiple interfaces when the DHCP server and clients are on the same network segment. The configurations are as follows:
[HUAWEI] dhcp enable //Enable the DHCP function.
[HUAWEI] ip pool pool1 //Configure a global address pool.
[HUAWEI-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.0 //Configure an IP address range that can be dynamically allocated.
[HUAWEI-ip-pool-pool1] gateway-list 10.1.1.1 //Configure an IP address for the gateway.
[HUAWEI-ip-pool-pool1] dns-list 114.114.114.114 //Configure the IP address of the DNS server for DHCP clients.
[HUAWEI-ip-pool-pool1] quit
[HUAWEI] interface vlanif 100 //Create an interface connecting the DHCP server to the DHCP clients.
[HUAWEI-Vlanif100] ip address 10.1.1.1 255.255.255.0 //This IP address must be on the same network segment as the IP address pool.
[HUAWEI-Vlanif100] dhcp select global //Enable the DHCP server function to assign IP addresses to clients from the global address pool.

Other related questions:
Configure the DHCP server based on the global address pool on the AR
An IP address pool is created in the system view on a DHCP server. In the interface view, the server is configured to allocate IP addresses, gateway addresses, and DNS server addresses to clients based on the global address pool. This mode applies to the scenario where the DHCP server and clients are on different network segments (a DHCP relay agent exists), or the DHCP server and clients are on the same subnet but the server needs to assign IP addresses to the clients connected to multiple interfaces. Perform the following configuration: [Huawei] dhcp enable //Enable the DHCP function. [Huawei] ip pool pool1 //Configure a global address pool. [Huawei-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.0 //Specify the range of IP addresses that can be dynamically allocated. [Huawei-ip-pool-pool1] gateway-list 10.1.1.1 // Set the gateway IP address. [Huawei-ip-pool-pool1] quit [Huawei] interface ethernet 1/0/0 //Enter the view of the interface of the DHCP server connected to the client. [Huawei-Ethernet1/0/0] undo portswitch //Switch the interface to Layer 3 mode. [Huawei-Ethernet1/0/0] ip address 10.1.1.1 255.255.255.0 //Configure the same subnet as the address pool. [HUAWEI-Vlanif100] dhcp select global // Enable the DHCP server to assign IP addresses to clients from the global address pool.

Configure DHCP server on S series switch based on the interface address pool
To configure the DHCP server based on the interface address pool for the S series switches (excluding the S1700), configure an IP address for the interface and the switch allocates addresses that are on the same network segment as the interface IP address to clients. This configuration mode is simple and applies only to scenarios where the DHCP server and clients are on the same network segment. That is, no DHCP relay exists.The configuration is as follows: [HUAWEI] dhcp enable //Enable DHCP. [HUAWEI] interface gigabitethernet 2/0/0 //Enter the view of the interface connected to the DHCP client. [HUAWEI-GigabitEthernet2/0/0] port link-type access [HUAWEI-GigabitEthernet2/0/0] port default vlan 10 [HUAWEI-GigabitEthernet2/0/0] quit [HUAWEI] interface vlanif 10 [HUAWEI-Vlanif10] ip address 10.1.1.1 24 //Configure the network segment where the DHCP client resides. The IP address range of the interface-based DHCP server is: 10.1.1.2 to 10.1.1.254. [HUAWEI-Vlanif10] dhcp select interface //Enable the DHCP server function based on the interface address pool. [HUAWEI-Vlanif10] dhcp server dns-list 114.114.114.114 //Specify the DNS server address in the interface address pool. [HUAWEI-Vlanif10] dhcp server lease day 2 //Set the lease of IP addresses to 2 days. [HUAWEI-Vlanif10] quit

DHCP address pool modes on S series switches
When an S series switch excluding the S1700 functions as the DHCP server, the switch supports the interface-based and global address pools. - Interface-based address pool The interface address pool is on the network segment where the primary IP address of an interface is located. The DHCP server can only select and assign IP addresses on the network segment to clients. - Global address pool 1. If the DHCP server is on the same network segment as clients (no relay agent is deployed), the DHCP server selects IP addresses in the address pool on the network segment where the primary IP address of the interface connected to clients is located. If the interface is not configured with the primary IP address or no address pool is on the same network segment as the primary IP address, clients cannot request IP addresses. 2. If the DHCP server and clients are on different network segments (a relay agent is deployed), the DHCP server parses the received IP address (the primary IP address of the first interface configured with the relay function) specified by the giaddr field in the DHCP Request message, and selects the address pool on the same network segment as the IP address to assign addresses. If the IP address does not match the corresponding address pool, clients cannot request IP addresses. Follow the preceding rules to ensure that a client can obtain an IP address.

Configure a DHCP global address pool
Configure a DHCP global address pool on a CE series switch as follows:
<HUAWEI> system-view
[~Huawei] dhcp enable //Enable DHCP globally.
[*Huawei] commit
[~Huawei] ip pool pool1 //Create a global address pool and enter its view.
[*Huawei-ip-pool-pool1] gateway-list 10.1.1.1 //Configure the egress gateway address for the global address pool of a DHCP server.
[*Huawei-ip-pool-pool1] network 10.1.1.0 mask 255.255.255.128 //Configure the range of IP addresses that can be allocated dynamically from a global address pool.
[*Huawei-ip-pool-pool1] dns-list 10.1.1.2 //Configure an IP address for the DNS server used by DHCP clients.
[*Huawei-ip-pool-pool1] excluded-ip-address 10.1.1.2 //Configure an IP address that cannot be automatically allocated from the global address pool.
[*Huawei-ip-pool-pool1] lease day 10 //Configure a lease for the IP address.
[*Huawei-ip-pool-pool1] commit
[~Huawei-ip-pool-pool1] quit

Method used to configure a DHCP server based on the global address pool on USG firewalls
You can configure a DHCP server (only the DHCP part) based on the global address pool on the USG2000, USG5000, and USG6000 as follows: [USG]dhcp server ip-pool 0 //Configure the address pool. [USG-dhcp-0]network 10.1.1.0 mask 255.255.255.0 [USG-dhcp-0]dns-list 10.1.1.2 [USG-dhcp-0]domain-name example.com [USG-dhcp-0]quit [USG]interface GigabitEthernet1/0/1 //Configure the interface address. [USG-GigabitEthernet0/0/1]ip address 10.1.1.1 255.255.255.128 [USG-GigabitEthernet0/0/1]quit [USG]firewall zone trust //Add the interface to the zone. [USG-zone-trust]add interface GigabitEthernet1/0/1

If you have more questions, you can seek help from following ways:
To iKnow To Live Chat
Scroll to top