ip relay address

Function

The ip relay address command configures a DHCP server address.

The undo ip relay address command deletes the configured DHCP server address.

By default, no DHCP server address is configured.

Format

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

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

Parameters

Parameter Description Value
ip-address

Specifies the IP address of a DHCP server. A maximum of 20 DHCP server addresses can be configured for each relay interface.

The value is in dotted decimal notation.

dhcp-option code_61to254

Specifies a DHCP option ID.

The value is an integer ranging from 61 to 254.

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.

dhcp-option option-text

Specifies the Option 60 content.

The value is a string of 1 to 128 characters.

dhcp-option code_1to59

Specifies a DHCP option ID.

The value is an integer ranging from 1 to 59.

all

Indicates either of the following:

  • If ip-address is not specified, all DHCP server addresses on the interface are deleted.
  • If ip-address is specified, all configurations of the specified DHCP server address are 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

You can associate either multiple DHCP server addresses with one DHCP option or multiple DHCP options with one DHCP server address.

This command is available only on carrier IP devices.

Prerequisites

DHCP relay has been enabled using the dhcp select relay command in the interface view.

Configuration Impact

A DHCP relay agent searches for a server IP address based on DHCP options in the following ways:

  • If a DHCP message carries multiple DHCP options and these DHCP options have matching server addresses, the server 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 server address mapped to Option 60 with the character string is preferred. If no matching server address is found, the server address mapped to Option 60 without a character string is used.
  • If no server addresses map DHCP options, a server address that is not mapped to any DHCP options is used.
  • If no DHCP server address is configured, the DHCP relay agent discards the DHCP messages.

    The IP address of a DHCP server configured using the ip relay address command takes effect irrespective of whether the relay agent processes DHCP options. Relay agents process the Option 82 information only and directly forward other options carried in the DHCPv6 Request packet to the server without any processing.

Precautions

If the DHCP relay interface is configured with a VPN instance, the IP address of the DHCP server belongs to the same VPN instance. If the DHCP relay interface belongs to the public network instance, the IP address of the DHCP server belongs to the public network instance.

A maximum of 20 DHCP server addresses can be configured for every DHCP relay interface.

Example

# Configure two DHCP server addresses on GE 0/1/0.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ip relay address 10.38.1.2
[~HUAWEI-GigabitEthernet0/1/0] ip relay address 10.38.1.3
# Associate option 60 carrying the string abc with the DHCP server with the IP address 1.1.1.1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ip relay address 1.1.1.1 dhcp-option 60 abc
# Associate option 12 with the DHCP server with the IP address 1.1.1.1.
<HUAWEI> system-view
[~HUAWEI] interface GigabitEthernet 0/1/0
[~HUAWEI-GigabitEthernet0/1/0] ip relay address 1.1.1.1 dhcp-option 12
Copyright ? Huawei Technologies Co., Ltd.
Copyright ? Huawei Technologies Co., Ltd.
< Previous topic Next topic >