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

1

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

Other related questions:
Configure DHCP server on S series switch based on the global address pool
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.

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 the DHCP server based on the interface address pool on the AR
Configure the DHCP server based on the interface address pool, that is, assign IP addresses to the interfaces. The AR assigns the IP addresses on the same network segment as the interface IP address to clients. This mode is easy to configure and applies to the scenario where the DHCP server and clients are on the same network segment, that is, no DHCP relay agent exists. Perform the following configuration: [Huawei] dhcp enable //Enable the DHCP function. [Huawei] interface ethernet 2/0/0 //Enter the view of the interface connected to the DHCP clients. [Huawei-Ethernet2/0/0] port link-type access [Huawei-Ethernet2/0/0] port default vlan 10 [Huawei-Ethernet2/0/0] quit [Huawei] interface vlanif 10 [Huawei-Vlanif10] ip address 10.1.1.1 24 //Configure the network segment where the DHCP client is located as 10.1.1.1 24. [Huawei-Vlanif10] quit [Huawei] interface vlanif 10 [Huawei-Vlanif10] dhcp select interface //Enable the DHCP server based on the interface address pool. [Huawei-Vlanif10] dhcp server lease day 30 //Set the DHCP address lease to 30 days. [Huawei-Vlanif10] quit

Configure DHCP address pools on S series switch
When functioning as DHCP servers, S series switches (except S1700 switches) support the interface and global address pool configurations. - Interface address pool: The network segment to which the primary IP address of an interface belongs is an interface address pool. The DHCP server allocates IP addresses only on this network segment to clients connected to the interface. - Global address pool: 1. If a switch functioning as the DHCP server is on the same network segment as clients (that is, no DHCP relay agent is configured), the switch allocates IP addresses on the same network segment as the primary IP address of the interface connected to clients. If no primary IP address is configured for the interface or no address pool is on the same network segment as the interface's primary IP address, the clients cannot obtain IP addresses. 2. If a switch functioning as the DHCP server is on a different network segment from a DHCP client (that is, a DHCP relay agent is configured), the DHCP server parses the IP address (primary IP address of the first DHCP relay agent's interface) specified in the giaddr field of a DHCP Request packet, and allocates an IP address on the same network segment as the parsed IP address from an address pool to the client. If no address pool matches the parsed IP addresses, the client cannot obtain an IP address. When configuring address pools, follow the preceding rules to ensure that clients can obtain IP addresses.

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