This is one of multiple videos discussing dynamic host configuration protocol, or DHCP, this is a DHCP
troubleshooting video.
We've been told that the client on the left in this topology is not receiving IP addresses from the
server on the right.
So let's investigate what's happening.
So here's the client.
I'm using an iOSV router to mimic a client in this GNS3 topology. Show IP interface brief.
We have gigabit00 configured for DHCP, but the interface is currently administratively
down.
So let's enable that interface show, IP interface brief, interface is now up up, as we can see here,
but at the moment we are not receiving an IP address from the DHCP server.
This router is acting as the DHCP server.
So show IP DHCP pool allows us to see that a DHCP pool is configured on this router with the name PC Pool.
There are 254 addresses configured in the pool in this range.
No addresses have been leased at the moment.
Show IP DHCP binding also shows us that no addresses have been leased to any devices.
So DBUG IP, DHCP, server packet.
Let's have a look
in real time
what's happening.
The client still doesn't have an address. So what I'll do is shut the interface down and then
no shut it.
To see if that makes any difference, so the interface comes up but notice we see no output on the
DHCP server.
In addition to using CLI commands, what I'm gonna do here is use Wireshark and capture traffic
on the link between the client and the router to see if DHCP requests are being sent.
So notice we do see a DHCP Discover.
It's coming from a device with no IP address and it's going to a broadcast of 255.255.255.255
the source is UDP or user datagram protocol port 68
destination is 67.
This is the bootstrap protocol.
In other words, it's a DHCP discover message the client is trying to discover a DHCP server on the network.
Now, in addition, I'll start a Wireshark capture on this side
to see
if any DHCP messages are received on the server side.
So back on the client, I'll shut the interface down.
I'll no shut it
and let's see if we see any DHCP traffic on the server-side, server-side is seeing no traffic at all
but the client side
is seeing DHCP discover messages, and there are quite a few of them.
Now, in Wireshark, if you filter for DHCP, it doesn't work.
So you need to filter for BOOTP, so use BOOTP rather than DHCP when filtering for messages, we see
a lot of DHP discover messages on the client-side, but none on the server-side.
So it looks like the DHCP Discover message is hitting the router, but is not being sent to the server.
Now notice the type of message used here.
This is a broadcast.
A broadcast is not forwarded by a router or layer 3 switch.
Something needs to be configured on the router to enable that traffic to be sent to the server.
So show run interface gigabit00.
Can you find the problem?
I've given you a few hints.
Once again, DHCP messages are being received by the router, but they're not being sent to the DHCP server.
What's missing in this configuration?
OK, so DHCP messages are dropped by the router because they broadcast messages unless you enable the IP helper
address command.
So we need to enable the IP, helper-address and then send the traffic to the DHCP server.
Now in this topology, the DHCP server has this IP address, so we need to configure the IP helper-address on
router 2 and point it to the DHCP server. Now that I've done that
let's see if DHCP messages are forwarded to the server and notice without doing anything else, we can
now see the DHCP Discover this is between the router
and the server. I'll filter for BOOTP notice there's the discover message from 10.1.1.254
to 10.1.2.1.
Now 254
is router 2.
So notice the Discover message was forwarded to the DHCP server
for a client
with the name client, in other words
router 1, acting as the client.
You can see in the output here that the router received an IP address from the DHCP server, and you
can see that here as well.
So this is the DHCP Discover forwarded to the server.
The service then replying back to the router
with an offer
saying that this is the service IP address leased time is one day
default gateway or default route is 10.1.1.254. The client is requesting the address, so
this Wireshark captures on the right end side of this topology.
So the client would have sent that message to the router and the router is now forwarding that message
to the server.
We can see that by looking at the Wireshark capture here. Here's the offer from the server to the client
and here's the clients sending a broadcast requesting the address. Broadcasts are not forwarded by the
router.
The client is requesting this address from the DHCP server.
The DHCP server acknowledges that and gives the client this address 10.1.1.2.
So previously the address that was offered to the client was 10.1.1.2
and that was given to the relay agent 10.1.1.254
in other words, the router.
The client is requesting that address and the DHCP server acknowledges it. So hence the client router 1
is given this IP address and if we look at the routing table, it's been allocated 10.1.1.254
as its default gateway
and that's because on the DHCP server and notice here you can see all the debugs showing you DHCP Discover,
DHCP request and so forth.
The DHCP server has been configured
with this configuration. Client is being allocated an address in this range default router is 10.1
.1.254 DNS server is 10.1.2.1 which is the DHP server.
So that was an example of how to troubleshoot dynamic host configuration protocol or DHCP.
I hope you enjoyed the video.
If you did, please like it, and please subscribe to my YouTube channel.
I wish you all the very best.