< Home

Configuring the DHCPv6 Relay Function

Context

The device supports the following methods of configuring the DHCPv6 relay function:
  • Configure an IPv6 address for a DHCPv6 server or next-hop relay agent on an interface. This method applies to the scenario in which the peer of the DHCPv6 relay is connected to one DHCPv6 server or next-hop relay agent.
  • Bind a DHCPv6 server group to an interface. The detailed procedure is as follows: Create a DHCPv6 server group in the system view, add IPv6 addresses of multiple DHCPv6 servers or next-hop relay agents to the DHCPv6 server group, and specify the DHCPv6 server group for the DHCPv6 relay on an interface. This method applies to the scenario in which the peer of the DHCPv6 relay is connected to multiple DHCPv6 servers or next-hop relay agents. In this way, the DHCPv6 relay can flexibly select and uniformly manage the DHCPv6 servers or next-hop relay agents.

Multiple DHCPv6 relays can be connected between the DHCPv6 client and server. If the device functions as a DHCPv6 relay and the peer are connected to the DHCPv6 server, you must specify the IPv6 address for the DHCPv6 server when enabling the DHCPv6 relay. If the peer is connected to the next-hop relay agent, you must specify the IPv6 address for the next-hop relay agent and specify the IPv6 address for the peer DHCPv6 server or next-hop relay agent on the next-hop relay agent.

Procedure

  • Configure an IPv6 address for a DHCPv6 server or next-hop relay agent on an interface.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp enable

      The DHCP service is enabled.

    3. Run ipv6

      The IPv6 packet forwarding function is enabled.

    4. Run interface interface-type interface-number

      The interface view is displayed.

    5. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    6. Run ipv6 enable

      The IPv6 packet forwarding function is enabled.

    7. Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }

      The IPv6 address for the interface is configured.

    8. Run dhcpv6 relay { destination ipv6-address | interface interface-type interface-number }

      The DHCPv6 relay function is enabled on the interface, and the IPv6 address for the DHCPv6 server or next-hop relay agent is configured.

      By default, the DHCPv6 relay function is disabled on an interface.

      The configured IPv6 address is a global unicast address or unique local address. The device finds the route and sends relay packets to the configured IPv6 address.

      If the peer of the DHCPv6 relay is connected to multiple DHCPv6 servers or next-hop relay agents, you must repeat this step. The device supports a maximum of eight DHCPv6 servers or next-hop relay agents.

      The device supports a maximum of 4094 interfaces with the DHCPv6 relay function enabled.

    9. (Optional) Run dhcpv6 relay source-interface interface-type interface-number

      The IPv6 address of an interface is configured as the source IPv6 address of packets.

      By default, the IPv6 address of an interface is not configured as the source IPv6 address of packets.

      Currently, only the IPv6 address of a loopback interface can be configured as the source IPv6 address of packets.

    10. (Optional) Run dhcpv6 relay advertise prefix-delegation route

      The DHCPv6 relay agent is configured to forward routing information of DHCPv6 PD terminals.

      By default, a DHCPv6 relay agent does not forward routing information of DHCPv6 PD terminals.

      This command takes effect only for the first-hop DHCPv6 relay agent connected to DHCPv6 PD terminals.

    11. Run quit

      Return to the system view.

    12. (Optional) Run dhcpv6 relay prefix-delegation route autosave file-name

      Routing information forwarded by a relay agent is saved to a specified file.

      By default, routing information forwarded by a relay agent is not saved to a specified file.

  • Bind a DHCPv6 server group to an interface.
    1. Run system-view

      The system view is displayed.

    2. Run dhcp enable

      The DHCP service is enabled.

    3. Run ipv6

      The IPv6 packet forwarding function is enabled.

    4. Run dhcpv6 server group group-name

      The DHCPv6 server group is created.

      By default, no DHCPv6 server group is created.

    5. Run dhcpv6-server ipv6-address [ interface interface-type interface-number ]

      The member address of the DHCPv6 server or next-hop relay agent is added to the DHCPv6 server group.

      By default, no member of the DHCPv6 server or next-hop relay agent is configured in the DHCPv6 server group.

      If the peer of the DHCPv6 relay is connected to multiple DHCPv6 servers or next-hop relay agents, you must repeat this step. The device supports a maximum of 20 DHCPv6 servers or next-hop relay agents.

    6. Run quit

      Return to the system view.

    7. Run interface interface-type interface-number

      The interface view is displayed.

    8. (Optional) On an Ethernet interface, run undo portswitch

      The interface is switched to Layer 3 mode.

      By default, an Ethernet interface works in Layer 2 mode.

      Only the S5720-EI, S5720-HI, S5730-HI, S5731-H, S5731-S, S5731S-H, S5731S-S, S5732-H, S6720-EI, S6720-HI, S6720S-EI, S6730-H, S6730S-H, S6730-S, and S6730S-S support switching between Layer 2 and Layer 3 modes.

    9. Run ipv6 enable

      The IPv6 packet forwarding function is enabled.

    10. Run ipv6 address { ipv6-address prefix-length | ipv6-address/prefix-length }

      The IPv6 address for the interface is configured.

    11. Run dhcpv6 relay server-select group-name

      The DHCPv6 server group is specified for the DHCPv6 relay.

      By default, no DHCPv6 server group is specified.

    12. (Optional) Run dhcpv6 relay source-interface interface-type interface-number

      The IPv6 address of an interface is configured as the source IPv6 address of packets.

      By default, the IPv6 address of an interface is not configured as the source IPv6 address of packets.

      Currently, only the IPv6 address of a loopback interface can be configured as the source IPv6 address of packets.

    13. (Optional) Run dhcpv6 relay advertise prefix-delegation route

      The DHCPv6 relay agent is configured to forward routing information of DHCPv6 PD terminals.

      By default, a DHCPv6 relay agent does not forward routing information of DHCPv6 PD terminals.

      This command takes effect only for the first-hop DHCPv6 relay agent connected to DHCPv6 PD terminals.

    14. Run quit

      Return to the system view.

    15. (Optional) Run dhcpv6 relay prefix-delegation route autosave file-name

      Routing information forwarded by a relay agent is saved to a specified file.

      By default, routing information forwarded by a relay agent is not saved to a specified file.

Follow-up Procedure

When the DHCPv6 relay agent functions as the gateway for clients, you need to configure the M/O flag of RA messages on the DHCPv6 relay-enabled interface to make the clients obtain IPv6 addresses or other network configuration parameters using DHCPv6.

After the M flag of RA messages is configured, the clients can obtain IPv6 addresses using DHCPv6. After the O flag of RA messages is configured, the clients can obtain other network configuration parameters using DHCPv6.

  1. Run system-view

    The system view is displayed.

  2. Run interface interface-type interface-number

    The interface view is displayed.

  3. Run undo ipv6 nd ra halt

    The RA message advertisement function is enabled on the device.

    By default, the RA message advertisement function is disabled on a device.

  4. Run ipv6 nd autoconfig managed-address-flag

    The M flag of stateful address autoconfiguration in an RA message is configured.

    By default, the M flag of stateful address autoconfiguration in an RA message is not configured.

  5. Run ipv6 nd autoconfig other-flag

    The O flag of stateful autoconfiguration of other information in an RA message is configured.

    By default, the O flag of stateful autoconfiguration of other information in an RA message is not configured.

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