Stateful DHCPv6 Method (Server)
This option is most similar to DHCPv4.In this case, the RA message tells the client to obtain all addressing information from a stateful DHCPv6 server, except the default gateway address which is the source IPv6 link-local address of the RA.
Note: If A Flag=1 and M Flag=1, some operating systems such as Windows will create an IPv6 address using SLAAC and obtain a different address from the stateful DHCPv6 server. In most cases, it is recommended to manually set the A flag to 0.
Stateful DHCPv6 is enabled on a router interface using the ipv6 nd managed-config-flag interface configuration command. This sets the M flag to 1.
Configure Stateful DHCPv6 on an Interface
Enable IPv6 Unicast Routing
R1(config)# ipv6 unicast-routing
Define a DHCPv6 Pool Name
R1(config)# ipv6 dhcp pool [poolname]
Configure Range and Lifetime of Leases
R1(config-dhcpv6)# address prefix [ipv6-address/prefix] lifetime [time]
Define a DNS server
R1(config-dhcpv6)# dns-server [ipv6-address]
Define the domain name
R1(config-dhcpv6)# domain-name [domain] R1(config-dhcpv6)# exit
Configure IPv6 Addressing on an interface
R1(config)# interface [interface] R1(config-if)# ipv6 address [ipv6-address] R1(config-if)# ipv6 address [ipv6-address] link-local
Assign DHCPv6 Stateful Server to the Interface and enable it
R1(config-if)# ipv6 nd managed-config-flag R1(config-if)# ipv6 nd prefix default no-autoconfig R1(config-if)# ipv6 dhcp server [poolname] R1(config-if)# no shutdown R1(config-if)# exit R1(config)#
Stateful DHCPv6 Complete Configuration example
R1> enable R1# configure terminal R1(config)# ipv6 unicast-routing R1(config)# ipv6 dhcp pool LAN-POOL-1 R1(config-dhcpv6)# address prefix 2001:DB8:CAFE:1::/64 lifetime 1000000 R1(config-dhcpv6)# dns-server 2001:db8:cafe:aaaa:5 R1(config-dhcpv6)# domain-name cisco.com R1(config-dhcpv6)# exit R1(config)# interface g0/0 R1(config-if)# ipv6 address 2001:db8:cafe:1::1/64 R1(config-if)# ipv6 address fe80::1 link-local R1(config-if)# ipv6 nd managed-config-flag R1(config-if)# ipv6 nd prefix default no-autoconfig R1(config-if)# ipv6 dhcp server LAN-POOL-1 R1(config-if)# no shutdown R1(config-if)# exit R1(config)#