TOP  

DHCPv6 – The Absolute Guide

Welcome to the Absolute Guide to DHCPv6, your one-stop shop for understanding and implementing the Dynamic Host Configuration Protocol for IPv6 (DHCPv6). 

It is an evolution of the well-established DHCP protocol, designed to overcome the limitations of DHCP in IPv6 networks

DHCPV6 Guide

This guide will walk you through the ins and outs of DHCPv6, from the basics to advanced configurations. Whether you’re managing a mid-sized enterprise or setting up a small home network, this guide will give you the basic knowledge you need to use it effectively.

Table of Contents.

  1. Introduction to DHCPv6.
  2. Network Elements of DHCPv6.
  3. Server and Its Configuration.
  4. Client Mechanics and Configuration.
  5. Troubleshooting DHCPv6 Issues.
  6. DHCPv6 FAQ.
  7. Final Words.

1. Introduction to DHCPv6

Dynamic Host Configuration Protocol for IPv6 is a network protocol used to automatically configure IPv6 network settings on hosts. 

It is the evolution of DHCP (or DHCPv4— see IPv6 vs IPv4). This latest protocol “DHCPv6” was developed to address the limitations of DHCP in IPv6 networks. It is similar to DHCPv4 in terms of configuring network settings on the host, but it adds more advanced capabilities. It is used to ‘dynamically’ configure the following on hosts:

  • IPv6 address
  • Prefix length
  • Default gateway
  • DNS server addresses
  • Domain name

DHCPv6 is typically used in medium to large networks, where it is used for host configuration management. It can also be used in home networks, where it can be used to automatically configure the network settings of devices such as computers, printers, and routers.

a. Limitations of DHCP(v4) and what DHCPv6 does to solve them.

One of the limitations of DHCPv4 in IPv6 networks is that it does not support the use of Stateless Address AutoConfiguration (SLAAC). SLAAC is a mechanism that allows hosts to automatically configure their own IPv6 addresses, without the need for a DHCP server or manual configuration. DHCPv6 on the other hand, supports the use of SLAAC.

Another limitation of DHCP in IPv6 networks is that it doesn’t support multiple subnets. On the other hand, the protocol supports multiple subnets, so hosts can get their IPv6 addresses from a DHCPv6 server on a different subnet.

Overall, the IPv6 version is a more advanced protocol than DHCP. It addresses the limitations of DHCP in IPv6 networks and provides more features and functionality.

2. Network Elements of DHCPv6. 

The components involved in DHCPv6 communication are the Client, Server, Router (RA Messages), and the Relay Agent (Optional).

The following diagram shows how these elements work with each other. 

How DHCPV6 works?

Here’s an explanation of the elements shown in the diagram:

  • DHCPv6 Client: These are devices that initiate the communication by sending messages to request IPv6 addresses or other configuration details from the server.
  • DHCPv6 Server: The server is the central device that responds to the client’s requests. It assigns IPv6 addresses and provides other network configuration parameters. It communicates with the clients using protocol messages and is identified by a DUID (DHCP Unique Identifier). More on the server (role, responsibilities, and configuration) in the next section. 
  • DHCPv6 Messages (MSG): These are the various messages sent between the clients, server, and relay agent. They help lease IPv6 addresses and set up the network.
  • DUID: Clients and the server have a DUID (DHCP Unique Identifier). Components use this identifier in their communications to ensure unique and persistent identity in the protocol process.
  • Router (RA Messages): This is a router that sends out Router Advertisement (RA) messages as part of the IPv6 Neighbor Discovery Protocol (NDP). These messages can tell the clients about the presence of a DHCPv6 server, and whether they should use that protocol, Stateless Address Autoconfiguration (SLAAC), or both.
  • DHCPv6 Relay Agent: The relay agent is a network device that relays messages between clients and the server, especially when they are not on the same local network. 

3. Server and Its Configuration

The DHCPv6 server has two main roles. It allocates IP addresses to the clients and provides them with configuration options.  messages can contain a variety of options, including IPv6 addresses, prefix length, DNS servers, domain name, and more. 

Additionally, the server also has several responsibilities, including:

  • Managing IP address leases: The server tracks the IP address leases for DHCPv6 clients.
  • Providing DHCPv6 options: The server provides DHCPv6 options to the clients.
  • Reporting DHCPv6 activity: The server reports the activity to the network administrator.

To start with a DHCPv6 server, you will need to install, configure, and enable the server software. In the following section, we will go through the details of how to begin with such a server. 

a. The DHCPv6 server software.

There are several popular server software solutions available out there. Some of the most popular ones that support DHCPv6 include ISC DHCP Server, Dnsmasq, Microsoft DHCP Server, Cisco IOS DHCP Server, and Red Hat Enterprise Linux (RHEL) DHCP.

Each of these servers has its own strengths, and the best choice often depends on the specific requirements of the network, such as scale, complexity, existing infrastructure, and administrative expertise.

b. Setting Up a DHCPv6 Server

As an example let’s see the server configuration of Red Hat Enterprise Linux 6. The configuration file for the DHCPv6 server is located at /etc/dhcp/dhcpd6.conf.

b.1. Prerequisites.

  • Ensure that the server has a configuration that matches the network segment of the correct interface (i.e. eth0). The DHCP server needs a subnet6 (IPv6 subnet address) declaration that corresponds to the network to which eth0 is connected.
  • Have the IPv6 address (subnet and range), Prefix length, Default gateway (if not given by RA), DNS server addresses, and Domain name (if necessary). Other relevant parameters that can be configured in the server are max leased time, default lease time, preferred lifetime, valid lifetime, NTP servers, SIP servers, DUID (DHCP Unique Identifier), and more. 

Note: The package names shown in this DHCPv6 guide might be different or not available in the repositories currently enabled on your Red Hat Enterprise Linux system.

b.2. Installing the dhcp package.

If the DHCP package is not already installed, you will need to install it. You can do this by running the following command:

sudo dnf install dhcp-server

Or 

sudo yum install dhcp
Showing DHCPv6 Server

b.3. Edit the DHCPv6 Configuration File

  • The DHCPv6 configuration file is located at /etc/dhcp/dhcpd6.conf. You need to edit this file to define your server configuration. You can use a text editor like nano or vim to edit the file. For example:
sudo nano /etc/dhcp/dhcpd6.conf
  • Insert your DHCPv6 configuration. Here’s an example of a basic server (local network) configuration:
sudo nano /etc/dhcp/dhcpd6.confsubnet6 2001:db8:1:2::/64 {
 range6 2001:db8:1:2::100 2001:db8:1:2::200;
 option dhcp6.name-servers 2001:db8:1:2::1;
 option dhcp6.domain-search “domain.example”;
}
  • Here is an example of the configuration pasted on the config file (dhcpd6.conf)
DHCPV6 server check

NOTE: To configure other parameters like lease time, lifetime, NTP servers, etc, you’ll need to add them here, at the dhcpd6.conf file. Customize DHCPv6 options according to your network requirements. For Red Hat Enterprise Linux 6, the options are similar to those of IPv4.  

  • Restart the DHCPv6 Service: To apply the changes, restart the service with the following command:
sudo systemctl restart dhcpd6

b.4. Customizing the DHCPv6 service’s behavior. 

Now, let’s add options to the dhcpd daemon when the service starts. This is done by modifying the /etc/sysconfig/dhcpd6 file on your Linux system, which is designed to hold these extra command-line arguments. Here’s a breakdown of how this works:

  • Open /etc/sysconfig/dhcpd6 in a text editor like nano or vim:
sudo nano /etc/sysconfig/dhcpd6
  • Use DHCPDARGS Variable. Whatever you specify in this variable gets passed directly to the dhcpd daemon at startup. When the service starts, it reads this file and passes the specified arguments in DHCPDARGS to the dhcpd daemon. For example, if you want to run the DHCP server on a specific interface only, you might add DHCPDARGS=”eth0″ to tell the DHCP server to listen on eth0.
# Command line options here
DHCPDARGS=”eth0″
  • Save and close the file.

b.5. Set SELinux Context and configure Firewalld

  • If SELinux is enforcing, ensure the correct context is set for the DHCP configuration file:
restorecon /etc/dhcp/dhcpd6.conf
  • Configure Firewalld: If you are using a firewall, you need to allow the traffic through the firewall:
sudo firewall-cmd –add-service=dhcpv6 –permanent
sudo firewall-cmd –reload
Configuring DHCPv6 Server

b.6. Enable/Disable or Check the DHCPv6 Server. 

  • Start the Service: To start the DHCPv6 service, use the following command:
sudo systemctl start dhcpd6
  • Enable DHCPv6 Service on Boot: To ensure the service starts automatically at boot, enable it using systemctl:
sudo systemctl enable dhcpd6
  • Check the DHCPv6 Service Status: To verify that the service is running properly, check its status:
sudo systemctl status dhcpd6

Got DHCPv6 Skills? Let’s Put Them to Use! ?

See how can Rapidseedbox help you.

24/7 Support: Always here for you.
We own the IPs, so no third parties are involved.
Custom-fit Hosting: Perfect for any project.
Straightforward Pricing & Surefire Guarantee

Upgrade with Ease!

4. Client Mechanics and Configuration. 

DHCPv6 clients work similarly to DHCP (v4) clients. DHCP (v4) operates in a four-step process: Discover > Offer > Request > Ack (DORA), while the IPv6 protocol does something similar, but with a few differences. For example, its clients use a stateless address acquisition process, while DHCPv4 clients use a stateful address acquisition process.

a. How do DHCPv6 clients obtain IPv6? 

The following image shows how the clients acquire IPv6 addressing and configuration on a network. This client is using the protocol in conjunction with IPv6 router advertisement messages (stateless address autoconfiguration mechanisms or SLAAC) for a stateful configuration.

How DHCPV6 works?

Here’s a step-by-step explanation:

  • (1) Router Solicitation: the Client (Computer) sends a router solicitation message to discover routers on the local link. This is part of the Neighbor Discovery Protocol (NDP) for IPv6.
  • (2) Router Advertisement Message: Router responds with a router advertisement message. The message contains flags that tell the client how to obtain its IP address (either through a stateful DHCPv6 Server or through SLAAC). 
  • (3) Default Gateway: Once the client receives the router advertisement (RA), it sets its default gateway to the source address of the router advertisement message. The RA prefix is used to create a temporary SLAAC address. 
  • (4) DHCPv6 SOLICIT Message: PC1 sends a DHCPv6 SOLICIT message indicating that it’s looking for a server to obtain its addressing information.
  • (5) DHCPv6 ADVERTISE Message: The server responds with an ADVERTISE message, indicating that it is available for the service.
  • (6) DHCPv6 REQUEST Message: PC1 requests addressing information from the server by sending a REQUEST message.
  • (7) DHCPv6 REPLY Message: The server sends a REPLY message containing the Global Unicast Address (GUA) and other configuration details to PC1.

b. Configuring and Checking Interfaces of a DHCPv6 Client.

As you may know already, the protocol automatically assigns IP addresses to devices on a network. This means that you (or the network admin) don’t have to manually configure each device. But still, you might need to check the interface settings on both, the server and the client. 

For a DHCPv6 client, you’ll only need to ensure IPv6 is enabled and set the “configure IPv6” parameters to ‘automatically’ or ‘dynamically’.

Enabling DHCPv6 on a macOS. 

  • For example, for a macOS, go to the “TCP/IP” tab in the advanced settings. Here, you may enable IPv6 by choosing “Automatically,” “Manually,” or “Link-local only”.
  • Automatically uses DHCPv6, Manually does not use any dynamic method, so you’ll need to know which IPv6 to use. In addition, Link-local does not use DHCPv6. Link-local is, an IPv6 unicast address that can be automatically configured on any interface that uses the link-local prefix FE80::/10 and the interface identifier (in the EUI-64 format.)
  • (1) Next to “Configure IPv6:”, select “Automatically” from the drop-down menu. This setting will configure the macOS to use the protocol to obtain its IPv6 address and network configuration.
  • (2) Optional > To renew the DHCP lease for IPv6, click the “Renew DHCP Lease” button. The system will immediately request new IPv6 configuration details from the server.
DHCPV6 enable and check

Once you have configured the interfaces, you can start using DHCPv6 to automatically assign IP addresses to devices on your network.

Checking and Enabling DHCPv6 on Linux. 

You can use the ifconfig command on Linux to check your interfaces and find the IPv6 configuration.

  • As shown in the picture below, the IPv6 is disabled (there is no IPv6 information given). Check the following guide to disable IPv6, if this was your intention. 
DHCPV6 enable and check
Public Domain Image by (https://www.flickr.com/photos/xmodulo/16415082398)
  • Additionally, the IPv6 shown in the picture below for interface eth0 is a link-local address (not obtained via the protocol).
DHCPV6 disable
Public Domain Image by (https://www.flickr.com/photos/xmodulo/16415082398)
  • However, (refer to the picture below) from the interface output shown below with (ifconfig eth1) 2003:db5:0:f102::1/64: This is a global unicast address, which is routable on the internet. The 2003:db8::/32 range is reserved for documentation purposes, but in a real-world scenario, this type of address could have been provided by a server.
DHCPV6 enable and check
Public Domain Image by (https://www.flickr.com/photos/xmodulo/16415082398)

5. Troubleshooting DHCPv6 Issues

It is a tricky protocol, and there are many things that can go wrong when you’re configuring and using it. In this section we will go through the troubleshooting of issues, including common configuration problems and tools and techniques you can use to track down the source of your problems.

a. Common DHCPv6 Configuration Problems

Some of the most common configuration problems include:

  • Incorrect configuration of DHCPv6 servers. The server configurations are the most common culprit when it comes to trouble. Check the following.
    • If a DHCPv6 scope is not configured correctly, it can prevent the clients from obtaining IP addresses.
    • Always ensure DHCPv6 options on the server side are correct according to your network requirements or design. This can include errors in the configuration of the options, such as the client identifier option, the DNS server option, and the domain name option. 
    • Configuration File Syntax: Be careful with the syntax in the configuration file. Syntax errors can prevent the service from starting.
    • SELinux and Firewalls: If you face issues related to SELinux or firewalls, ensure that the necessary permissions and exceptions are properly set.
  • Clients improperly configured. Check whether clients have IPv6 enabled and their IPv6 assignment is set to ‘automatically’.
  • Incorrect configuration of DHCPv6 relay agents. The relay agents are used to forward messages between subnets. If a relay agent is not configured correctly, it can prevent the clients from obtaining IP addresses and other network configuration information.

b. Tools and Techniques for Troubleshooting DHCPv6

There are a number of tools and techniques that can be used to troubleshoot DHCPv6 issues. These include:

  • DHCPv6 debug messages. The servers (and clients) can generate debug messages that can be helpful in troubleshooting problems. These messages can be enabled by setting the dhcpv6-debug option on the server.
  • Traceroute. You can use Traceroute to trace the path of messages between servers and clients. This tool helps identify network problems that prevent the exchange of messages.
  • DHCPv6 packet captures. The packet captures (from tools like Wireshark) can be used to capture messages as they are exchanged between servers and clients. This can be helpful in identifying specific problems with the messages.

6. DHCPv6: FAQ

a. Stateless Address Autoconfiguration (SLAAC) vs. stateful DHCPv6?

SLAAC is for automatic IP address configuration (it doesn’t rely on the DHCP server only uses the prefix advertised by the local router), while stateful DHCPv6 is for a managed network environment where admins want to maintain control.

b. How to improve redundancy and load balancing in DHCPv6 networks? 

Use multiple servers.  Fortunately, the protocol can support multiple servers. This allows for load balancing and redundancy.

c. How to forward DHCPv6 messages to clients in other networks? 

Use DHCPv6 relay agents. These can forward the messages between networks. This allows the protocol to be used in networks that are separated by routers.

e. What are the methods of assigning IPv6 addresses?

IPv6 addresses can be assigned in two ways: statically or dynamically. With static assignment, a specific IPv6 address is manually assigned to a device. The dynamic assignment uses DHCPv6 or link-local addressing to automatically assign IPv6 addresses to devices.

f. What is DUID and what role does it play in DHCPv6?

DUID (Device Unique Identifier) is a key part of the DHCPv6 protocol that helps to ensure that each client device on a network has a unique IP address. This prevents the possibility of duplicate IP assignments, which can lead to network issues such as routing loops and DNS conflicts.

7. Final Words.

We hope the “Absolute Guide to DHCPv6” gave you a deep dive into the ins and outs of DHCPv6, from client-side configurations to server-side management. We’ve shown you how the protocol can dynamically assign IPv6 addresses, distribute network configuration parameters like DNS settings, and support SLAAC for a variety of network environments. By exploring common troubleshooting tactics and frequently asked questions, we’ve prepared you to tackle the challenges of modern networking.

Got DHCPv6 Skills? Let’s Put Them to Use! ?

See how can Rapidseedbox help you.

24/7 Support: Always here for you.
We own the IPs, so no third parties are involved.
Custom-fit Hosting: Perfect for any project.
Straightforward Pricing & Surefire Guarantee

Upgrade with Ease!

About author Diego Asturias

Avatar for Diego Asturias

Diego Asturias is a tech journalist who translates complex tech jargon into engaging content. He has a degree in Internetworking Tech from Washington DC, US, and tech certifications from Cisco, McAfee, and Wireshark. He has hands-on experience working in Latin America, South Korea, and West Africa. He has been featured in SiliconANGLE Media, Cloudbric, Pcwdld, Hackernoon, ITT Systems, SecurityGladiators, Rapidseedbox, and more.

Join 40K+ Newsletter Subscribers

Get regular updates regarding Seedbox use-cases, technical guides, proxies as well as privacy/security tips.

Speak your mind

Leave a Reply

Your email address will not be published. Required fields are marked *