IPv6 Foundation Part 6: IPv6 DHCP (DHCPv6)

IPv6 Foundation Part 6 - IPv6 DHCP
How IPv6 DHCP works, how to configure a DHCPv6 Server on Cisco and Linux and a DHCP Client! Find your answers and more right here!

Table of Contents

About this course

So you are interested in IPv6, which is absolutely great!

IPv6 is not only the future of networking, it is already here today! All the big players on the Internet are already IPv6 enabled and it is now time for you to join the party!

This course covers all major aspects of the new Internet Protocol and what changed, compared to IPv4. You will understand the fundamentals and be ahead of your peers that are still on the sinking ship of IPv4! As of today, there are no IPv4 addresses left and we have no other option but to go ahead and deploy IPv6.

IPv6 Act Now

IPv6 Foundation Part 6: IPv6 DHCP (DHCPv6)

All about DHCPv6 and Dynamic Address Assignment

The Dynamic Host Configuration Protocol (DHCP) in Version 6 was created to support automatic IPv6 addressing using DHCP, like it was common with IPv4. Back in the day in the IPv4 World, we did not have automatic configuration of addresses like we do with SLAAC now.

You have learned before, that there also was no possibility to tell a client the router’s IP address (default gateway) nor the address of the DNS servers.

All this can be done using our built-in ICMPv6 toolkit, which I find absolutely great. For some implementations and some networks it might make sense to implement another solution: DHCPv6

DHCPv6 is the stateful alternative to SLAAC. Remember, the S in SLAAC comes from stateless. Stateless means, the state is not recorded, so the address generated by a client is not essentially known to the infrastructure and is not essentially the same every time. In large deployments, engineers might want to do stateful address assignment and keep record which client received which IPv6 address at which time. This can also help fulfill strict security requirements in larger companies.

To the rescue comes DHCPv6!

DHCPv6 has been defined in many RFCs, the most recent one being RFC8415. It can provide SLAAC hosts with additional information which is not commonly provided by SLAAC, such as DNS servers.

Yes, I told you before, DNS can be supplied inside a Router Advertisement message (RA). There is RFC6106 for announcing DNS servers with RA, but this was mostly not implemented by the networking vendors and thus could not be used in production very well. RFC6106 was since obsoleted by a new RFC8106.

DHCPv6 also supports IPv6 Prefix Delegation which is common with DSL routers and some Internet service providers, to receive not only the public IP address (upstream prefix), but also a globally routed prefix for use in the local network (downstream prefix) from the provider.

How DHCPv6 works

On a high-level overview, DHCPv6 uses UDP Port 546 for the client and UDP Port 547 for the server and follows these simple steps:

  • the DHCP Unique Identifier (DUID) is sent by the client to request an address
  • the DHCPv6 server checks the DUID with the DHCPv6 database for reservation or pool
  • the IPv6 address is announced by DHCP server to the client

 

The detailed technical steps are:

  1. the DHCP client sends a solicit from its Link-Local address to multicast group ff02::1:2 (all DHCP servers)
  2. the DHCP server replies with an advertise message from its Link-Local address to the Link-Local address of the client (remember, both have to be link-local as the client has no other address yet!)
  3. the DHCP client replies with a request message from its Link-Local address to multicast group ff02::1:2 (all DHCP servers)
  4. the DHCP server ends the communication with the assignment of an address and replying from its Link-Local address to the Link-Local address of the client

DHCPv6 Example #1: How to configure a Cisco DHCPv6 Server & Client

Let’s do a lab together as an example how DHCPv6 works.

You can copy and paste the sample configuration to real hardware or virtual machines. Or, if you prefer, you can just read and not try out for yourself.

How to Configure a Cisco DHCPv6 Server

! Cisco DHCPv6 Server
!
hostname R1
!
ipv6 unicast-routing
ipv6 cef
ipv6 dhcp pool test
  address prefix 2010:AA01:10::/64 lifetime infinite infinite
  dns-server AAAA:BBBB:10FE:100::15
  dns-server 2010:AA01::15
  domain-name example.com
!
!
!
interface G0/0/1
no ip address
duplex auto
speed auto
ipv6 address 2010:AA01:10::2/64
ipv6 dhcp server test rapid-commit
!
end

How to Configure a Cisco DHCPv6 Client

! Cisco DHCPv6 Client
!
hostname R2
!
ipv6 unicast-routing
ipv6 cef
!
interface FastEthernet0/1
no ip address
duplex auto
speed auto
ipv6 address dhcp rapid-commit
ipv6 enable
!
end

How to troubleshoot a Cisco DHCPv6 Server

Here are some example troubleshooting commands you can use on Cisco gear in regards to the DHCPv6 service:

Show Cisco DHCPv6 Address Pools
R1# show ipv6 dhcp pool
DHCPv6 pool: test
  Address allocation prefix: 2010:AA01:10::/64 valid 4294967295 preferred 4294967295 (1 in use, 0 conflicts)
  DNS server: AAAA:BBBB:10FE:100::15
  DNS server: 2010:AA01::15
  Domain name: example.com
  Active clients: 1
Show Cisco DHCPv6 Server Bindings (Allocations)
R2# show ipv6 dhcp binding
Client: FE80::C801:88FF:FEAC:1C
DUID: 00030001CA0188AC0000
Username : unassigned
IA NA: IA ID 0x00040001, T1 43200, T2 69120
Address: 2010:AA01:10:0:
         D16D:EC61:EDCB:8BD1
     preferred lifetime INFINITY, , valid lifetime INFINITY,
Show Cisco DHCPv6 Client Status (Interfaces)
R2# show ipv6 dhcp interface
FastEthernet1/0 is in client mode
Prefix State is IDLE
Address State is OPEN
Renew for address will be sent in 11:17:16
List of known servers:
Reachable via address: FE80::C800:88FF:FEAC:1C
DUID: 00030001CA0088AC0000
Preference: 0
Configuration parameters:
IA NA: IA ID 0x00040001, T1 43200, T2 69120
Address: 2010:AA01:10:0:D16D:EC61:
  EDCB:8BD1/128
  preferred lifetime INFINITY, valid lifetime INFINITY
DNS server: AAAA:BBBB:10FE:100::15
DNS server: 2010:AA01::15
Domain name: example.com
Information refresh time: 0
Prefix Rapid-Commit: disabled
Address Rapid-Commit: enabled

DHCPv6 Example #2: How to configure a Linux DHCPv6 Server using ISC dhcpd

One of the most common DHCPv6 implementations is still the ISC dhcpd server that runs on UNIX and Linux and supports IPv6 since version 4. You can try these example configurations on a virtual machine our your own host.

How to Configure a UNIX/Linux DHCPv6 Server

Server ISC dhcpd6:

First edit the configuration file in /etc/dhcp/dhcpd6.conf:

default-lease-time 600;
max-lease-time 7200; 
log-facility local7; 
subnet6 2001:db8:0:1::/64 {
        # Range for clients
        range6 2001:db8:0:1::129 2001:db8:0:1::254;

 

        # Range for clients requesting a temporary address
        range6 2001:db8:0:1::/64 temporary;

        # Additional options
        option dhcp6.name-servers fec0:0:0:1::1;
        option dhcp6.domain-search “domain.example”;

        # Prefix range for delegation to sub-routers
        prefix6 2001:db8:0:100:: 2001:db8:0:f00:: /56;

        # Example for a fixed host address

        host specialclient {
host-identifier option dhcp6.client-id 00:01:00:01:4a:
1f:ba:e3:60:b9:1f:01:23:45;

        fixed-address6 2001:db8:0:1::127;
    } 
}

And then restart the dhcpd6 daemon using the init system of your Linux distribution.

How to Configure a Debian GNU/Linux DHCPv6 Client

Your configuration is in the file /etc/network/interfaces:

auto eth0
iface eth0 inet6 dhcp

Now restart your networking stack and check out your brand new IPv6 connectivity!

How to Configure IPv6 SLAAC on UNIX/Linux

For Stateless Address Autoconfiguration (SLAAC) you just need to put this one line into your networking configuration at /etc/network/interfaces:

iface eth0 inet6 auto

Same here – please restart your networking stack now and enjoy your brand new IPv6!

Thank You

Thank you for attending the Original IPv6 Foundation Master Class! You can bookmark this site to use it as a quick reference in case you need to re-read something and you can share this page to social media and your friends and colleagues. Stay tuned to this blog for more in-depth stories like this one.

Recommended Resources for additional reading

Apart from the links throughout this course I recommend the following resources for additional information:

  1. The Internet Society (ISOC) IPv6 Portal
  2. Test your IPv6 connectivity on test-ipv6.com
  3. The official IANA list of assigned IPv6 address space is very interesting
  4. The Google IPv6 deployment statistics
  5. The RIPE NCC IPv6 working group and mailing list

Book recommendations on IPv6

I can recommend the following 3 books (Amazon referral links) which I enjoyed reading:

This concludes IPv6 Foundation Part 6: IPv6 DHCP (DHCPv6) of the original IPv6 Foundation Master Class.

Previous Part: IPv6 Foundation Part 5: IPv6 Configuration, EUI-64, SLAAC & Dual Stack

Next Part: IPv6 Foundation Part 7: IPv6 on Windows

Share this post

Share on pocket
Share on reddit
Share on facebook
Share on twitter
Share on linkedin
Share on xing