Configure a stateful and stateless DHCPv6 server
Configure a stateful and stateless DHCPv6 server

Configure DHCPv6 Server

Configure DHCPv6 Server
5

Summary

This topic configure a stateful and stateless DHCPv6 server. Start learning CCNA 200-301 for free right now!!

Note: Welcome: This topic is part of Module 8 of the Cisco CCNA 2 course, for a better follow up of the course you can go to the CCNA 2 section to guide you through an order.

DHCPv6 Router Roles

Cisco IOS routers are powerful devices. In smaller networks, you do not have to have separate devices to have a DHCPv6 server, client, or relay agent. A Cisco IOS router can be configured to provide DHCPv6 server services.

Specifically, it can be configured to be one of the following:

  • DHCPv6 Server – Router provides stateless or stateful DHCPv6 services.
  • DHCPv6 Client – Router interface acquires an IPv6 IP configuration from a DHCPv6 server.
  • DHCPv6 Relay Agent – Router provides DHCPv6 forwarding services when the client and the server are located on different networks.

Configure a Stateless DHCPv6 Server

The stateless DHCPv6 server option requires that the router advertise the IPv6 network addressing information in RA messages. However, the client must contact a DHCPv6 server for more information.

Refer to the sample topology to learn how to configure the stateless DHCPv6 server method.

Configure a Stateless DHCPv6 Server
Configure a Stateless DHCPv6 Server

In this example, R1 will provide SLAAC services for the host IPv6 configuration and DHCPv6 services.

There are five steps to configure and verify a router as a stateless DHCPv6 server:

Step 1. Enable IPv6 routing.
Step 2. Define a DHCPv6 pool name.
Step 3. Configure the DHCPv6 pool.
Step 4. Bind the DHCPv6 pool to an interface.
Step 5. Verify that the hosts have received IPv6 addressing information.

Click each button for an example of these steps.

Step 1. Enable IPv6 routing.

The ipv6 unicast-routing command is required to enable IPv6 routing. Although it is not necessary for the router to be a stateless DHCPv6 server, it is required for the router to source ICMPv6 RA messages.

R1(config)# ipv6 unicast-routing
R1(config)#

Step 2. Define a DHCPv6 pool name.

Create the DHCPv6 pool using the ipv6 dhcp pool POOL-NAME global config command. This enters DHCPv6 pool sub-configuration mode as identified by the Router(config-dhcpv6)# prompt.

Note: The pool name does not have to be uppercase. However, using an uppercase name makes it easier to see in a configuration.

R1(config)# ipv6 dhcp pool IPV6-STATELESS
R1(config-dhcpv6)#

Step 3. Configure the DHCPv6 pool.

R1 will be configured to provide additional DHCP information including DNS server address and domain name, as shown in the command output.

R1(config-dhcpv6)# dns-server 2001:db8:acad:1::254
R1(config-dhcpv6)# domain-name example.com
R1(config-dhcpv6)# exit
R1(config)#

Step 4. Bind the DHCPv6 pool to an interface.

The DHCPv6 pool has to be bound to the interface using the ipv6 dhcp server POOL-NAME interface config command as shown in the output.

The router responds to stateless DHCPv6 requests on this interface with the information contained in the pool. The O flag needs to be manually changed from 0 to 1 using the interface command ipv6 nd other-config-flag. RA messages sent on this interface indicate that additional information is available from a stateless DHCPv6 server. The A flag is 1 by default, telling clients to use SLAAC to create their own GUA.

R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# description Link to LAN
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
R1(config-if)# ipv6 nd other-config-flag
R1(config-if)# ipv6 dhcp server IPV6-STATELESS
R1(config-if)# no shut
R1(config-if)# end
R1#

Step 5. Verify hosts received IPv6 addressing information.

To verify stateless DHCP on a Windows host, use the ipconfig /all command. The example output displays the settings on PC1.

Notice in the output that PC1 created its IPv6 GUA using the 2001:db8:acad:1::/64 prefix. Also notice that the default gateway is the IPv6 link-local address of R1. This confirms that PC1 derived its IPv6 configuration from the RA of R1.

The highlighted output confirms that PC1 has learned the domain name and DNS server address information from the stateless DHCPv6 server.

C:\PC1> ipconfig /all
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . : example.com
   Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
   Physical Address. . . . . . . . . : 00-05-9A-3C-7A-00
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:db8:acad:1:1dd:a2ea:66e7 Preferred)
   Link-local IPv6 Address . . . . . : fe80::fb:1d54:839f:f595%21(Preferred)
   IPv4 Address. . . . . . . . . . . : 169.254.102.23 (Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : fe80::1%6
   DHCPv6 IAID . . . . . . . . . . . : 318768538
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-21-F3-76-75-54-E1-AD-DE-DA-9A
   DNS Servers . . . . . . . . . . . : 2001:db8:acad:1::1
   NetBIOS over Tcpip. . . . . . . . : Enabled
C:\PC1>

Configure a Stateless DHCPv6 Client

A router can also be a DHCPv6 client and get an IPv6 configuration from a DHCPv6 server, such as a router functioning as a DHCPv6 server. In the figure, R1 is a stateless DHCPv6 server.

Configure a Stateless DHCPv6 Client
Configure a Stateless DHCPv6 Client

There are five steps to configure and verify a router as a stateless DHCPv6 server.

Step 1. Enable IPv6 routing.
Step 2. Configure the client router to create an LLA.
Step 3. Configure the client router to use SLAAC.
Step 4. Verify that the client router is assigned a GUA.
Step 5. Verify that the client router received other necessary DHCPv6 information.

Click each button for an example of these steps.

Step 1. Enable IPv6 routing.

The DHCPv6 client router needs to have ipv6 unicast-routing enabled.

R3(config)# ipv6 unicast-routing
R3(config)#

Step 2. Configure client router to create an LLA.

The client router needs to have a link-local address. An IPv6 link-local address is created on a router interface when a global unicast address is configured. It can also be created without a GUA using the ipv6 enable interface configuration command. Cisco IOS uses EUI-64 to create a randomized Interface ID.

In the output, the ipv6 enable command is configured on the Gigabit Ethernet 0/0/1 interface of the R3 client router.

R3(config)# interface g0/0/1
R3(config-if)# ipv6 enable
R3(config-if)#

Step 3. Configure client router to use SLAAC.

The client router needs to be configured to use SLAAC to create an IPv6 configuration. The ipv6 address autoconfig command enables the automatic configuration of IPv6 addressing using SLAAC.

R3(config-if)# ipv6 address autoconfig
R3(config-if)# end
R3#

Step 4. Verify client router is assigned a GUA.

Use the show ipv6 interface brief command to verify the host configuration as shown. The output confirms that the G0/0/1 interface on R3 was assigned a valid GUA.

Note: it may take the interface a few seconds to complete the process.

R3# show ipv6 interface brief
GigabitEthernet0/0/0   [up/up]
    unassigned
GigabitEthernet0/0/1   [up/up]
    FE80::2FC:BAFF:FE94:29B1
    2001:DB8:ACAD:1:2FC:BAFF:FE94:29B1
Serial0/1/0            [up/up]
    unassigned
Serial0/1/1            [up/up]
    unassigned
R3#

Step 5. Verify client router received other DHCPv6 information.

The show ipv6 dhcp interface g0/0/1 command confirms that the DNS and domain names were also learned by R3.

R3# show ipv6 dhcp interface g0/0/1
GigabitEthernet0/0/1 is in client mode
  Prefix State is IDLE (0)
  Information refresh timer expires in 23:56:06
  Address State is IDLE
  List of known servers:
    Reachable via address: FE80::1
    DUID: 000300017079B3923640
    Preference: 0
    Configuration parameters:
      DNS server: 2001:DB8:ACAD:1::254
      Domain name: example.com
      Information refresh time: 0
  Prefix Rapid-Commit: disabled
  Address Rapid-Commit: disabled
R3#

Configure a Stateful DHCPv6 Server

The stateful DHCP server option requires that the IPv6 enabled router tells the host to contact a DHCPv6 server to obtain all necessary IPv6 network addressing information.

In the figure, R1 will provide stateful DHCPv6 services to all hosts on the local network. Configuring a stateful DHCPv6 server is similar to configuring a stateless server. The most significant difference is that a stateful DHCPv6 server also includes IPv6 addressing information similar to a DHCPv4 server.

Configure a Stateful DHCPv6 Server
Configure a Stateful DHCPv6 Server

There are five steps to configure and verify a router as a Stateful DHCPv6 server:

Step 1. Enable IPv6 routing.
Step 2. Define a DHCPv6 pool name.
Step 3. Configure the DHCPv6 pool.
Step 4. Bind the DHCPv6 pool to an interface.
Step 5. Verify that the hosts have received IPv6 addressing information.

Click each button for an example of these steps.

Step 1. Enable IPv6 routing.

The ipv6 unicast-routing command is required to enable IPv6 routing.

R1(config)# ipv6 unicast-routing
R1(config)#

Step 2. Define a DHCPv6 pool name.

Create the DHCPv6 pool using the ipv6 dhcp pool POOL-NAME global config command.

R1(config)# ipv6 dhcp pool IPV6-STATEFUL
R1(config-dhcpv6)#

Step 3. Configure the DHCPv6 pool.

R1 will be configured to provide IPv6 addressing, DNS server address, and domain name, as shown in the command output. With stateful DHCPv6, all addressing and other configuration parameters must be assigned by the DHCPv6 server. The address prefix command is used to indicate the pool of addresses to be allocated by the server. Other information provided by the stateful DHCPv6 server typically includes DNS server address and the domain name, as shown in the output.

Note: This example is setting the DNS server to Google's public DNS server.

R1(config-dhcpv6)# address prefix 2001:db8:acad:1::/64
R1(config-dhcpv6)# dns-server 2001:4860:4860::8888
R1(config-dhcpv6)# domain-name example.com
R1(config-dhcpv6)#

Step 4. Bind the DHCPv6 pool to an interface.

The example shows the full configuration of the GigabitEthernet 0/0/1 interface on R1.

The DHCPv6 pool has to be bound to the interface using the ipv6 dhcp server POOL-NAME interface config command.

  • The M flag is manually changed from 0 to 1 using the interface command ipv6 nd managed-config-flag.
  • The A flag is manually changed from 1 to 0 using the interface command ipv6 nd prefix default no-autoconfig. The A flag can be left at 1, but some client operating systems such as Windows will create a GUA using SLAAC and get a GUA from the stateful DHCPv6 server. Setting the A flag to 0 tells the client not to use SLAAC to create a GUA.
  • The ipv6 dhcp server command binds the DHCPv6 pool to the interface. R1 will now respond with the information contained in the pool when it receives stateful DHCPv6 requests on this interface.

Note: You can use the no ipv6 nd managed-config-flag to set the M flag back to its default of 0. The no ipv6 nd prefix default no-autoconfig command sets the A flag back its default of 1.

R1(config)# interface GigabitEthernet0/0/1
R1(config-if)# description Link to LAN
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# ipv6 address 2001:db8:acad:1::1/64
R1(config-if)# ipv6 nd managed-config-flag
R1(config-if)# ipv6 nd prefix default no-autoconfig
R1(config-if)# ipv6 dhcp server IPV6-STATEFUL
R1(config-if)# no shut
R1(config-if)# end
R1#

Step 5. Verify hosts received IPv6 addressing information.

To verify on a Windows host, use the ipconfig /all command to verify the Stateful DHCP configuration method. The output displays the settings on PC1. The highlighted output shows that PC1 has received its IPv6 GUA from a stateful DHCPv6 server.

C:\PC1> ipconfig /all
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . : example.com
   Description . . . . . . . . . . . : IntelI 82574L Gigabit Network Connection
   Physical Address. . . . . . . . . : 00-05-9A-3C-7A-00
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:db8:acad:1a43c:fd28:9d79:9e42 (Preferred)
   Lease Obtained. . . . . . . . . . : Saturday, September 27, 2019, 10:45:30 AM
   Lease Expires . . . . . . . . . . : Monday, September 29, 2019 10:05:04 AM
   Link-local IPv6 Address . . . . . : fe80::192f:6fbc:9db:b749%6(Preferred)
   Autoconfiguration IPv4 Address. . : 169.254.102.73 (Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : fe80::1%6
   DHCPv6 IAID . . . . . . . . . . . : 318768538
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-21-F3-76-75-54-E1-AD-DE-DA-9A
   DNS Servers . . . . . . . . . . . : 2001:4860:4860::8888
   NetBIOS over Tcpip. . . . . . . . : Enabled
C:\PC1>

Configure a Stateful DHCPv6 Client

A router can also be a DHCPv6 client. The client router needs to have ipv6 unicast-routing enabled and an IPv6 link-local address to send and receive IPv6 messages.

Refer to the sample topology to learn how to configure the stateful DHCPv6 client.

Configure a Stateful DHCPv6 Client
Configure a Stateful DHCPv6 Client

There are five steps to configure and verify a router as a Stateful DHCPv6 server.

Step 1. Enable IPv6 routing.
Step 2. Configure the client router to create an LLA.
Step 3. Configure the client router to use DHCPv6.
Step 4. Verify that the client router is assigned a GUA.
Step 5. Verify that the client router received other necessary DHCPv6 information.

Click each button for an example of these steps.

Step 1. Enable IPv6 routing.

The DHCPv6 client router needs to have ipv6 unicast-routing enabled.

R3(config)# ipv6 unicast-routing
R3(config)#

Step 2. Configure client router to create an LLA.

In the output, the ipv6 enable command is configured on the R3 Gigabit Ethernet 0/0/1 interface. This enables the router to create an IPv6 LLA without needing a GUA.

R3(config)# interface g0/0/1
R3(config-if)# ipv6 enable
R3(config-if)#

Step 3. Configure client router to use DHCPv6.

The ipv6 address dhcp command configures R3 to solicit its IPv6 addressing information from a DHCPv6 server.

R3(config-if)# ipv6 address dhcp
R3(config-if)# end
R3#

Step 4. Verify client router is assigned a GUA.

Use the show ipv6 interface brief command to verify the host configuration as shown.

R3# show ipv6 interface brief
GigabitEthernet0/0/0   [up/up]
    unassigned
GigabitEthernet0/0/1   [up/up]
    FE80::2FC:BAFF:FE94:29B1
    2001:DB8:ACAD:1:B4CB:25FA:3C9:747C
Serial0/1/0            [up/up]
    unassigned
Serial0/1/1            [up/up]
    unassigned
R3#

Step 5. Verify client router received other DHCPv6 information.

The show ipv6 dhcp interface g0/0/1 command confirms that the DNS and domain names were learned by R3.

R3# show ipv6 dhcp interface g0/0/1
GigabitEthernet0/0/1 is in client mode
  Prefix State is IDLE
  Address State is OPEN
  Renew for address will be sent in 11:56:33
  List of known servers:
    Reachable via address: FE80::1
    DUID: 000300017079B3923640
    Preference: 0
    Configuration parameters:
      IA NA: IA ID 0x00060001, T1 43200, T2 69120
        Address: 2001:DB8:ACAD:1:B4CB:25FA:3C9:747C/128
                preferred lifetime 86400, valid lifetime 172800
                expires at Sep 29 2019 11:52 AM (172593 seconds)
      DNS server: 2001:4860:4860::8888
      Domain name: example.com
      Information refresh time: 0
  Prefix Rapid-Commit: disabled
  Address Rapid-Commit: disabled
R3#

DHCPv6 Server Verification Commands

Use the show ipv6 dhcp pool and show ipv6 dhcp binding commands to verify DHCPv6 operation on a router.

Click each button for example output.

The show ipv6 dhcp pool command verifies the name of the DHCPv6 pool and its parameters. The command also identifies the number of active clients. In this example, the IPV6-STATEFUL pool currently has 2 clients, which reflects PC1 and R3 receiving their IPv6 global unicast address from this server.

When a router is providing stateful DHCPv6 services, it also maintains a database of assigned IPv6 addresses.

R1# show ipv6 dhcp pool
DHCPv6 pool: IPV6-STATEFUL
  Address allocation prefix: 2001:DB8:ACAD:1::/64 valid 172800 preferred 86400 (2 in use,  0 conflicts)
  DNS server: 2001:4860:4860::8888
  Domain name: example.com
  Active clients: 2
R1#

Use the show ipv6 dhcp binding command output to display the IPv6 link-local address of the client and the global unicast address assigned by the server.

The output displays the current stateful binding on R1. The first client in the output is PC1 and the second client is R3.

This information is maintained by a stateful DHCPv6 server. A stateless DHCPv6 server would not maintain this information.

R1# show ipv6 dhcp binding
Client: FE80::192F:6FBC:9DB:B749
  DUID: 0001000125148183005056B327D6
  Username : unassigned
  VRF : default
  IA NA: IA ID 0x03000C29, T1 43200, T2 69120
    Address: 2001:DB8:ACAD:1:A43C:FD28:9D79:9E42
            preferred lifetime 86400, valid lifetime 172800
            expires at Sep 27 2019 09:10 AM (171192 seconds)
Client: FE80::2FC:BAFF:FE94:29B1
  DUID: 0003000100FCBA9429B0
  Username : unassigned
  VRF : default
  IA NA: IA ID 0x00060001, T1 43200, T2 69120
    Address: 2001:DB8:ACAD:1:B4CB:25FA:3C9:747C
            preferred lifetime 86400, valid lifetime 172800
            expires at Sep 27 2019 09:29 AM (172339 seconds)
R1#

Configure a DHCPv6 Relay Agent

If the DHCPv6 server is located on a different network than the client, then the IPv6 router can be configured as a DHCPv6 relay agent. The configuration of a DHCPv6 relay agent is similar to the configuration of an IPv4 router as a DHCPv4 relay.

In the figure, R3 is configured as a stateful DHCPv6 server. PC1 is on the 2001:db8:acad:2::/64 network and requires the services of a stateful DHCPv6 server to acquire its IPv6 configuration. R1 needs to be configured as the DHCPv6 Relay Agent.

Configure a DHCPv6 Relay Agent
Configure a DHCPv6 Relay Agent

The command syntax to configure a router as a DHCPv6 relay agent is as follows:

Router(config-if)# ipv6 dhcp relay destination ipv6-address [interface-type interface-number]

This command is configured on the interface facing the DHCPv6 clients and specifies the DHCPv6 server address and egress interface to reach the server, as shown in the output. The egress interface is only required when the next-hop address is an LLA.

R1(config)# interface gigabitethernet 0/0/1
R1(config-if)# ipv6 dhcp relay destination 2001:db8:acad:1::2 G0/0/0
R1(config-if)# exit
R1(config)#

Verify the DHCPv6 Relay Agent

Verify that the DHCPv6 relay agent is operational with the show ipv6 dhcp interface and show ipv6 dhcp binding commands. Verify Windows hosts received IPv6 addressing information with the ipconfig /all command.

Click each button for example output.

The DHCPv6 relay agent can be verified using the show ipv6 dhcp interface command. This will verify that the G0/0/1 interface is in relay mode.

R1# show ipv6 dhcp interface
GigabitEthernet0/0/1 is in relay mode
  Relay destinations:
    2001:DB8:ACAD:1::2
    2001:DB8:ACAD:1::2 via GigabitEthernet0/0/0
R1#

On R3, use the show ipv6 dhcp binding command to verify if any hosts have been assigned an IPv6 configuration.

Notice that a client link-local address has been assigned an IPv6 GUA. We can assume that this is PC1.

R3# show ipv6 dhcp binding
Client: FE80::5C43:EE7C:2959:DA68
  DUID: 0001000124F5CEA2005056B3636D
  Username : unassigned
  VRF : default
  IA NA: IA ID 0x03000C29, T1 43200, T2 69120
    Address: 2001:DB8:ACAD:2:9C3C:64DE:AADA:7857
            preferred lifetime 86400, valid lifetime 172800
            expires at Sep 29 2019 08:26 PM (172710 seconds)
R3#

Finally, use ipconfig /all on PC1 to confirm that it has been assigned an IPv6 configuration. As you can see, PC1 has indeed received its IPv6 configuration from the DHCPv6 server.

C:\PC1> ipconfig /all
Windows IP Configuration
Ethernet adapter Ethernet0:
   Connection-specific DNS Suffix  . : example.com
   Description . . . . . . . . . . . : Intel(R) 82574L Gigabit Network Connection
   Physical Address. . . . . . . . . : 00-05-9A-3C-7A-00
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   IPv6 Address. . . . . . . . . . . : 2001:db8:acad:2:9c3c:64de:aada:7857 (Preferred)
   Link-local IPv6 Address . . . . . : fe80::5c43:ee7c:2959:da68%6(Preferred)
   Lease Obtained  . . . . . . . . . : Saturday, September 27, 2019, 11:45:30 AM
   Lease Expires . . . . . . . . . . : Monday, September 29, 2019 11:05:04 AM
   IPv4 Address. . . . . . . . . . . : 169.254.102.73 (Preferred)
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . : fe80::1%6
   DHCPv6 IAID . . . . . . . . . . . : 318768538
   DHCPv6 Client DUID. . . . . . . . : 00-01-00-01-21-F3-76-75-54-E1-AD-DE-DA-9A
   DNS Servers . . . . . . . . . . . : 2001:4860:4860::8888
   NetBIOS over Tcpip. . . . . . . . : Enabled
C:\PC1>


Glossary: If you have doubts about any special term, you can consult this computer network dictionary.

Ready to go! Keep visiting our networking course blog, give Like to our fanpage; and you will find more tools and concepts that will make you a networking professional.

Operation of DHCPv6 CCNA
Next
DHCPv6
More Goodies
Dynamic Addressing for IPv6 LLAs
Dynamic Addressing for IPv6 LLAs