< Home

dhcp server static-bind

Function

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.

Format

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 ]

Parameters

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.

Views

Interface view

Default Level

2: Configuration level

Usage Guidelines

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

  1. The DHCP function has been enabled using the dhcp enable command in the system view.
  2. IP addresses in the interface address pool have been configured using the ip address command.

  3. The DHCP server function has been enabled on the interface using the dhcp select interface command.

Precautions

  • Ensure that the bound IP address is not configured as the IP address that cannot be allocated using the dhcp server excluded-ip-address command.
  • IP addresses that are used can also be statically bound to MAC addresses or unbound from MAC addresses. When an IP address is statically bound to a MAC address, ensure that the MAC address to be bound is the same as the MAC address of the user who actually uses the IP address.
  • The DHCP server preferentially allocates the IP address that has been statically bound to the client's MAC address.
  • After an IP address is bound to a MAC address, the IP address does not expire. After an automatically allocated IP address is statically bound to a MAC address, the lease time of the IP address becomes unlimited. After the static binding between the IP address and the MAC address is deleted, the lease time of the IP address becomes the same as that configured in the address pool.

Example

# 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
# Configure a DHCP server to assign a fixed IP address 10.10.10.20 in the interface address pool on GE0/0/1 to a host with the 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
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >