So now let's talk about Stateless DHCPv6.
To enable Stateless DHCPv6, you set the O flag in the Router Advertisement.
Different manufacturers of course have different ways of doing that,
but whatever method you use for the manufacturer of
choice that you've decided on,
you do it on one of the interfaces that's physically connected to the
segment that you're providing the DHCP services on.
Now, it doesn't necessarily have to be on the router,
or switch, or device that's actually providing the DHCP services,
but essentially this tells the client that hey,
there's other configuration information that you need to ask for.
That prompts the client to ask for the information
using a solicitation type packet, which we'll talk about here in a little bit,
and then the DHCP server or the DHCP relay for the segment answers properly.
In Stateless DHCPv6 as we discussed,
the client does auto-configuration to detect the IP information so
it automatically detects its network prefix,
its local client address, which is usually the EUI 64 address,
and any routers or gateways on the segment that it's connected to.
Now the Stateless DHCPv6 server provides DNS and domain name information only.
You're not going to hand out IP addresses through it,
or prefixes, or anything like that.
Again, that's all learned through the auto-configuration.
You can of course hand out other DHCP options,
but the only mandatory options, which that's kind of an odd turn of phrase,
but the only options that you're required to give to your clients through
Stateless DHCPv6 is the DNS servers and the domain information.
This reduces the load on a centralized DHCP server,
because again,
that DHCP server only has to worry about handing out those two
pieces of information to anyone that asks for it.
It doesn't have to worry about keeping track of lease information,
or what IP addresses are on what prefixes,
or so on and so forth.
It literally is like the robot in Rick and Morty,
its whole purpose is to serve butter.
So now let's take a couple of minutes and look at the
packet flow for Stateless DHCPv6.
Again, here's our lovely little diagram with our server and our client.
When the server boots up and it detects that the O flag is
set in the Router Advertisement packet,
that prompts the client to send out an information request UPD packet,
and it sends it to a link local multicast address,
so it has the net effect of not leaving that local segment.
Again, if you'll remember your IPv6 address types,
link local are those addresses that start with FE80,
and are only valid on the local subnet.
Whenever the information request packet gets to the DHCP server,
whether that's through a relay or whether it's a
server that's directly on that subnet,
the server replies back with a reply packet,
and then the client takes that reply packet and
configures the IP stack accordingly.
Very simple.
Very quick.
You'll see it in the packet trace,
but it's really going to be kind of boring because
there's literally only two packets in it,
and you can of course download that packet trace and stare at
those two packets all day if you'd like.
So now we'll move on to stateful DHCPv6,
which is a little more complex,
but not really because it's just adding a few more
configuration options onto the stateless.
For stateful DHCP, you set the M flag in the Router Advertisement,
and again,
that depends on your particular vendor's implementation of how that's done.
With Cisco, you'll see the command when we get to our lab,
because again,
this is specific to the networking device and not the DHCP server itself,
although many times they are on the same physical piece of hardware.
With stateful DHCPv6,
the DHCP server provides all of the IP information including the prefix,
the default route, the IP address if you configure it to do so,
DNS name, it works exactly like a standard DHCPv4 DHCP server.
Under normal circumstances,
stateful DHCPv6 uses the 4-packet exchange similar to DHCPv4.
There is a configuration directive that works on at least Cisco and
Juniper that I'm aware of called Rapid Commit,
which will pair that down to only use two packets.
It's actually kind of a funny story.
As I was setting up this lab and I'm doing my packet traces to
generate the files that you can download and that we'll be
looking at later on in the course,
my stateful DHCPv6 configuration had Rapid Commit turned
on on both the client and the server, which is a requirement,
they both have to support Rapid Commit,
and when I did my packet traces I only got the two packets back,
and I'm like, what's going on here?
This is supposed to be stateful and the packets had all
of the stateful information in them,
but there was only two of them where I was expecting four,
and I probably spent a lot more time on that than I'd
like to admit before I realized, oh, this is Rapid Commit.
And again, that just goes to something that I alluded to earlier,
not a lot of network engineers have experience with IPv6,
myself included.
We all learn together as it were.
Because this is a centralized DHCP server and you're
providing all of the IP information,
it is recommended to have redundancy for your DHCP server,
much as you would have with DHCPv4.
So again, we look at the packet flow, and just like before with IPv4,
there will be 4 packets in this flow.
So the router advertises the M option in the Router Advertisement,
and that prompts the client to send out a solicit
message looking for a DHCP server.
And this is analogous to the DHCPDISCOVER packet that gets sent out with IPv4.
We then have the Advertise, which is essentially the same thing as the DHCPOFFER.
This is where the server is saying, hey,
I can hand you this address if you'd like.
The workstation then sends a request to say,
yes, please assign this address to me,
and then the DHCP server comes back and says,
fine, here is your DHCP address.
If you have Rapid Commit turned on those two middle packets
go away and you see a solicit and a reply.
That gets the IPv6 address information to the workstation a lot quicker,
and in my opinion it makes a lot more sense to do it this way,
which is why a lot of DHCPv6 implementations,
at least on routers and switches, have this turned on by default,
or at the very least their configuration guide tells you to turn it on by default.