Example for Configuring DHCPv6 Relay


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.

NOTE:

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.

Networking Requirements

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:

  1.   Enable the DHCPv6 relay function on L3 VLAN interface.
  2.   Configure the IP address of DHCPv6 server or the next-hop DHCPv6 relay device.

Procedure

Step 1        Configure VLAN interfaces.

admin@Xorplus# set vlans vlan-id 10
admin@Xorplus# set vlans vlan-id 20
admin@Xorplus# set vlans vlan-id 30
admin@Xorplus# set interface gigabit-ethernet ge-1/1/1 family ethernet-switching native-vlan-id 10
admin@Xorplus# set interface gigabit-ethernet ge-1/1/2 family ethernet-switching native-vlan-id 20
admin@Xorplus# set interface gigabit-ethernet ge-1/1/3 family ethernet-switching native-vlan-id 30
admin@Xorplus# set vlans vlan-id 10 l3-interface vlan10
admin@Xorplus# set vlans vlan-id 20 l3-interface vlan20
admin@Xorplus# set vlans vlan-id 30 l3-interface vlan30
admin@Xorplus# set l3-interface vlan-interface vlan10 address fc00:1::1 prefix-length 64
admin@Xorplus# set l3-interface vlan-interface vlan20 address fc00:2::1 prefix-length 64
admin@Xorplus# set l3-interface vlan-interface vlan30 address fc00:3::1 prefix-length 64

Step 2        Enable IP routing function when using DHCPv6 relay.

admin@XorPlus# set ip routing enable true

Step 3        Enable the DHCPv6 relay function on L3 VLAN interface vlan10 and vlan20.

admin@XorPlus# set protocols dhcp6 relay interface vlan10 disable false
admin@XorPlus# set protocols dhcp6 relay interface vlan20 disable false

Step 4        Configure the IP address of DHCPv6 server.

admin@XorPlus# set protocols dhcp6 relay interface vlan10 destination fc00:3::3
admin@XorPlus# set protocols dhcp6 relay interface vlan20 destination fc00:3::3

Step 5        Configure to advertise RA messages and configure the M flag bit.

admin@XorPlus# set l3-interface vlan-interface vlan10 ipv6-nd suppress-ra false
admin@XorPlus# set l3-interface vlan-interface vlan10 ipv6-nd prefix fc00:1::0/64 router-address
admin@XorPlus# set l3-interface vlan-interface vlan10 ipv6-nd managed-config-flag

Step 6        Commit the configuration.

admin@XorPlus# commit

Step 7        Verify the configuration.

  • After the configuration is complete, run the show protocols dhcp6 relay command to view the configuration of DHCPv6 relay.
admin@XorPlus# show protocols dhcp6 relay
    interface vlan10 {
        disable: false
        destination fc00:3::3
    }
    interface vlan20 {
        disable: false
        destination fc00:3::3
    }
  • Run the run show dhcp6 relay-stats command to view DHCPv6 relay running status and statistics.
admin@Xorplus# run show dhcp6 relay-stats 
Vif Name        Rx        Tx
------------------------------------
vlan10          6866      1626         
vlan20          2455      896        
Total 2 Vif(s) enabled with DHCP6 relay
  • DHCPv6 client can obtain the IP address normally.


Copyright © 2024 Pica8 Inc. All Rights Reserved.