Stateless DHCPv6 Server Configuration

Before a stateless DHCPv6 server is configured on the Cisco router, it is important to enable IPv6 unicast routing. The unicast routing is not necessary for stateless DHCPv6 servers, but it is required for RA messages due to using of ICMPv6. In global configuration mode, we can enable the IPv6 unicast routing using the “ipv6 unicast-routing” command. Other steps for configuring stateless DHCPv6 are the following:

Configure a DHCPv6 Pool

Just like the DHCPv4 IP addressing pool, we need the IPv6 addressing pool. 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 from the information in the RA message and configures its default gateway address, which is the router’s link-local address. The DHCPv6 server can be configured for providing additional information that is not included in the RA message, for example, DNS server address and domain name, etc

Configure the DHCPv6 Interface

After creating the IPv6 addressing pool, we need to bind the pool to the corresponding interface. The interface configuration mode command “ipv6 dhcp server <pool-name> binds the DHCPv6 pool to the interface.

When a router receives a DHCPv6 request on this interface it replies with the information configured in the pool. The O flag must be set to 1 and the M flag to 0 for the stateless DHCPv6. The interface mode command ipv6 nd other-config-flag command is used to configure the O flag to 1. RA messages send on this interface with M flag 0 and O flag 1 indicate that additional information is available from a stateless DHCPv6 server.

Example Command of DHCPv6 Stateless

The example configuration topology for the stateless DHCPv6 server on the Cisco router is illustrated in the following figure.

Stateless DHCPv6

Configure Cisco Router as a Stateless DHCPv6 Client

Previously, we configured the Cisco Router as a DHCPv4 client, but now, we will configure it as a DHCPv6 client. A DHCPv6 client is typically a computer, tablet, mobile device, or webcam, not a router.

A router configured as a DHCPv6 client needs an IPv6 link-local address on the interface. The router cannot send and receive IPv6 messages without a link-local address, such as RS and DHCPv6 messages.

When the IPv6 address is enabled on the interface, the link-local address is automatically created. This is possible when configuring a global unicast address on the interface or using the “ipv6 enable” command. When the router creates a link-local address, it can send RS messages and participate in the DHCPv6 process.

We will use the ipv6 enable command because the router does not yet have a global unicast address and we want to configure the global unicast address from DHCPv6.

The next command for configuring a DHCPv6 client is “ipv6 address autoconfig”. This command enables the automatic configuration of IPv6 addressing using SLAAC. An RA message then informs the client router to use stateless DHCPv6 for address configuration. The figure below illustrates the configuration of the DHCPv6 client on Cisco router command is the following:

Verifying Stateless DHCPv6

We can verify the DHCPv6 server configuration using several commands. The figure below illustrates the output of the command “show ipv6 dhcp pool”. The output of the command verifies the name of the DHCPv6 pool and its parameters. The number of active clients is 0 because there is no state being maintained by the server.

We can also use the show running-config command to verify all the commands that were previously configured.

Verifying the Stateless DHCPv6 Client

We have configured the stateless DHCPv6 client. We can verify the client and server configurations from the client. The command show ipv6 interface is used to verify that the router is configured with ”Stateless address autoconfig enabled“ and has an IPv6 global unicast address. We can also verify the configuration using the show running-config command. Another command to verify the configuration is debug ipv6 dhcp detail. The command shows the DHCPv6 messages exchanged between the client and the server.