ip address dhcp-alloc

Function

The ip address dhcp-alloc command enables the DHCP client function on an interface.

The undo ip address dhcp-alloc command disables the DHCP client function from an interface.

By default, the DHCP client function is not enabled on an interface.

Format

ip address dhcp-alloc

undo ip address dhcp-alloc

Parameters

None

Views

100ge sub-interface view, 100GE interface view, 10GE sub-interface view, 10GE interface view, 200GE sub-interface view, 25GE sub-interface view, 25GE interface view, 400GE sub-interface view, 400GE interface view, 40GE sub-interface view, 40GE interface view, 50GE sub-interface view, 50GE interface view, Eth-Trunk sub-interface view, Eth-Trunk interface view, FlexE sub-interface view, FlexE interface view, GE optical interface view, GE sub-interface view, GE interface view, GE electrical interface view, Global VE sub-interface view, PW-VE sub-interface view, VE sub-interface view, VLANIF interface view, Sub-interface view, Management interface view

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
dhcp write

Usage Guidelines

Usage Scenario

To allow a device to dynamically obtain an IP address from the DHCP server by means of DHCP, run the ip address dhcp-alloc command to enable the DHCP client function on an interface.

After the DHCP client function is enabled, the interface can send a DHCP request packet to the DHCP server. Upon receipt of the request packet, the DHCP server replies with a DHCP response packet. The device can then obtain information about the assigned IP address from the DHCP response packet.

Precautions

  • When multiple logical interfaces apply for an IP address from the same DHCP server, configure different MAC addresses for the logical interfaces. Otherwise, address assignment may fail.
  • After the DHCP client function is enabled on an interface, the interface cannot process FORCE RENEW packets any more.
  • When the DHCP client function is enabled on an interface, the dynamic IP address allocated to the DHCP client may conflict with the MAP public address segment. As a result, the MAP function fails to take effect. Therefore, avoid IP address conflict or overlapping during network planning.
  • For scenarios where the DHCP client function is enabled on the logical interface, after deleting the logical interface, the RELEASE message may fail to be sent. It causes that the corresponding address in the server cannot be immediately recovered.

Example

# Enable the DHCP client function on GE 0/1/0.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ip address dhcp-alloc
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >