The dhcp server static-bind command binds an IP address in an interface address pool to a MAC address.
The undo dhcp server static-bind command unbinds the IP address in an interface address pool from a MAC address.
By default, an IP address in an interface address pool is not bound to any MAC address.
dhcp server static-bind ip-address ip-address mac-address mac-address [ description description ]
undo dhcp server static-bind [ ip-address ip-address | mac-address mac-address ]
Parameter |
Description |
Value |
---|---|---|
ip-address ip-address |
Specifies the IP address to be bound. The IP address must be valid in an interface address pool. |
The value is in dotted decimal notation. |
mac-address mac-address |
Specifies the user MAC address. |
The value is in H-H-H format. An H is a hexadecimal number of 1 to 4 digits. |
description description |
Specifies the user description. |
The value is a string of 1 to 256 case-sensitive characters. It can contain spaces. |
Usage Scenario
The dhcp server static-bind command applies to DHCP servers. When planning a network, you need to allocate fixed IP addresses to some important hosts to ensure reliability. In this case, you can bind IP addresses in the address pool to the MAC addresses of these hosts. After the preceding configuration is complete, if the host of the MAC address to which the IP address is bound request an IP address from the DHCP server, the DHCP server finds the bound IP address based on the host's MAC address and allocates this IP address to the host, ensuring that the IP address obtained by the host is fixed.
You can run the dhcp server static-bind command to bind an IP address in an interface address pool to a MAC address.
You can run the static-bind command to bind an IP address in a global address pool to a MAC address.
Prerequisites
IP addresses in the interface address pool have been configured using the ip address command.
The DHCP server function has been enabled on the interface using the dhcp select interface command.
Precautions
# Configure a DHCP server to assign a fixed IP address 10.10.10.20 in the interface address pool on vlanif 100 to a host with the MAC address 2020-e2f3-2a3b.
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface vlanif 100 [HUAWEI-Vlanif100] ip address 10.10.10.10 24 [HUAWEI-Vlanif100] dhcp select interface [HUAWEI-Vlanif100] dhcp server static-bind ip-address 10.10.10.20 mac-address 2020-e2f3-2a3b
<HUAWEI> system-view [HUAWEI] dhcp enable [HUAWEI] interface gigabitethernet 0/0/1 [HUAWEI-GigabitEthernet0/0/1] undo portswitch [HUAWEI-GigabitEthernet0/0/1] ip address 10.10.10.10 24 [HUAWEI-GigabitEthernet0/0/1] dhcp select interface [HUAWEI-GigabitEthernet0/0/1] dhcp server static-bind ip-address 10.10.10.20 mac-address 2020-e2f3-2a3b