There are some protocols that are used so often they become synonymous with IP
networking.
And one of those is an application layer service called DHCP, the dynamic host
configuration protocol.
And primarily after all said and done, the job of dynamic host configuration
protocol,
or as its friends call it DHCP, is to hand out IP address information to
clients that ask for that.
So let's draw a typical network right here.
So this could be for example VLAN on a local network and on top of that VLAN, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So this could be for example VLAN on a local network and on top of that VLAN,
let's see we're using the IP dressing space of 10.30.0.0 with a 24-bit mask.
So that's our IP dressing space for this network.
Now some devices on this network are very likely going to have a statically
configured IP address,
like this router right here.
Let's say it's IP address, we've configured it as .1 on this 10.30.0 network.
And we may have other devices, for example, like a server that we statically
configure.
And perhaps we give this server the IP address statically configured of .2 on
the 10.30.0 network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the 10.30.0 network.
And for other devices that are on that network, for example, just have all
these orange colored devices represent clients,
which could be Windows, they could be Linux, it could be Mac OS,
or if it's a wireless network, it could be mobile devices, for example, like
Android's and iPhones and things like that.
And for client devices that come on the network and go off the network and so
forth,
instead of having to manually configure details such as, okay, the correct IP
address space for these clients
and their default gateway and which DNS server to use, etc, etc, instead, we WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
and their default gateway and which DNS server to use, etc, etc, instead, we
can use the wonderful protocol called dynamic host configuration protocol.
And then train these clients that when they boot up or when they connect to
this network to dynamically ask for an IP address
and the process would go something like this.
The clients could issue a discover message.
And the discover message in DHCP is sent as a layer two broadcast.
So effectively, our rails have that same layer two broadcast domain is going to
have to listen to that broadcast and then see what's inside.
Now, hopefully one of those devices that sees that broadcast, this discover WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now, hopefully one of those devices that sees that broadcast, this discover
message being sent by a client,
hopefully one of those devices is a DHCP server.
In fact, let me redraw this just a little bit and let's go ahead and imagine
these are clients and this device here is acting as our DHCP server on the
local segment.
So from a communication path perspective with DHCP, I'm going to have the
server right here on the right.
So it's right here.
Well, they're on our network again here for good measure.
We'll connect our server to that.
And again, that server is at dot two.
And then over here, let's go ahead and just use one of our clients as an
example who's also connected to that network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
example who's also connected to that network.
And on the client computer, we're going to have some option based on the type
of operating system we're working with, but some flavor of the question.
Do you want to get an IP address automatically?
Well, the answer is yes, that's implying in the background that it's going to
be using DHCP services.
And here's the play by play.
The client is going to start the process by setting in a DHCP discover message
into the network.
Now, it's hoping that someone on this layer two network is a DHCP server, can
respond on behalf of that discover message.
And if there is a local DHCP server, that DHCP server can go ahead and respond. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And if there is a local DHCP server, that DHCP server can go ahead and respond.
And when the receiver responds, this can respond with an offer.
So put an O there, I'll put an offer there just to write out what it is.
So this D over here in parentheses, I'll just make a little note that that's a
DHCP discover message.
So in the offer coming from the DHCP server, it's going to have some
information for that client.
For example, let's say, hey, here's an IP address you might like to use on the
1030 zero network and here's a default gateway you can use while you're on this
network.
Oh, by the way, here's a DNS server you can use and reach out to if you have
need to do name resolution from names to IP addresses. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
need to do name resolution from names to IP addresses.
And the list goes on.
There's other options as well that we can hand out all as part of this offer
coming from the server.
Then when the client gets that offer, if they want to use it, they'll go ahead
and they'll send a request message.
I'll put that here in parentheses as well.
And the client will send that request in the network saying, you know what that
offer is made?
I would love it.
At which point the DHCP server is going to finalize the conversation with an
acknowledgement.
So put an A there and just write out a CK short for acknowledgement.
And that's the back and forth for traditional DHCP services on a local network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And that's often referred to as the DORA process.
We're representing the first letter of each of those exchanges for a client
getting an IP address from a DHCP server.
So the discover, the offer, the request and acknowledgement.
And those will be packets one, two, three and four.
So let's modify the topology a little bit and let's imagine that we still have
these clients here, but we do not have a local DHCP server connected to this
local 1030 zero network.
So I'm going to remove this server here because it's no longer on the local
segment.
And let's put another network over here. And let's imagine just for grants, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And let's put another network over here. And let's imagine just for grants,
this is the 23.1.2 network.
And let's imagine we do have a DHCP server connected right there.
And let's imagine it's at dot one. So maybe our router down here is at dot two
on the 23.1.2 network.
And our DHCP server is right here.
So the problem with not having a local DHCP server is that this client right
here right there, when it does a discover message when it's looking and trying
to discover a DHCP server, it senses a broadcast.
And broadcast only goes as far as that layer two broadcast domain. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And broadcast only goes as far as that layer two broadcast domain.
So if this is the 1030 zero subnet and it's on top of a VLAN, that broadcast is
not going to make it past this layer two segment right here.
And as a result, this DHCP server up here is not going to see that DHCP
discover message.
So it can't respond. In addition, if we had 20 or 30 or 50 different subnets in
our networks, it'd be pretty tedious to make sure we had a logical or physical
interface from a DHCP server in every single one of those subnets.
So one of the features that we can use to get around the problem of having to WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So one of the features that we can use to get around the problem of having to
have a local DHCP server with its interface on every single one of our networks
is we can use a feature called DHCP relay.
And most of the time this feature of DHCP relay is going to be enabled or
configured on a router interface that's directly connected to this network
segment.
And so think of the DHCP relay like the proxy, the person or entity that goes
between two things.
So for example, if this is the DHCP client over here, and is the DHCP server,
the DHCP relay is like the middleman who can forward those messages back and WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
the DHCP relay is like the middleman who can forward those messages back and
forth between this local segment and the server.
So part of enabling DHCP relay on this router is to also tell this router and
this interface where DHCP relay is enabled.
We need to tell where the real DHCP server is.
So we'd spend a moment configure this router and tell it that on this interface
, we want to enable DHCP relay and that the real DHCP server is at 23.1.2.1.
Now once we tell the router that the play by play for DHCP relay goes something
like this.
This client issues a discover message, which is a layer two broadcast and the WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
This client issues a discover message, which is a layer two broadcast and the
relay function here on this interface.
If it's enabled, it's going to take that broadcast, wrap it up, encapsulate it
and ship it over as a unit cast over to the DHCP server.
At which point the DHCP server de-encapsulates that packet and sees that it's a
DHCP discover message.
Now one of the mysteries of the DHCP relay is that what if this server up here
has multiple scopes or pools of addresses that it can use to hand out IP
addresses.
For example, let's imagine that this DHCP server has a pool of addresses
appropriate for this subnet right here, the 10100 network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
appropriate for this subnet right here, the 10100 network.
So it may have a pool of addresses that will say it's 10.10.0.151 through and
let's go ahead and go through 250.
And let's imagine it has yet another pool of IP addresses configured and that
would be over here for the 1020 subnet and that's 10.20.0.0.
Let's go ahead and use the range 151 through 250.
And that's also because we're talking about the subnet here, the 1030 subnet.
Let's imagine the same DHCP server has another pool of addresses in the range WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's imagine the same DHCP server has another pool of addresses in the range
of 10.30.0.151 all the way through 250.
Now this router on this interface right here, it has the IP address of 10.30.0.
1 based on our plan here.
So when that DHCP discover message is seen and DHCP relay is enabled right here
, as part of the encapsulation and shipping that up to the unicast address, the
single IP address of the DHCP server, it's going to include information
regarding which subnet this discover came from,
including sourcing the packet from that IP address on this interface right here WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
including sourcing the packet from that IP address on this interface right here
.
And that way when the DHCP server receives it says, "Oh, I see this is coming
from the source address in the 1030 subnet."
And based on that and also some of our details inside of the DHCP request, the
DHCP server can say, "Oh, you know what?
I need to go ahead and hand that IP address from this pool of addresses of the
1030 range because that's appropriate for this network down here."
At which point the DHCP server would make that offer, it would unicast it down
to that IP address and then the relay agent would forward that back out to the
client. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So all the client knows is that it made a discover message and it got an offer.
So that's the offer coming back.
And if the client wants to accept that offer, it would go ahead and do the R
for the request and that would go into the network.
The relay would take it and capsulate that request, forward it to the DHCP
server, who then followed up with a final acknowledgement.
So there's an A there for acknowledgement that would be unicast back to the IP
address of the DHCP relay and then the relay agent would continue forwarding
that back to the client.
So with the relay agent, we're still going through the discover offer request
acknowledgement process, but we have the relay agent in the middle of that WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
acknowledgement process, but we have the relay agent in the middle of that
conversation,
acting as the middleman between the DHCP server, which can be centralized
somewhere, reachable on our networks, and the local network segment where the
DHCP clients are.
Now DHCP is not the perfect solution for every type of device. So if we have
things like routers and servers, we probably want to have a specific IP address
on those devices.
And very likely we're going to configure that IP address, whatever we want them
to use directly on those respective interfaces.
So for things like servers and routers and other devices that you want to know WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So for things like servers and routers and other devices that you want to know
exactly where they're going to be, for example, maybe a printer, we can go
ahead and do static or manual configuration for those IP addresses.
And then for most of our clients, we're going to go ahead and use DHCP services
.
And if we happen to have local DHCP servers connected to those subnets,
fantastic.
If not, we can enable DHCP relay services on the router interfaces that are
connected to those subnets where we are going to have DHCP clients.
Now there is one other option that's kind of cool.
And that is what if we want to use DHCP services, but we want to specifically WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And that is what if we want to use DHCP services, but we want to specifically
hand out a specific IP address to a certain device.
Well, every device on our network has a layer two MAC address, and so we can
create what's known as a reservation.
And in the world of NSX, that's referred to as a static binding.
Let's imagine we have this device right here, this client with a MAC address
thing in 1234, we can create a reservation that says, you know what, for that
MAC address, ending in 1234.
I want to assign the IP address on this network, 10.30.0.
Let's go ahead and use 95. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's go ahead and use 95.
So if we specified that we want to reserve this IP address for that specific
layer two address, when this device makes a discover message, part of that
discover is going to include its layer two address.
And so if the DHCP server is local, it can see that directly, and if the DHCP
server is remote, the relay agent will encapsulate all that information,
including the client's layer two address, wrap it all up and unicast it as a
discover up to the DHCP server.
At which point the DHCP server, if we have the static binding, this reservation
in place, they'll say, oh, you know what, I've got the perfect IP address for WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
in place, they'll say, oh, you know what, I've got the perfect IP address for
you.
I'm going to hand you this specific IP address right here, based on your layer
two MAC address that's included as part of the discover message.
So using the technique of static bindings, we could specifically pre plan for a
certain IP address being associated with a specific client.
But most of the time for most of these clients, it's just a look at the draw,
we have a pool of addresses, the DHCP server makes an offer from one of those
addresses in the pool, the client says, I'll take it, and the server follows up
with the acknowledgement saying, yep, I know you got it, have a good day. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
with the acknowledgement saying, yep, I know you got it, have a good day.
So let me clean this up a little bit.
Now that we've taken a look at some basic concepts regarding DHCP and DHCP
relay, and let's talk about a few options that we have in the world of NSX
related to DHCP services.
And let's start off with a network segment right here.
And let's imagine we want to use on this network segment 10.30.0.0 with a 24
bit mask.
Let's also imagine that we want to use this network address space.
We want to use it for some testing of some servers.
So there's server one and there's server two. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So there's server one and there's server two.
Maybe this is an application server, maybe this is a database server, and the
list can go on.
Let's also imagine we have some clients, so I'll put a few clients here as well
.
And so on our servers is very likely we want to statically configure those, and
then for the clients very likely we're going to use DHCP services.
So if we have just an overlay segment like this one right here and we're using
the 10.30.0 address space and we're not connecting it to any of our gateways in
NSX.
One of our options is to enable DHCP services for a segment, which is not
connected to a router. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
connected to a router.
And that's referred to as a segment DHCP server.
So what we would do is simply say, you know what, I want to enable a segment
DHCP server to support this subnet.
So as part of setting up a segment DHCP server with no logical routers attached
to it, we would create a DHCP profile.
In that profile, we'd specify an IP address of a DHCP server that we want to
use.
And again, it's all virtualized, so we can specify something like six dot seven
dot eight dot three with a 29 bit mask. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So I want to use a kind of a crazy number there because you don't have to use a
real reachable IP address for a real DHCP server because that DHCP server is
going to be virtualized.
So we set up a profile.
We specify an IP address we want to use that represents the server.
So with that profile on place, we then go to the segment and we associate this
segment.
Let's call this segment 30.
So I'll have label here.
So if this is segment 30 as part of the configuration of segment 30, there's an
option to say set up DHCP services.
And so we would say, you know what, we want to use DHCP services. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We'll use this profile, which represents this logical DHCP server at six seven
eight three.
And then as part of the configuration for the segment, we'd also specify the
details.
So we say, I want to use the range of addresses 10 dot 30 dot zero dot, let's
use 151 all the way through 200.
And if we need more addresses, we simply define a larger pool.
And as part of the configuration, we could also specify default gateway.
But if we don't have a default gateway, we don't want to default gateway.
We just want DHCP services for this one logical segment.
And in addition to the range of addresses, we want to hand out for DHCP WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And in addition to the range of addresses, we want to hand out for DHCP
services.
We'll also hand out a logical IP address on that subnet that the clients will
believe is the DHCP server.
So we could say, you know what, the DHCP server address is going to be 10 dot
30 dot zero dot two, for example,
because from a client's perspective, when they go about doing things like renew
ing their IP address and so forth,
they're going to want to communicate directly with their DHCP server.
So we're also going to give an IP address that they can play with to support
that function.
Now, if we don't want NSX to provide the DHCP services directly, we want to use WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now, if we don't want NSX to provide the DHCP services directly, we want to use
, for example,
maybe our own DHCP server that we already have in place.
Let's go ahead and put this guy at, for example, dot two on the 23 dot one dot
two network.
And let's imagine that DHCP server has a pool of addresses for the 10 10
network.
I'll go ahead and label that 10 10 and we have a pool of addresses for 10 dot
20.
We could then go to these segments and we can enable effectively the DHCP relay
services right here.
And that would support any DHCP clients here on segment 10. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And that would support any DHCP clients here on segment 10.
We could also enable DHCP relay for segment 20 to support all the clients over
here on the 10 20 network.
So each of these gateways would logically on these interfaces connected to the
10 10 and 10 20 networks respectively,
would see those discover messages encapsulate them and then route them to the
IP address of our DHCP server.
And they would source them from the address base here.
If this is dot one and this is dot two, the source IP address for those encaps
ulated and now shipped over to the DHCP server unit cast packets. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
The source address is going to be the interface address connected to the local
network where the clients are.
And then with this DHCP server receives those DHCP discover messages, it can go
ahead and make offers from the appropriate pools based on where that relay
agent sent it from.
So over here, hopefully we have an IP address in a pool from 10 10 that it can
serve down to clients over here.
And over here, hopefully we have an IP address or two available in our pool in
the 10 20 subnet, which the server could make an offer for over here.
And these gateways are then acting as the middleman, the DHCP relay agents WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And these gateways are then acting as the middleman, the DHCP relay agents
between the real DHCP server up here and our clients on these respective sub
nets.
So that is yet another option we have to set up a DHCP relay.
And our third option we have is setting up gateway DHCP services.
And the reason we didn't use gateway DHCP services down here is because this
segment segment 30, we didn't have a gateway.
We didn't have a logical layer three router connected from an NSX perspective
to this network segment.
So as a result, if you don't have a gateway connected, our only option here for
DHCP services would be either through NSX providing segment DHCP server right WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
DHCP services would be either through NSX providing segment DHCP server right
here, or if we had a VM right here, for example, connected to that segment,
which could act as a local DHCP server.
However, if we've got our segments like segment 10 and segment 20, we're
already connected to those segments with our gateways, we can simply enable
gateway DHCP services.
And behind the scenes, we'll reference a profile that points to a virtual DHCP
server inside of NSX.
We can use the same IP address as we had up here.
And then as we configure the details for the gateway based DHCP services, for WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then as we configure the details for the gateway based DHCP services, for
segment 10, we can say we want to use, let's say, 10.10.0.151 all the way
through 200.
And then over here for segment 20, we can use 10.20.0.151 all the way through
200.
And then for the default gateway, we specify whatever the IP addresses by that
logical router interface.
So on segment 10, it'd be 10.10.01 and over here on segment 20, it'd be 10.10.0
.
I put a do there.
We were just talking, you know, creatively, but in our existing topology, that WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We were just talking, you know, creatively, but in our existing topology, that
isn't a two on this logical gateway B.
It is a dot one on the 10.20.0 network.
So let me update my notes here as well. And we'll put a dot one there.
So as part of our options as part of DHCP that we're going to hand out for
clients on segment 20, we'd hand out the default gateway information of 10.20.0
.1.
We'd hand out whatever IP address we want them to use for DNS resolution.
And it could be, for example, a DNS server out here on the internet or a DNS
server that we have here in our enterprise. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And so one of the questions that might be asked is, okay, why would we ever use
a segment DHCP server to support, for example, any of our segments versus a
gateway DHCP server?
A gateway DHCP server. And the answer is, if you've got a gateway connected to
your networks, you're probably always going to use a gateway based DHCP service
.
And in the off chance that you've got some segment with no logical router
configured to it whatsoever.
In those situations, the only option you have from an NSX perspective to
provide DHCP services is a segment based DHCP server.
And the great news is this. We are going to have a chance in this set of videos WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the great news is this. We are going to have a chance in this set of videos
and in the skill to configure and demonstrate each of the devices.
Now, to make it as successful as possible, what we ought to do also is we ought
to put a game plan together.
So in the next video, let's put a specific game plan together for how we're
going to implement DHCP relay inside our topology.
And then after we verify that, we'll then move on to segment based DHCP
services to support a segment where there is no layer three gateway.
And then last but certainly not least, we'll also walk through setting up WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And then last but certainly not least, we'll also walk through setting up
gateway based DHCP services to hand out IP addresses to segments where they
have a directly connected gateway.
So I'll see you in the next video as we put that game plan together.
together.