The dhcp relay source-ip-address command configures a DHCP relay source IP address.
The undo dhcp relay source-ip-address command restores the default DHCP relay source IP address.
By default, a DHCP relay interface uses its primary IP address as the source IP address.
Parameter | Description | Value |
---|---|---|
ip-address | Specifies a DHCP relay source IP address. |
The value is in dotted decimal notation. A DHCP relay interface can have a maximum of 20 source IP addresses configured. |
dhcp-option code_60 | Indicates DHCP Option 60. Option 60 is a special DHCP option. The Option 60 field carries the vendor identifier. A maximum of 100 Option 60 fields carrying different vendor identifiers can be configured to identify clients. The vendor identifier is configured based on that used on clients. |
The value is 60. |
option-text | Specifies the Option 60 content. |
The value is a string of 1 to 128 characters. |
code_1to59 | Specifies a DHCP option ID. |
The value is an integer ranging from 1 to 59. |
code_61to254 | Specifies a DHCP option ID. |
The value is an integer ranging from 61 to 254. |
all |
The meaning of all is as follows:
|
- |
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 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, VBDIF interface view, VE sub-interface view, VLANIF interface view
Usage Scenario
In L2+L3 N:1 scenarios, DHCP request and reply messages may travel along different paths. Therefore, base stations may fail to receive DHCP relay messages and accordingly cannot go online. Two methods are available to address this problem: use DHCP Option 82 or change the source IP address and GiAddr address in DHCP messages. On live networks, however, devices of some vendors may not support DHCP Option 82. If this is the case, change the source IP address and GiAddr address in DHCP messages to allow the base stations to go online. The ip relay giaddr command configures the GiAddr address. To configure a source IP address, run the dhcp relay source-ip-address command on a DHCP relay interface.
Then the DHCP relay interface generates the mapping between DHCP options and source IP addresses. After the DHCP relay interface receives a DHCP request message, it searches for a source IP address based on the DHCP option carried in the message and fills the mapped source IP address in the source address field in the IP header of the message.Configuration Impact
The DHCP relay interface searches for a source IP address based on DHCP options in the following ways:
Precautions
The DHCP relay source IP address must be the primary or secondary IP address of the relay interface. Configuring another address as the source IP address may cause the clients to fail to obtain IP addresses.
A relay interface can have a maximum of 20 source IP addresses configured, which can be mapped to DHCP options or not. A DHCP relay source IP address can be mapped to a maximum of 254 DHCP options, but a DHCP option can be mapped to only one source IP address. The DHCP options and source IP addresses are in a many-to-one mapping. This command is mutually exclusive with the ip relay source-ip-address command.<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] dhcp relay source-ip-address 10.1.1.1 dhcp-option 60 abc
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] dhcp relay source-ip-address 10.1.1.1 dhcp-option 12
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] dhcp relay source-ip-address 10.1.1.1