All right.
It's time to get our hands dirty with DHCP, which
will involve some troubleshooting as we
go through this together.
This is a hands-on lab.
So if you're logged on from a computer
to the CBT Nuggets website, click on that link
for the virtual lab.
And let's do this together.
Every good lab deserves a plan.
So let's go to the whiteboard.
We'll define what our intention is.
Then we'll go to the hands-on.
So let's do this.
Let's configure a DHCP server here on R8.
And let's support the 10.0.1 network for IPv4. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And let's support the 10.0.1 network for IPv4.
10.0.1.0.
The default gateway, the default router is going to be .1.
Let's set up a DNS server of 8.8.8.8.
And let's also specify an option.
How about option-- let's do option 43 for anybody
who might want that, or need it, or care about it.
So that will give us a good summary of those,
of how to create a pool.
And then the client, we're going to go ahead have a client up
here, a client PC. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
here, a client PC.
So we'll want to IP helper on gig 0/0.
And we'll want to point to the server.
And let's imagine that R8's loopback is 8--
oh, can't write under my face there--
is 8.8.8.8.
And that also implies connectivity,
making sure we have reachability to that 8.8.8.8 address.
Oh, you know what?
Let's also do it for--
let's also make R3 gig 1/0 a DHCP client.
And so he's on a different network.
This is the 10.0.13 network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
This is the 10.0.13 network.
It will also need-- this will be pool 10-- we have pool 1,
and we'll also make pool 2.
And pool 2 will be the 10.0.12 network.
And the default gateway will be .1.
And then we can throw in options and DNS
if we want to as well for that.
In fact, let's use the same DNS server.
So this is a good example of creating two pools.
And when R1 sends the request to the DHCP server,
the request is going to be sourced from the helper
interface. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
interface.
So it's sourced from 10.0.1.
We know to go for this pool.
If it's sourced from 10.0-- oh, that's 13.
That got cut off a little bit right there.
If it's sourced from 10.0.13, it knows
it's appropriate for this network.
We can change that right there.
Wow.
That's the 13 network between R1 and R3.
So having said that, let's go to the hands-on lab together.
And let's configure this, verify it, and troubleshoot it
as we go.
Here we go.
Let's do a show ip interface brief here on R1 just
to get warmed up, make sure we're on the right interface. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
to get warmed up, make sure we're on the right interface.
That's the 10.0.1 network.
Fantastic.
So config t.
And interface configuration mode for gig 0/0.
We'll do ip helper-address.
And it's going to be 8.8.8.8.
That's the loopback address of R8.
And oh, it says, hey, I need four octets there.
All right.
You can have four octets
And then we also want to make sure that we can reach that,
because if we can't reach that address,
we're not forwarding too many DHCP requests there.
Let's do a ping. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's do a ping.
Do 8.8.8.8.
So this is a troubleshooting section.
So let's do a Control-Shift-6.
I'm going to stop that.
Do a show ip route.
And there is no 8.8.8.8 network anywhere.
Well, let's go down to R8 and find out why that is.
So here on R8, we'll do a show ip route.
Let's look at-- let's see what's running-- show ip protocols.
I think I saw OSPF.
So OSPF version 3 supporting the address family of IPv4. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So OSPF version 3 supporting the address family of IPv4.
So we did a show ip ospf interface brief.
I love this part.
Now, it's like, what?
That's because there's multiple ways-- we've covered
this in the OSPF sections.
There's multiple ways of configuring OSPF.
And if we use OSPF version 3, that
means that we have the address families within them,
which means we have some slightly different commands.
Let's do a show ospf version 3 ipv4 interface brief. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's do a show ospf version 3 ipv4 interface brief.
There we go.
So we don't have the OSPF enabled
on the loopback interface.
So we can fix that.
Let's do a show run interface gig 0/0.
I'm going to steal the syntax off there.
And config t interface loopback 0.
And this guy right here.
We're going to take OSPF version 3, process ID 1,
for IPv4 address family, and assign that to be in area 2. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
for IPv4 address family, and assign that to be in area 2.
I'm going to right-click.
OSPF version 3.
IPv6 is not enabled on this interface.
So even though we don't care about IPv6
at all, because OSPF V3 is IPv6 related,
we have to enable IPv6 on the interface.
We don't have to assign a globally routable address,
but we have to enable it this--
ipv6 enable.
We could also put it on an IPv6 address,
but that would be overkill.
And that's enabled.
Now we can do the OSPF version 3 process ID WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Now we can do the OSPF version 3 process ID
1 IPv4 area 2 command.
It says, OK, great, because OSPF version 3 only
likes to participate with interfaces
that are enabled for IPv6, even if it's supporting just IPv4.
So there's some troubleshooting for us right there.
Now that we've done that, let's go back to R1.
And let's verify a ping real quick.
Yep.
There we go.
Show ip route.
We should now have the 8.8.8.8 network.
Fantastic.
So we've got reachability.
Let's go create a couple pools for IPv4 DHCP over on R8. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's go create a couple pools for IPv4 DHCP over on R8.
We'll create a pool for the 10.0.13 network,
and also for the 10.0.1 network.
And that way we can support R3 as a client
and the Windows 10 machine in the lab as a client as well.
So back to R8 we go.
Here on R8, we'll config t, and ip dhcp pool.
How about POOL1?
There we go.
We'll take the third octet, which is a 1,
and we'll just call it POOL1 so we can remember.
And the network is 10.0.1.0. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the network is 10.0.1.0.
And we can use a slash 24 here.
If you wanted to do a dotted decimal, party on.
And the default gateway is going to be R1's address--
10.0.1.1.
These are the things I would check, too, if I
had some problems with DHCP.
If we're handing out the wrong default gateway,
that's not going to work very well for our clients.
Default router, and DNS server is-- let's go ahead
and do 8.8.8.8.
Let's also do option.
So do option-- how about 1? WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So do option-- how about 1?
Let's do option 43.
And let's say its IP is 1.2.3.4.
And option 150 IP is going to be 3.4--
I'm just making some numbers up here as far as the addresses.
But the key is if you need option X,
make sure that option X is included in your pool.
And that way your client can go ahead and get it.
Let's do a quick--
let's do the other pool-- ip dhcp pool. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
let's do the other pool-- ip dhcp pool.
We'll call this POOL.
And it's going to be 13.
And we've got some similar commands here.
DNS server, that's good.
And let's go ahead and do a default router
that's going to be 10.0.13.1 on that network.
That's pointing up to R1.
And let's see.
What am I missing here?
Oh, how about a network?
That would be really handy.
Let's hand out a network. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Let's hand out a network.
We can hand out IP addresses.
Network 10.0.
And that's going to be 13.0.
And we can put in the slash 24.
Anytime I get a chance to do that on an IOS, I like to.
It doesn't happen that often.
As opposed to 255.255.255.
Let's check our work.
Show ip dhcp.
Let's do this, show ip.
Let's go to show run section dhcp.
I just want to see the config for DHCP.
And here it is.
WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Network, network, that looks good.
And DNS, DNS, default router.
OK.
That looks good enough.
Let's go ahead and turn this on.
Oh, also, what we should do in a production environment
is we should also do the excluded address ranges here
on the router.
So if we do a show ip dhcp, the show ip dhcp
is showing more server-related options.
If we were acting as a client, if we do show dhcp, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
If we were acting as a client, if we do show dhcp,
we can see that R3 in just a little bit.
So show ip dhcp bindings.
We don't have any clients yet, but when they show up,
they'll be here.
Let's see what else is interesting to look at.
Show ip dhcp.
This will get server statistics.
This is a good one right here.
You guys, if you're troubleshooting DHCP,
and you're wondering, OK, what's going on?
Am I handing out addresses?
Also, what kind of messages are going on?
I mean, we're familiar with the basic discover offer WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I mean, we're familiar with the basic discover offer
requests and acknowledgment, but here we
have some other ones that we could look at.
DHCPNAK, the negative acknowledgment.
No!
DHCPDECLINE, also not good.
DHCPRELEASE, a client wants to get rid of an IP address.
Let it go.
And then there's some vendor-specific ones as well.
So you could look at those and say, what am I receiving?
Or if I'm not receiving any requests, like if we were not
seeing any DHCP requests whatsoever,
I'd go check our relay and make sure the DHCP relay has us WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I'd go check our relay and make sure the DHCP relay has us
as the correct address to send those requests to us.
So if the DHCP server may be perfect,
but if it's not receiving any requests,
it's not going to be handing out too many addresses.
So let's do a show ip dhcp.
So we took a look at binding.
Conflict will be good in a moment,
because I'm not doing excluding.
I'm not excluding addresses.
So the first address it's going to hand out is .1.
Guess who owns that.
R1.
So it's going to have a binding conflict, WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So it's going to have a binding conflict,
and the DHCP server is going to ping that address,
get a response, say, whoa, whoa, whoa.
It's already in use.
There's a conflict.
I'm going to hand out the next one.
It's fantastic.
It pings that one, too.
There's no response.
It continues on.
Did we already do pool?
So there's our pool information.
If we had excluded addresses, it would show how many
we're excluding here as well.
Let's go tell-- let's go get some clients.
So we'll go back to our topology.
And we'll go back to his client PC.
It's in the lab.
It's the Windows 10 PC. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's the Windows 10 PC.
And we'll also go to R3.
And we'll make them both IPv4 DHCP clients.
And we'll troubleshoot if it doesn't work.
So let's go back to the CLI.
And we'll go to the client PC.
And sometimes at times I'll have to log back in.
That's great.
In this version of Windows 10, Windows 10 evolves, of course,
but in this version, you can right-click on the Windows
icon, bottom left-hand corner.
And then you can go to Network Connections, which I would have
us do, a fast way to get there. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
us do, a fast way to get there.
And then once this comes up, let's
disable the Ethernet adapter.
I always like doing that, unless you
were remotely connected to it over the adapter.
And let's go look at the properties of that interface.
So it's shut down.
Logically, let's go to IPv4 right here.
And let's say use IP address.
Get an IP address automatically, and also, DNS automatically.
That way, we can verify it worked.
Also, for this discussion, I'm going to turn off IPv6,
as we're saving that for another video.
That way we don't have to look at all the IPv6 information. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
That way we don't have to look at all the IPv6 information.
We'll click OK.
Then we'll bring it up.
Right-click on the interface.
Enable.
And while that's happening, we'll
go ahead and bring up a command prompt.
So we can just right-click on the Windows icon.
And on this flavor of Windows, you
can just click on Command Prompt.
If you're on a newer version of Windows,
it's probably going to give you options for PowerShell.
That's OK, too.
That would also work.
Let's do an ipconfig.
And let's add on all right there.
And that way we can see all the details.
So here's our Ethernet 1 interface. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So here's our Ethernet 1 interface.
And we are DHCP enabled.
Yep!
We have this address, 10.0.1.2, because that one was already
in use.
And it's showing us the default gateway.
It's showing us the DNS server.
Fantastic.
Wonderful, wonderful.
And if we went back to the server, which is R8,
this means R1 did its job.
It relayed the traffic.
And if we go back to R8, there's our conflict message.
It's funny to be able to see that.
So we do a show ip dhcp and conflict.
It's going to say, yep, I was going to hand out this IP WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's going to say, yep, I was going to hand out this IP
address a few moments ago.
And I pinged it.
And unfortunately, somebody responded.
So I thought, ah, there's a conflict.
I'm going to make a note of it here, and try the next address,
which happened to be .2.
And we can do a show ip dhcp database.
Well, let's go ahead and do a binding.
So there's our binding table.
10.0.1.12.
It was assigned.
And it's going to be good for--
how long is it good for?
Does it say here? WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Does it say here?
The default.
Let's do another one of--
the default leases one day, 86,400 seconds,
something like that.
Show ip dhcp server.
Yeah, let's do server and statistics.
And we should have some more numbers coming up here.
So we have two address pools.
Automatic binding is one.
And look at this.
We had to discover.
There was a request.
Fantastic. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Fantastic.
And we had an offer and an ACK.
So if we start seeing the options
with negative acknowledgment, or decline, and things like that,
we can realize that something's up.
What's going on?
We can take a closer look.
Let's also go to R3, which in our topology is right here.
And let's go ahead and give gig 1/0 an IP address.
Then we can use the client commands
from a DHCP perspective and take a look
at what it's thinking from a DHCP client on IOS.
So we'll hit go here at R3.
We'll do show ip interface brief. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
We'll do show ip interface brief.
Make sure we get the right interface.
We're after the interface.
It has the 13 in that third octet.
Great.
And interface.
Also, this is a fun command.
I like this.
Default interface and gig--
let me get the right one--
1/0.
Boom.
IPv6, IPv4, routing protocols, boom, gone.
So now if we do a do show run for interface gig 1/0.
WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
All right.
Expected.
Back to square one.
So let's configure DHCP.
So interface gig 1/0.
And we'll do an ip address, and dhcp.
Boom.
We're done.
And we just wait.
We wait, and we wait, and we wait.
And here's why we're going to wait quite a while on this.
It's because I don't think we enabled DHCP relay or the IP WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
It's because I don't think we enabled DHCP relay or the IP
helper function on gig 2/0 on R1.
So we're just broadcasting in the wind.
Discover, discover, discover.
Nothing's coming in.
So let's go down to R8.
And we can put some debugs on for troubleshooting
if we wanted to.
So on R8, if we did a debug ip dhcp.
There's lots of options--
server.
And let's go ahead and--
WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
let's do events.
We could do packets, but that's going to be--
we could events and packets.
Let's do that.
So if we go back to R3, and we do a shut and a no shut,
there's just nothing going on here,
because the router that should--
R1, which should be doing DHCP relay,
hasn't been configured to do it.
So yeah, sort of like very quiet day, one client, no big deal.
So let's go back to R1. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
So let's go back to R1.
And we'll go to interface.
Let's verify the interface, do show cdp neighbors.
So the interface that goes down to R3 is our gig 2/0.
So interface gig 2/0 with an ip helper-address.
And it's 8.8.8.8.
We already verified a route earlier.
And now that client should be much more happy.
If we go down to R8--
I'm not going to--
if we waited it, might try again.
But let's go to R3, and let's just force it. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
But let's go to R3, and let's just force it.
No ip address, and ip address dhcp.
That's going to force it.
And we go to R8.
Here comes the traffic.
It's coming.
And the debuts are on.
Woohoo.
Look.
It got the IP address right there.
10.0.13.2 is what we assigned him.
And there's our discover.
And I'm looking to see if there was--
unicasting the BOOTREPLY.
Oh, there we go right there. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
Oh, there we go right there.
Look at that.
Ping conflict.
So it sent out a ping to the IP address
it was about to hand out.
And it got a response.
It said, oh, not good.
So as a result, it went to the next IP address.
And right here, this giaddr, that's the address.
And it also happens to be the source
address of the packet that was sent from the DHCP relay.
And that's how router 8 said, oh, this came from 10.0.13.
I have a pool with a matching network there.
I must pull from that one, and hand it out to the client.
So that's great.
I'm going to turn off the debug there with an un all. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
I'm going to turn off the debug there with an un all.
And let's go back to R3.
And let's do some commands here.
Show ip route.
Look at that.
It got a default route from DHCP.
And look at that AD.
It got the--
254 is the worst.
Well, 255 is don't use this.
But 254 is a really bad AD.
And however, we didn't have a default route before,
so it took it.
It got it via the DHCP.
And that's pointing to the default gateway of 10.0.13.1,
which we handed out as the default gateway. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
which we handed out as the default gateway.
What else can we do here?
Show dhcp.
So if it's the server, you do show ip dhcp
and all the commands.
For a client, show dhcp, and then
if we want to take a look at the lease.
Oh, there's the lease right there.
So 86,000 seconds, 1 day by default.
We're going to renew it in a period of time.
Fantastic.
There's the IP address that we've been given.
Wonderful.
Show ip-- excuse me-- show dhcp server.
And the show ip dhcp server is going WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And the show ip dhcp server is going
to show us information, including the DNS information
that we got as an option.
And if we go back to R8, to the DHCP server
itself-- let's do a show IP dhcp.
And let's do bindings.
And now we have information about those two clients
that got IP addresses.
And we'll do a show ip dhcp server statistics.
Those counters are going up.
And we also do show ip dhcp server pool.
WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And maybe there's no server in front that.
Sure enough.
It's just pool without the server in front.
And it's showing us the information on the pool,
including how many addresses are leased.
And there's one each.
Also, how many addresses are excluded.
Because there was a conflict on both those subnets,
it's automatically showing it as an excluded address
that it's not going to try to hand out again.
All right, my friends, so that was a lab full of fun
right there with troubleshooting DHCP for IPv4.
And I strongly encourage you to practice this a few times. WEBVTT X-TIMESTAMP-MAP=LOCAL:00:00:00.000,MPEGTS:900000
And I strongly encourage you to practice this a few times.
It'll reinforce the commands.
And also, when it comes time to troubleshoot DHCP,
you'll be that much more familiar with it.
As fun as that was, there's something equally as fun.
And that is IPv6 DHCP services and troubleshooting it.
And that is the topic for our next video and lab.
I'll see you there in just a moment.
Meanwhile, I hope this has been informative for you.
And I'd like to thank you for viewing.