The ip relay giaddr command configures a relay agent address in the interface view.
The undo ip relay giaddr command deletes the configured relay agent address.
By default, the primary IP address of the interface functions as the relay agent address.
Parameter | Description | Value |
---|---|---|
ip-address | Specifies the IP address of a relay agent. A maximum of 256 relay agent addresses can be configured for each relay interface. |
The value is in dotted decimal notation. |
dhcp-option code_60 | Indicates DHCP Option 60. 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 an integer 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 |
Indicates either of the following:
|
- |
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
After a DHCP relay agent receives a DHCP Request message, it fills in the giaddr field with a relay agent address based on the association between DHCP options and relay agent addresses. The DHCP server then assigns IP addresses of different network segments to clients based on the relay agent address in the field.
The relay agent address can be either the primary or secondary IP address of the relay interface. If you configure an IP address other than the primary or secondary IP address, DHCP clients may not obtain IP addresses properly. A maximum of 255 secondary IP addresses can be configured for an interface, and therefore, a maximum of 256 relay agent addresses can be configured. If no relay agent address is associated with a DHCP option, the primary IP address is used as the relay agent address by default. One relay agent address can be associated with many DHCP options, but one DHCP option can be associated with only one relay agent address.Configuration Impact
A DHCP relay interface searches for a relay agent address based on DHCP options in the following ways:
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] ip relay giaddr 1.1.1.1 dhcp-option 60 abc
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] ip relay giaddr 1.1.1.1 dhcp-option 12
<HUAWEI> system-view [~HUAWEI] interface GigabitEthernet 0/1/0 [~HUAWEI-GigabitEthernet0/1/0] ip relay giaddr 1.1.1.1