This is one of multiple videos discussing the troubleshooting of dynamic host configuration protocol,
or DHCP. In this topology
I've got a iOSV router acting as a PC and an iOSV acting as a DHCP server.
I've also got a router that's simply doing routing from one subnet in the network to another.
We've been told that the DHCP client in this topology is not receiving an IP address and we need to troubleshoot
this issue.
So let's look at what's going on.
OK, so here's the client show, IP interface brief, the client is configured for DHCP, so Gigabit
00, the interface used by the router to connect to the network is currently up, up.
In other words, layer 1 and layer 2 are working, but no IP address is
assigned. Show run interface Gigabit00 shows us that the interface is configured for DHCP, but once again
we're not getting an address assigned.
Let's have a look at router 2, which is doing inter VLAN routing show IP interface brief, we can see
that an IP address is configured on gigabit00 as well as gigabit01.
Let's have a look at the DHCP server show IP Interface Brief.
This is the IP address of the DHCP server.
Can the router ping the DHCP server?
Yes, it can.
So we can ping from the router to the DHCP server show run interface gigabit 00, notice this command
IP helper address.
So that looks good.
Helper
address is configured to point to the DHCP server.
Let's run a Wireshark capture here to see if any DHCP messages are being sent to the DHCP server.
So I'm capturing on this link what I'll do is shut and no shut the interface on the client.
To get it to request an IP address from the DHCP server that will allow us to see whether the DHCP requests
are getting to the DHCP server.
So in Wireshark, we are seeing a number of DHCP messages of filter for BOOTP.
We can see that the router is requesting an IP address on behalf of the client.
So here's the bootstrap protocol discover message.
Client IP address is not configured, the relay agent is router 2. So show IP interface brief the router
is receiving a DHCP Discover from the client on this interface and is then forwarding that to the DHCP server
so we're definitely getting DHCP Discover messages.
On this link
let's do a debug on the DHCP server. So debug IP, DHCP server, and let's look at events.
I'll force the client to request an address again.
OK, so something's happening, let's stop debugging.
So we're getting a discover from the client, so it's definitely being received by the DHCP server,
the servers receiving the Discover message, but can you see what's wrong in the output here?
What's the problem?
Let me give you another hint.
Show IP DHCP pool.
What's the problem?
Can you see the issue in the debug and in the show command?
OK, notice this output, we're told that the pool is empty.
Notice this, there's a problem with the addresses allocated.
The server is definitely receiving messages, so we were receiving discover messages.
There's one address pool available.
OK, see if you can see the problem in the running-config of the router.
What's the issue here?
Notice IP DHCP excluded-address 10.1.1.1 to 10.1.1.255 we've excluded all the addresses
from the DHCP pool, so no IP addresses can be allocated to the client.
Show IP DHCP pool,
we have a pool in this range, but no addresses are available because we've excluded them, so
Let's remove the statement
and use the command IP DHCP excluded-address 10.1.1.1 to let's say 10.1.100. Show run
Excluded addresses are now in this range for the pool.
Notice on the client, an address is now assigned address 101, so show IP interface brief.
The client has been allocated an IP address and should hopefully at this point be able to ping the DHCP
server, which it can.
Be careful with the excluded addresses in the pool, so show IP DHCP binding, we now have an address
allocated to the client, show IP DHCP pool.
One address is now least.
Next address to allocate is 10.1.1.102.
Notice previously that the current index was set to 0.0.0.0.
In other words, no addresses would be allocated to clients.
But now the next address that will be allocated is 10.1.
.1.102.
So if I change the MAC address on this client to something
Like this and no shut the interface down and then no shut it.
What we should see is that the index changes and there you go.
Because the client has been allocated this address, so the next available address is this one.
So that was an example of how to troubleshoot DHCP.
I hope you found the video useful.
If you did, please like it.
And please also subscribe to my YouTube channel.
I wish you all the very best.