dhcp relay source-ip-address

Function

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.

Format

dhcp relay source-ip-address ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } ]

undo dhcp relay source-ip-address { all | ip-address [ dhcp-option { code_60 [ option-text ] | code_1to59 | code_61to254 } | all ] }

Parameters

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:

  • If no DHCP relay source IP address is specified, all DHCP relay source IP addresses on the interface are deleted.
  • If a DHCP relay source IP address is specified, the specified DHCP relay source IP address on the interface is deleted.

-

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 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

Default Level

2: Configuration level

Task Name and Operations

Task Name Operations
dhcp write

Usage Guidelines

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:

  • If a DHCP message carries multiple DHCP options and these DHCP options have matching source IP addresses, the source IP address mapped to the DHCP option with the largest number is used.
  • If DHCP Option 60 is specified and a character string is configured for Option 60, the source IP address mapped to Option 60 with the character string is preferred. If no matching source IP address is found, the source IP address mapped to Option 60 without a character string is used.
  • If no source IP addresses map DHCP options, a source IP address that is not mapped to any DHCP options is used.
  • If no DHCP relay source IP address is configured, the primary IP address of the DHCP relay interface is used as the source IP address by default.

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.

Example

# Map DHCP Option 60 with the content abc to the DHCP relay source IP address 10.1.1.1.
<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
# Map DHCP Option 12 to the DHCP relay source IP address 10.1.1.1.
<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
# Configure the IP address 10.1.1.1 of GE 0/1/0 as the DHCP relay source IP address.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] dhcp relay source-ip-address 10.1.1.1
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >