In this lab, we want to look at troubleshooting DHCP
on our network.
We have a topology in which we're told that PC1 does not have
any network access.
The PC is configured for DHCP, and we have a server at 10.0.0.50,
which should be providing addresses to our network devices
over 192.168.0.0/24.
However, the PC is unable to reach other devices on the network.
So for example, it has no communication with a
local server at 192.168.0.200.
So go
ahead and pause this video.
Import the attached YAML file into Cisco Modeling Labs so that you
can use the provided base topology and see if you can resolve
this DHCP issue.
Once you do that, you can resume the video and we'll
take a look at the solution together.
So first, let's go in and take a closer look at our issue
from PC1.
Let's simply try to ping 192.168.0.200,
which is our local server, and we can see that this
does indeed fail.
We're told that this is an unrecognized address or the
protocol is not running.
Let's also try to ping our default gateway, 192.168.0.1 and we
get the same failure.
So we are unable to ping either our local server or the
default gateway.
Let's say show IP interface brief, and you'll see that gig 0/0
is actually connecting out to our switch.
But we're told we don't have an IP address.
And in fact, we're in the down state.
If we say show run interface gig 0/0,
you can see that we have configured this interface
for DHCP. By the way,
in this case, we're just using a Cisco router acting as a
PC, just for simplicity.
But even though this is configured for DHCP,
we're not able to obtain DHCP information.
Let's jump over to our local server and let's do
something similar.
Let's say show IP interface brief.
Now here we can see we do have a valid IP address,
192.168.0. 200.
We have
statically configured that which is a best practice.
And that's something we would typically do with a server
on our network.
So there doesn't appear to be an issue from here.
Let's try to ping that default gateway.
And that is successful.
So at this point, we have no Layer 2 or Layer 3 connectivity
from our PC to the default gateway.
Now there are several things that could cause this,
such as VLAN assignment or spanning-tree issues and so on.
But when we're troubleshooting, we want to start with the basics
and work our way up.
So let's jump on to the DHCP server.
And let's make sure we have a DHCP pool configuration in place.
Let's say show IP DHCP pool.
And you can see we do currently have an address pool.
We can see that here, the range of 0.1 through 254.
And we can see that we have zero least addresses at the moment.
So let's go ahead and also say show IP DHCP binding
just for further verification.
You can see that our DHCP binding table is empty.
So we have not handed out any IP addresses through DHCP.
Let's also say, show run pipe two section DHCP.
This is another place that we could verify that we have a good
configuration in place.
And you'll see, again, we have our pool named POOL1,
we see our network address range, /24 network,
and we also have an exclusion.
So we are not going to hand out the 192.168.0.200
IP address.
And that's actually good because we have statically configured our
server with that address.
So we wouldn't want two clients on the network with the same
IP address, obviously.
Now you can see from our topology that our DHCP server is in a
different subnet than that of our PC.
If you remember our discussion of DHCP in a previous video,
we stated that by default, routers will not forward broadcast
messages.
So the DHCP discover message that's sent from a DHCP client,
which is PC1 in our case, that goes out as a broadcast
message.
So if this client and the DHCP server are on different subnets
as they are here, that broadcast message would never
reach our server and the client would not be able to obtain
DHCP information.
So when we see these on two different subnets,
that should alert us to the fact that we should have a DHCP relay
agent configured somewhere which will relay these broadcasts
over to our DHCP server.
So let's see if that is the case.
Let's go to our router R1.
And let's say show run interface gig 0/0.
Now we're looking at 0/0 because that is the interface
that's facing our clients.
It's facing the network where our PC is contained.
And we can see in the output, we do have an IP helper address
configured here.
Again remember you want to configure the DHCP relay on the
interface that's local to the host network.
That's important in order to receive the broadcast messages.
So that's why we're looking at gig 0/0.
So it is applied on the correct interface.
We are using it as a DHCP relay agent.
But do you see the issue?
We have an incorrect IP address.
We have a typo here.
We have 10.0.0.5.
We actually need to be
10.0.0.50.
So let's correct this.
Let's go under interface configuration mode.
For interface gig 0/0,
and let's take out the incorrect command.
We'll say no IP helper-address.
And we currently have
the incorrect address of 10.0.0.5.
So let's remove that.
Let's put in the correct one.
IP helper-
address
10.0.0.50.
So now
with that in place, let's jump back over to our PC.
Let's go under interface gig 0/0,
and let's bounce this interface just to kickstart
our DHCP process.
Let's shut,
and no shut
to balance that interface.
We're going to see console messages here where our interface
went down and it's gone back up.
And shortly, we should see another console message letting us know
that we have obtained DHCP information from our DHCP server.
So let's give it just a moment,
see if that's the case.
And sure enough, we see that come in.
It has been assigned.
And it tells us it was assigned the address 192.168.0.2.
Let's see if that's the case.
Let's say show IP interface brief.
And yes, we do see gig 0/0 now has an IP address obtained
through DHCP.
It is in the up up state. So that appears to be working correctly.
Let's try to ping the default gateway
192.168.0.1.
That looks great.
Now let's try our local server 0.200.
And that works as well.
We had our first ping failed, of course,
as we were resolving that, but subsequent pings give
us 100 percent success rate. So that looks good.
One more verification we can do.
So we can go back to our DHCP server.
And let's say again show IP DHCP
binding.
Now we see we have handed out the 0.2 address to our PC client,
just as we would expect to see.
So it looks like DHCP is now working correctly in the network.
So that's a look at troubleshooting DHCP,
specifically, a DHCP relay agent using an IP helper address.