Remember that we already discussed the introduction of the SLAAC and DHCPv6 in Router Advertisement (RA) messages. Now well discuss both SLAAC and DHCPv6 briefly. Recall that the router sends Router advertisement (RA) message. The setting of Router Advertisement (RA) message decides whether a client to obtain its IPv6 address information automatically using SLAAC, DHCPv6 or a combination of both.
The Router Advertisement (RA) message always contains the Managed Address Configuration flag (M flags) and another configuration flag other configuration flag (O Flag) with a different combination. The combination of M Flag and O Flag tells the host how he can get IPv6 address. Using a different combination of M Flag and O Flag, RA message present three addressing options for the IPv6 enabled devices.
- SLAAC – Use of SLAAC Only
- Stateless DHCPv6 – Use of both SLAAC and DHCPv6
- Stateful DHCPv6 – Use of DHCPv6 Server Only
The RA message specifies the above three option for the client to obtain an IPv6 address but the client computer doesn’t need to choose one of the above messages. The client computer can ignore the RA message and use the services of a DHCPv6 server exclusively.
Duplicate Address Detection (DAD) on any unicast address as well as address configured with SLAAC and DHCPv6 is recommended in RFC 4861. It ensures that all configured IPv6 addresses to be unique on the particular subnet.
It is the default option on Cisco routers. The M flag and the O flag value is set to 0 in the RA, for this option. It simplifies IPv6 address management by providing plug-and-play IP connectivity without manual configuration of hosts. It enables an IPv6 client to create its IPv6 addresses using a combination of locally available information and information advertised by routers through RA message.
In the SLAAC option, the client uses the information in the RA message exclusively. The information in the RA message includes a prefix, prefix-length, DNS server, Maximum Transmission Unit, and default gateway. The client not using any information from the DHCPv6 server. The IPv6 global unicast address is created by combining the advertised link-local prefix (first 64 bits) with the interface identifier (last 64 bits).
The RA option is configured on an individual interface of a router. If it is configured with other option e.g. stateless DHCPv6 or stateful DHCPv6. To re-configure, an interface for SLAAC, the M flag and O flags require to reset to initial values of 0. The configuration command is the following:
Router(config-if)# no ipv6 nd managed-config-flag
Router(config-if)# no ipv6 nd other-config-flag
Stateless DHCPv6 Option
The function of DHCPv6 is similar to DHCPv4.It also runs between a client and a server. Similar to DHCP for IPv4, DHCPv6 clients and DHCPv6 servers exchange DHCPv6 packets using the UDP. In IPv6, packets cannot be broadcast; therefore, DHCPv6 uses multicast packets. In this case, DHCPv6 clients do not need to be configured with IPv6 addresses of DHCPv6 servers.
In this option, the client used both information available in the RA message and DHCPv6 server. The client gets the addressing information from RA message, but additional parameters for configuration are available from a DHCPv6 server. The client creates its IPv6 global unicast address using the prefix and prefix length in the RA message, along with EUI-64 process or a randomly generated ID.
After configuring the IP addressing information the client then communicates with a stateless DHCPv6 server to get supplementary information. This process is called stateless DHCPv6 because the server is not maintaining any client state information, for example, the state of available and allocated IPv6 addresses. The server only provides configuration parameters for clients, not IPv6 addresses.
The O flag is set to 1 and the M is set to 0 for the stateless DHCPv6 option. The O flag value of 1 tells the client that additional configuration information is also available from a stateless DHCPv6 server. To configure and modify the RA message enter into the concern interface mode and use the following command:
Router(config-if)# ipv6 nd other-config-flag
Stateful DHCPv6 Option
It is work like DHCP for IPv4 addresses. A device can get its addressing plan and information including a global unicast address, prefix length, and the addresses of DNS servers automatically using the services of a stateful DHCPv6 server. The RA message in this option informs the client that I can’t give you any information you needed. Send a request to DHCPv6 server for all your required information. This option is known as stateful DHCPv6 because the DHCPv6 server keeps all record and state of IPv6 addresses.
The M flag and O flag both must be set to 1 in stateful DHCPv6. The following command is used to change the M flag and O flag from 0 to 1 to apply stateful DHCPv6:
Router(config-if)# ipv6 nd managed-config-flag
Router(config-if)# ipv6 nd other-config-flag