A DHCPv6 relay agent enables the DHCPv6 client and server on different links to exchange DHCPv6 messages. The DHCPv6 relay agent forwards DHCP messages to the destination DHCPv6 server on a different network segment. DHCPv6 clients on multiple networks can share one DHCPv6 server.
Multiple DHCPv6 relays can be configured between the DHCPv6 client and server. If a device functions as a DHCPv6 relay and it is directly connected to the DHCPv6 server then you need to specify the IPv6 address of the DHCPv6 server when enabling the DHCPv6 relay feature. If the DHCPv6 relay device is connected to a next-hop relay device then you need to specify the IPv6 address of the next-hop relay device. All the intermediate relay devices are configured with the next-hop device's IPv6 address until the server's IPv6 address is configured on the last relay device in the chain which has a direct connection to the DHCP6 server.
DHCPv6 relay supports VRF function by binding the VLAN interface to a specified VRF.
The following configuration example shows how to configure a DHCPv6 relay to assign IPv6 addresses to the clients in multiple network segments.
As shown in Figure 1, the DHCPv6 clients in two network segments fc00:1::/64 and fc00:2::/64 want to dynamically obtain IPv6 addresses from the DHCPv6 server when the DHCPv6 server and clients are in different subnets. The addresses fc00:1::1/64 and fc00:2::1/64 on Switch A are used as the gateway addresses of the clients in network segments fc00:1::/64 and fc00:2::/64.
Figure 1. Networking diagram for configuring DHCPv6 relay
Configure the DHCPv6 relay function on Switch A to forward DHCPv6 packets between the DHCPv6 server and clients so that the clients can dynamically obtain IPv6 addresses.
Switch A is used as a DHCPv6 relay device. DHCPv6 clients can communicate with the DHCPv6 server in a different subnet through DHCPv6 relay to obtain IPv6 addresses from the DHCPv6 server's IPv6 address pool and other configuration information. Using a common DHCPv6 server in this manner not only saves the cost but also facilitates centralized management.
To enable DHCPv6 relay, there are two key steps that should be configured:
- Enable the DHCPv6 relay function on L3 VLAN interface.
- Configure the IP address of DHCPv6 server or the next-hop DHCPv6 relay device.
Step 1 Configure VLAN interfaces.
Step 2 Enable IP routing function when using DHCPv6 relay.
Step 3 Enable the DHCPv6 relay function on L3 VLAN interface vlan10 and vlan20.
Step 4 Configure the IP address of DHCPv6 server.
Step 5 Commit the configuration.
Step 6 Verify the configuration.
- After the configuration is complete, run the show protocols dhcp6 relay command to view the configuration of DHCPv6 relay.
- Run the run show dhcp6 relay-stats command to view DHCPv6 relay running status and statistics.
- DHCPv6 client can obtain the IP address normally.