DHCPv6 relay agent configuration example

Network requirements

As shown in Figure 59, the network address prefix of DHCPv6 clients is 1::/64, and the IPv6 address of the DHCPv6 server is 2::2/64. The DHCPv6 client and server need to communicate via a DHCPv6 relay agent (Switch A).

Switch A acts as the gateway of network 1::/64. It sends RA messages to notify the hosts to obtain IPv6 addresses and other configuration parameters through DHCPv6.

Figure 59: DHCPv6 relay agent configuration

Configuration procedure

  1. Configure Switch A as a DHCPv6 relay agent

# Enable the IPv6 packet forwarding function.

<SwitchA> system-view
[SwitchA] ipv6

# Configure the IPv6 addresses of VLAN-interface 2 and VLAN-interface 3 respectively.

[SwitchA] interface vlan-interface 2
[SwitchA-Vlan-interface2] ipv6 address 2::1 64
[SwitchA-Vlan-interface2] quit
[SwitchA] interface vlan-interface 3
[SwitchA-Vlan-interface3] ipv6 address 1::1 64

# Enable DHCPv6 relay agent and specify the DHCPv6 server address on VLAN-interface 3.

[SwitchA-Vlan-interface3] ipv6 dhcp relay server-address 2::2
  1. Configure Switch A as a gateway

# Enable Switch A to send RA messages and turn on the M and O flags.

[SwitchA-Vlan-interface3] undo ipv6 nd ra halt
[SwitchA-Vlan-interface3] ipv6 nd autoconfig managed-address-flag
[SwitchA-Vlan-interface3] ipv6 nd autoconfig other-flag

Verification

# After completing the configurations, display DHCPv6 server address information on Switch A.

[SwitchA-Vlan-interface3] display ipv6 dhcp relay server-address all
Interface: Vlan3
Server address(es)                             Output Interface
2::2

# Display packet statistics on the DHCPv6 relay agent.

[SwitchA-Vlan-interface3] display ipv6 dhcp relay statistics
Packets dropped               :  0
    Error                     :  0
    Excess of rate limit      :  0
Packets received              :  14
    SOLICIT                   :  0
    REQUEST                   :  0
    CONFIRM                   :  0
    RENEW                     :  0
    REBIND                    :  0
    RELEASE                   :  0
    DECLINE                   :  0
    INFORMATION-REQUEST       :  7
    RELAY-FORWARD             :  0
    RELAY-REPLY               :  7
Packets sent                  :  14
    ADVERTISE                 :  0
    RECONFIGURE               :  0
    REPLY                     :  7
    RELAY-FORWARD             :  7
    RELAY-REPLY               :  0