September 22, 2023
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 192.168.10.0 mask 255.255.255.0
[Huawei-ip-pool-dhcp-all]list of gateways 192.168.10.254
[Huawei-ip-pool-dhcp-all]dns-list 8.8.8.8 114.114.114.114; set preferred and alternate DNS
[Huawei-ip-pool-dhcp-all]3 day lease; set lease term
[Huawei-ip-pool-dhcp-all] excluded-ip-address 192.168.10.25 192.168.10.50 ; IP address not assigned
[Huawei-ip-pool-dhcp-all]static-bind ip-address 192.168.2.10 [Huawei-ip-pool-dhcp-all]mac-address 0001-1111-2222; assign fixed ip to fixed mac
[Huawei-ip-pool-dhcp-all]q
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 192.168.10.254 24
[Huawei-GigabitEthernet0/0/0]dhcp select global ; Enable DHCP global distribution function under interface and configure global mode;
[Huawei-GigabitEthernet0/0/0]this
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!