Home CCNA How to Configure Stateful DHCPv6 Server
Stateful DHCPv6 topology showing server on G0/1 assigning 2001:ABCD:1:B::/64 prefix to client

How to Configure Stateful DHCPv6 Server

We can configure the stateful DHCPv6 server, similar to a stateless server. The difference between stateless and stateful is that a stateful server also includes IPv6 addressing information similar to a DHCPv4 server and obtains the state of the DHCP.

Similar to stateless DHCPv6, we need to enable unicast routing. The command ipv6 unicast-routing enables IPv6 routing on the router. Unicast routing is also needed for ICMPv6 RA messages.

Configure a DHCPv6 Pool

First, we need the IPv6 addressing pool similar to a stateless DHCPv6 server. To configure the IPv6 DHCP pool, we used ipv6 dhcp pool <pool-name> command in global configuration mode. Executing this command, we also enter into the DHCPv6 configuration mode, which is identified by the Router(config-dhcpv6)#

Configure Pool Parameters

The RA message contains the prefix, prefix length, and default gateway information. The client creates its global unicast address, including the default gateway, using the information in the RA message. However, with stateful DHCPv6, the DHCPv6 server must assign all addresses, including other configuration parameters.

We can configure the address prefix and lease time using address prefix <prefix/prefix-length> lifetime <valid-time-in-second | inifinte> command.

Other information is also included in stateful DHCPv6 configuration, usually the DNS server address and the domain name.

Interface Commands

After configuring the DHCPv6 pool, we must bind it to the corresponding interface. The ipv6 dhcp server <pool-name> interface command binds the pool to the interface. The M flag needs and O flag must be 1. This informs the client not to use SLAAC and to obtain all IPv6 addressing, including all configuration parameters, from a stateful DHCPv6 server.

DHCPv6 Stateful Server Example configuration

The figure below illustrates an example of a stateful DHCPv6 server configuration. We are using the same topology used in stateless DHCPv6 configuration. Now, I am going to configure the same topology for stateful DHCPv6. The default gateway is not specified, as the router will automatically send its link-local address as the default gateway.

The topology diagram illustrates stateful DHCPv6 address configuration
DHCPv6_SERVER> enable
DHCPv6_SERVER# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DHCPv6_SERVER(config)# ipv6 unicast-routing
DHCPv6_SERVER(config)# ipv6 dhcp pool mypool
DHCPv6_SERVER(config-dhcpv6)# address prefix 2001:ABC1:B001:0001::/64 lifetime 3600 3600
DHCPv6_SERVER(config-dhcpv6)# domain-name networkustad.com
DHCPv6_SERVER(config-dhcpv6)# dns-server 2001:ABC1:B001:0001::20
DHCPv6_SERVER(config)# interface GigabitEthernet0/1
DHCPv6_SERVER(config-if)# ipv6 nd other-config-flag
DHCPv6_SERVER(config-if)# ipv6 nd managed-config-flag
DHCPv6_SERVER(config-if)# ipv6 dhcp server mypool
DHCPv6_SERVER(config-if)# do write
Building configuration...
[OK]
DHCPv6_SERVER(config-if)#

Configuring a Router as a Stateful DHCPv6 Client

Similar to stateless DHCPv6 client configuration, the ipv6 enable interface configuration mode command is used. This command allows the router to receive a link-local address to send RS messages and participate in the DHCPv6 process.

Next, use the interface mode command ipv6 address dhcp. This command enables the router to behave as a DHCPv6 client on this interface. Below is the stateful DHCPv6 client configuration.

DHCPv6_Client> enable
DHCPv6_Client# configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
DHCPv6_Client(config)# interface gigabitEthernet0/1
DHCPv6_Client(config-if)# ipv6 enable
DHCPv6_Client(config-if)# ipv6 address dhcp
DHCPv6_Client(config-if)#

Verifying Stateful DHCPv6 Server

We can verify the stateful DHCPv6 server using different commands. The first command we can use for DHCPv6 server verification is the show ipv6 dhcp pool. Below you can see the output of this command copied from Packet tracer lab.

DHCPv6_SERVER# show ipv6 dhcp pool
DHCPv6 pool: mypool
  Address allocation prefix: 2001:ABC1:B001:0001::/64 valid
  3600 preferred 86400 (2 in use, 0 conflicts)
  DNS server: 2001:ABC1:B001:1::20
  Domain name: networkustad.com
  Active clients: 1
DHCPv6_SERVER#

The command verifies the name of the DHCPv6 pool, including its parameters. Only 1 client is active, which reflects the client DHCP Client receiving its IPv6 global unicast address from this server.

Another command is show ipv6 dhcp binding. Below you can see the output of this command, which is copied from the Packet Tracer lab, showing the automatic binding between the interface of the router and the address assigned by the server.

DHCPv6_SERVER# show ipv6 dhcp binding
Client: (GigabitEthernet0/1)
DUID: 00030001000021694C01
IA PD: IA ID 3040, T1 0, T2 0
Address: 2001:ABC1:B001:1::/64
preferred lifetime 3600, valid lifetime 3600
expires at November 1 2025 1:33:37 pm (3600 seconds)
DHCPv6_SERVER#

The output illustrates that the DHCPv6 pool name is my pool, and the prefix length is 64. You can also see the DNS server address and the domain name “networkustad-a2bb2f.ingress-alpha.ewp.live. You can see that there is 1 active client. It is a stateful protocol. Therefore, it has a record of the active client.

We can also use the “show running-config” command to verify the stateful DHCPv6 configuration.

Verifying the Stateful DHCPv6 Client

To verify the DHCPv6 client configuration, we can use the show ipv6 interface command. We can also use the show running-config and show ipv6 interface brief commands.

FAQs

What is the difference between stateful and stateless DHCPv6?

Stateful DHCPv6 assigns full IPv6 addresses, DNS, and domain from a server pool; stateless only provides extra options while clients use SLAAC for addressing.

Which command binds a DHCPv6 pool to an interface?

Use ipv6 dhcp server mypool in interface config mode; also set ipv6 nd managed-config-flag to force clients to use DHCPv6 for addressing.

How do you verify active DHCPv6 clients on the server?

Run show ipv6 dhcp binding to see client DUID, assigned address, lifetime, and expiration; show ipv6 dhcp pool displays pool usage and parameters.

What flags must be set for stateful DHCPv6 operation?

Set ipv6 nd managed-config-flag (M=1) and optionally ipv6 nd other-config-flag (O=1) so clients obtain all IPv6 info from the DHCPv6 server.

How is a router configured as a stateful DHCPv6 client?

On the interface enter ipv6 enable then ipv6 address dhcp; the router will request full IPv6 configuration from the server without SLAAC.

🏆 Your Progress

Level 1
🔥 0 day streak
📚
0 Articles
0 Points
🔥
0 Current
🏅
0 Best Streak
Level Progress 0 pts to next level
🎖️ Achievements
🥉 Starter
🥈 Reader
🥇 Scholar
💎 Expert

More from CCNA

Articles tailored to your interests in CCNA

Forum