< Home

dhcpv6 remote-id format

Function

The dhcpv6 remote-id format command sets the format of the Remote-ID in DHCPv6 messages.

The undo dhcpv6 remote-id format command restores the default format of the Remote-ID in DHCPv6 messages.

By default, the default format of the Remote-ID in DHCPv6 messages is used.

Format

dhcpv6 remote-id format { default | user-defined text }

undo dhcpv6 remote-id format

Parameters

Parameter

Description

Value

default

Indicates to adopt the default format of the remote ID. The default format of the remote ID is %duid %portname:%04svlan.%04cvlan, where the values of the outer VLAN ID and inner VLAN ID are integers and composed of four characters. If the length is shorter than four characters, 0s are prefixed to the value. For example, if the outer VLAN value in the DHCPv6 packets received by the device is 11, the inner VLAN value is 22, the inbound interface is GE0/0/1, and the client DUID is 0003000180FB063545B3, the Remote-ID option generated during the system parsing process is 0003000180FB063545B3 GigabitEthernet 0/0/1:0011.0022.

-

user-defined text

Specifies a user-defined format as the Remote-ID format. A user-defined format can be:
  • Format defined by keywords: The Remote-ID is defined based on the keywords supported by the user-defined format. For example, if the name of the device to which the users are connected and the outer VLAN to which the users belong need to be recorded, the user-defined format can be %sysname %svlan. If the device name is HUAWEI and the S-VLAN is 100, the user location information recorded by the Remote-ID is HUAWEI 100.

    For description of the keywords supported by the user-defined format, see Table 1.

  • Format defined by common character strings: The Remote-ID is directly defined as a character string. For example, if all users on an interface are located in the office building named N8, the Remote-ID can be directly defined as N8.

  • Mixed format: The Remote-ID is defined by both the keywords and common character strings. For example, the Remote-ID can be defined as %sysname N8.

The value is a string of 3 to 247 case-sensitive characters with spaces.

Views

System view

Default Level

2: Configuration level

Usage Guidelines

Use Scenario

The Remote-ID records user access information such as the DUID of the DHCPv6 packets sent from the clients to the device. The device functions as a DHCPv6 relay or lightweight DHCPfv6 relay agent (LDRA). When receiving the request packets sent from the DHCPv6 clients and forwarding the packets to the DHCPv6 server, the device can insert the Remote-ID to the packets to identify the DHCPv6 client location information. The location information can be used by the DHCPv6 server to assign IPv6 addresses and network parameters. You can run the dhcpv6 remote-id format command to configure the format of the Remote-ID inserted into DHCPv6 packets.

Table 1 Description of the keywords supported by the user-defined format

Keyword

Description

duid

Specifies the client ID, including information such as the client MAC address.

sysname

Specifies the device name of the client.

portname

Specifies the name of the inbound interface that receives the DHCPv6 packets sent from the client to the device.

porttype

Specifies the type of the inbound interface that receives the DHCPv6 packets sent from the client to the device. The interface type is specified when the NAS interface is configured in certain scenarios.

iftype

Specifies the type of the inbound interface that receives the DHCPv6 packets sent from the client to the device. The interface type is usually GE.

mac

Specifies the device MAC address.

slot

Specifies the slot number of the DHCPv6 packet sent from the client to the device.

subslot

Specifies the sub-slot number of the DHCPv6 packet sent from the client to the device.

port

Specifies the port number of the DHCPv6 packet sent from the client to the device.

svlan

Specifies the outer VLAN of the DHCPv6 packet sent by the client.

cvlan

Specifies the inner VLAN of the DHCPv6 packet sent by the client.

length

Specifies the total length of the keywords following the length keyword. The length of the length keyword is excluded.

Follow-up Procedure

When the device functions as a DHCPv6 relay, you must run the dhcpv6 remote-id insert enable or dhcpv6 remote-id rebuild enable command to enable the function of inserting the Remote-ID into DHCPv6 relay packets after running the dhcpv6 remote-id format command to configure the Remote-ID format in DHCPv6 packets.

When the device functions as an LDRA, the Remote-ID is inserted into DHCPv6 relay packets by default and the function does not need to be enabled.

Precautions

  • The user-defined format content must be specified between the double quotation marks (""). For example, to configure the user-defined format content as mac, run the dhcpv6 interface-id format user-defined "%mac" command.

  • Separators that cannot be digits must be added between the keywords in the user-defined format. Otherwise, the keywords cannot be parsed.

  • The symbol % must be prefixed to the keywords in the user-defined format to differentiate them from common character strings. If a digit exists before the symbol % and keyword, the digit refers to the number of characters in the keyword.

  • The self-defined content is encapsulated in ASCII format. In addition to the preceding precautions, note the following rules:

    • The symbol \ is an escape character. The symbols %, \, and [] following the escape character indicate themselves. For example, \\ represents the character \.
    • An ASCII character string can contain Arabic numerals, uppercase letters, lowercase letters, and the following symbols: ! @ # $ % ^ & * ( ) _ + | - = \ [ ] { } ; : ' " / ? . , < > `.
    • By default, the length of each keyword in an ASCII character string is the actual length of the keyword.

Example

# Set the customized format for the remote ID carried in DHCPv6 messages and encapsulate the MAC address of the device into the remote ID.

<HUAWEI> system-view
[HUAWEI] dhcpv6 remote-id format user-defined "%mac"
Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >