Method used to configure DHCP relay on the AR

13

When the DHCP server and DHCP clients are on different network segments, the DHCP relay agent can be configured so that the DHCP server can assign IP addresses to the DHCP clients.
Procedure:
1. Configure the router #
sysname Router
#
dhcp enable //Enable the DHCP function.
#
ip pool ip-pool1
gateway-list 10.10.1.1 //Set the gateway IP address.
network 10.10.1.0 mask 255.255.255.128 //Specify the range of IP addresses that can be dynamically allocated in the global address pool.
excluded-ip-address 10.10.1.2 //Set the IP address 10.10.1.2 that is not assigned automatically in the address pool.
excluded-ip-address 10.10.1.4 //Set the IP address 10.10.1.4 that is not assigned automatically in the address pool.
dns-list 10.10.1.2 //Configure the IP address of the DNS server for the DHCP client.
nbns-list 10.10.1.4 //Configure the IP address of the NetBIOS server for the DHCP client.
lease day 10 hour 12 minute 0 //Set the IP address lease to 10 days and 12 hours.
domain-name huawei.com //Set the domain name to huawei.com.
static-bind ip-address 10.10.1.5 mac-address fc12-2567-ce34 //Assign a fixed IP address to the PC_AD.
#
ip pool ip-pool2
gateway-list 10.10.1.129 //Set the gateway IP address.
network 10.10.1.128 mask 255.255.255.128 //Specify the range of IP addresses that can be dynamically allocated in the global address pool.
dns-list 10.10.1.2 //Configure the IP address of the DNS server for the DHCP client.
lease day 5 hour 0 minute 0 //Set the IP address lease to 5 days.
domain-name huawei.com //Set the domain name to huawei.com.
#
interface GigabitEthernet0/0/0
ip address 10.10.1.1 255.255.255.128
dhcp select global //Configure the global address pool mode.
#
interface GigabitEthernet0/0/1
ip address 10.10.1.129 255.255.255.128
dhcp select global //Configure the global address pool mode.
2. Verify the configuration.
Run the display ip pool command on the router to check the IP address pool configuration.

Other related questions:
Method used to configure NAT and DHCP on the AR
Huawei AR series routers support DHCP and NAT so that users can dynamically obtain IP addresses and access the Internet. This function applies to all versions and models of the AR.

Method to configure the DHCP relay on S series switches
For S series switches excluding the S1700, when the DHCP client and the DHCP server are located on different network segments, configure a DHCP relay agent to assist the DHCP server in allocating IP addresses to DHCP clients. There is no difference of the DHCP relay configuration between all versions and models of Huawei S series switches.

Method used to configure DHCP client on the AR
The AR can function as a DHCP client to dynamically obtain configuration parameters such as an IP address from a DHCP server. This reduces the configuration costs and the errors and facilitates centralized management. Assume that RouterA functions as the DHCP client and RouterB as the DHCP server. The configuration is as follows: 1. Configure RouterA. [HUAWEI] dhcp enable //Enable the DHCP function. [HUAWEI] interface GigabitEthernet0/0/0 [HUAWEI-GigabitEthernet0/0/0] ip address dhcp-alloc //Enable the DHCP client on an interface. [HUAWEI-GigabitEthernet0/0/0] quit 2. Configure RouterB. [HUAWEI] dhcp enable //Enable the DHCP function. [HUAWEI] ip pool p1 [HUAWEI-ip-pool-p1] gateway-list 10.202.1.1 //Configure the gateway IP address. [HUAWEI-ip-pool-p1] network 10.202.1.0 mask 255.255.255.0 //Specify the range of IP addresses that can be dynamically allocated in the global address pool. [HUAWEI-ip-pool-p1] quit [HUAWEI] interface GigabitEthernet0/0/0 [HUAWEI-GigabitEthernet0/0/0] ip address 10.202.1.1 255.255.255.0 [HUAWEI-GigabitEthernet0/0/0] dhcp select global //Configure the global address pool mode. 3. Verify the configuration. Run the display ip interface brief command on RouterA to view the IP address that GE0/0/0 has obtained.

Method used to configure DHCP lease on the AR
Except for the static addresses that are assigned to clients, the IP addresses dynamically assigned by the DHCP server to clients have the lease. By default, the lease is one day. The lease can be configured as needed. You can specify the lease for the global or interface address pool. For example, the address lease in the address pool p1 is 10 days. The configuration method is as follows: - Global address pool [Huawei] ip pool p1 [Huawei-ip-pool-p1] lease day 10 Interface address pool[Huawei] interface vlanif 10 [Huawei-Vlanif10] dhcp select interface [Huawei-Vlanif10] dhcp server lease day 10 Different address pools on a DHCP server can be configured with different IP address leases, but IP addresses in one address pool must be configured with the same lease.

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