In DHCPv6, a stateful configuration involves the DHCP server keeping a database of IP addresses and their corresponding clients. This KB explains how to set the Router Advertisement M-flag to 1 to enable stateful DHCPv6.
Potential issues we might face with a DHCPv6 stateful configuration if this flag is not set to 1:
How does a Stateful DHCPv6 work ?
In IPv6 networks, DHCPv6 plays a crucial role in managing IP address assignments. Unlike its predecessor, DHCPv4, DHCPv6 can operate in both stateless and stateful modes. In a stateful configuration, the DHCPv6 server maintains a database of IP addresses and their assigned clients, ensuring that devices receive consistent IP addresses over time. This is particularly beneficial in environments where stable IP assignments are essential.
What is the Router Advertisement M-flag ?
Regarding the "M" flag in DHCPv6, it stands for the "Managed Address Configuration" flag. When a client receives a Router Advertisement (RA) message with the M flag set, it indicates that the client should use DHCPv6 to obtain its IP address. This essentially tells the client that it should rely on the DHCP server for its address configuration, rather than trying to generate its own address via Stateless Address Autoconfiguration (SLAAC). To set the M-flag to 1 you need the following command:
user#set protocols router-advertisement interface irb.10 managed-configuration
With this set up , the switch should set the default gateway with the source address of the RA message and then the DHCPv6 server should deliver the GUA address and other information like the DNS.Needs to be configured on the irb for the Router Advertisements.
NOTE: Stateful and Stateless address autoconfiguration may be used simultaneously.
To set the O-flag to 1 you need the following command:
user#set protocols router-advertisement interface irb.10 other-stateful-configuration
Sets the "O" flag which means Other Configuration flag ,then Stateless DHCPv6 service is used to create the IPv6 GUA.
For more information about DHCPv6 refer to the following documentation: https://www.juniper.net/documentation/us/en/software/junos/dhcp/topics/topic-map/dhcpv6-server.html