< Home

(Optional) Inserting the Interface-ID or Remote-ID Option Information into DHCPv6 Messages

Context

Some DHCPv6 servers can allocate IPv6 addresses and other network parameters to clients according to the client location information. The DHCPv6 protocol defines the Interface-ID option and Remote-ID option that can record the client location information, including the inbound interface on the device that receives DHCPv6 Request packets and DUID information of clients. If the device functions as a DHCPv6 relay agent, the Interface-ID option or Remote-ID option can be added in DHCPv6 packets.

If the device functions as a DHCPv6 snooping device or a lightweight DHCPv6 relay agent, the client location information can be added in DHCPv6 packets. For detailed configuration, see Inserting the Option 18 or Option 37 Field in a DHCPv6 Message or Configuring the LDRA to Detect Client Locations in "DHCP Snooping Configuration" in the S2720, S5700, and S6700 V200R019C10 Configuration Guide - Security.

After DHCPv6 packets are configured to contain the Interface-ID option or Remote-ID option, the device adds the Interface-ID option or Remote-ID option in DHCPv6 Request packets sent by clients according to the configuration, constructs Relay-Forward packets, and sends the packets to the DHCPv6 server. The DHCPv6 server allocates IPv6 addresses and other network parameters to clients according to the options, and sends Relay-Reply packets to the DHCPv6 relay agent. After receiving the Relay-Reply packets, the DHCPv6 relay agent removes the Interface-ID option or Remote-ID option, and forwards the packets to clients or other relay agents.

Procedure

  1. Run system-view

    The system view is displayed.

  2. (Optional) Run the following commands to configure the format of the Interface-ID option or Remote-ID option.
    1. Run dhcpv6 interface-id format { default | user-defined text }

      The Interface-ID option format in DHCPv6 packets is configured.

      By default, the Interface-ID option format in DHCPv6 packets is default, that is, %04svlan.%04cvlan.%mac:%portname.

      If the user-defined parameter is specified, you can define the option format using the following defining methods:
      • Keyword defining method: You can define the format according to keywords supported by the self-defined format. For example, you can define the format as %sysname %svlan when you need to record the name of the device that users connect to and the outer VLAN that users belong to. If the name of the device that users connect to is HUAWEI and the outer VLAN that users belong to is 100, the user location information recorded in the Interface-ID option is HUAWEI 100.

        [HUAWEI] dhcpv6 interface-id format user-defined "%sysname %svlan"
      • Common character string defining method: The Interface-ID option can be defined as a character string. For example, if all users connected to the interface are in an office building named N8, you can define the content of the Interface-ID option as N8.

        [HUAWEI] dhcpv6 interface-id format user-defined "N8"
      • Mixed defining method: The Interface-ID option format is defined based on keywords and common character strings. For example, the Interface-ID option format can be defined as %sysname N8.

        [HUAWEI] dhcpv6 interface-id format user-defined "%sysname N8"

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

      The Remote-ID option format in DHCPv6 packets is configured.

      By default, the Remote-ID option format in DHCPv6 packets is default, that is, %duid %portname:%04svlan.%04cvlan.

      The configuration of the self-defined option format is the same as that of the Interface-ID option.

      By default, the device adds the Interface-ID option in DHCPv6 packets. If the Remote-ID option needs to be added, run the following commands to enable the function of adding the Remote-ID option in DHCPv6 packets.

  3. Run interface interface-type interface-number

    The interface view is displayed.

  4. Run dhcpv6 remote-id insert enable or dhcpv6 remote-id rebuild enable

    The function of adding the Remote-ID option in DHCPv6 packets is enabled.

    By default, the function of adding the Remote-ID option in DHCPv6 packets is disabled.

  5. Run dhcpv6 interface-id insert enable

    The function of adding the Interface-ID option in DHCPv6 packets is enabled.

    By default, the function of adding the Interface-ID option in DHCPv6 packets is enabled.

Copyright © Huawei Technologies Co., Ltd.
Copyright © Huawei Technologies Co., Ltd.
< Previous topic Next topic >