September 22, 2023

Automatically assign IP addresses to computer terminals through routers

When there are a lot of computer terminals in our network, we can automatically assign IP addresses to them via DHCP. There are several configuration methods for configuring DHCP: global, interface address pool, and relay;

Dhcp select relay - open relay mode

dhcp select global - select global configuration mode

dhcp select interface - select interface configuration mode

The following configuration method uses router to assign IP addresses to computer terminals on the network:

R1 mock router configuration code:

browse system

[Huawei]ip pool dhcp-name; create an address pool

[Huawei-ip-pool-dhcp-all]network mask

[Huawei-ip-pool-dhcp-all]list of gateways

[Huawei-ip-pool-dhcp-all]dns-list; set preferred and alternate DNS

[Huawei-ip-pool-dhcp-all]3 day lease; set lease term

[Huawei-ip-pool-dhcp-all] excluded-ip-address ; IP address not assigned

[Huawei-ip-pool-dhcp-all]static-bind ip-address [Huawei-ip-pool-dhcp-all]mac-address 0001-1111-2222; assign fixed ip to fixed mac


Enable DHCP

[Huawei]Enable DHCP

[Huawei-GigabitEthernet0/0/0]Display a brief description of interface

[Huawei]GigabitEthernet interface 0/0/0

[Huawei-GigabitEthernet0/0/0]IP address 24

[Huawei-GigabitEthernet0/0/0]dhcp select global ; Enable DHCP global distribution function under interface and configure global mode;


After configuration is complete, you can use ipconfig/renew on client PC1 and PC2 to get IP address

Related DHCP commands:

ipconfig /release - release an IP addressipconfig /renew - reacquire an IP address

Welcome, pay attention!