1 00:00:09,570 --> 00:00:18,240 This is one of multiple videos discussing dynamic host configuration protocol, or DHCP, this is a DHCP 2 00:00:18,240 --> 00:00:19,460 troubleshooting video. 3 00:00:20,250 --> 00:00:27,870 We've been told that the client on the left in this topology is not receiving IP addresses from the 4 00:00:28,470 --> 00:00:29,650 server on the right. 5 00:00:30,240 --> 00:00:32,259 So let's investigate what's happening. 6 00:00:33,120 --> 00:00:34,590 So here's the client. 7 00:00:34,590 --> 00:00:43,500 I'm using an iOSV router to mimic a client in this GNS3 topology. Show IP interface brief. 8 00:00:44,310 --> 00:00:50,640 We have gigabit00 configured for DHCP, but the interface is currently administratively 9 00:00:50,640 --> 00:00:51,090 down. 10 00:00:53,200 --> 00:01:04,050 So let's enable that interface show, IP interface brief, interface is now up up, as we can see here, 11 00:01:04,959 --> 00:01:11,920 but at the moment we are not receiving an IP address from the DHCP server. 12 00:01:13,310 --> 00:01:15,320 This router is acting as the DHCP server. 13 00:01:16,510 --> 00:01:26,780 So show IP DHCP pool allows us to see that a DHCP pool is configured on this router with the name PC Pool. 14 00:01:27,400 --> 00:01:32,360 There are 254 addresses configured in the pool in this range. 15 00:01:33,010 --> 00:01:35,170 No addresses have been leased at the moment. 16 00:01:35,380 --> 00:01:43,150 Show IP DHCP binding also shows us that no addresses have been leased to any devices. 17 00:01:44,140 --> 00:01:47,830 So DBUG IP, DHCP, server packet. 18 00:01:48,670 --> 00:01:49,300 Let's have a look 19 00:01:49,300 --> 00:01:50,020 in real time 20 00:01:50,020 --> 00:01:50,680 what's happening. 21 00:01:51,310 --> 00:01:58,790 The client still doesn't have an address. So what I'll do is shut the interface down and then 22 00:01:58,790 --> 00:01:59,560 no shut it. 23 00:02:01,140 --> 00:02:08,789 To see if that makes any difference, so the interface comes up but notice we see no output on the 24 00:02:08,789 --> 00:02:09,870 DHCP server. 25 00:02:10,750 --> 00:02:17,860 In addition to using CLI commands, what I'm gonna do here is use Wireshark and capture traffic 26 00:02:17,860 --> 00:02:23,380 on the link between the client and the router to see if DHCP requests are being sent. 27 00:02:24,460 --> 00:02:27,940 So notice we do see a DHCP Discover. 28 00:02:29,230 --> 00:02:35,740 It's coming from a device with no IP address and it's going to a broadcast of 255.255.255.255 29 00:02:36,550 --> 00:02:42,640 the source is UDP or user datagram protocol port 68 30 00:02:42,760 --> 00:02:44,280 destination is 67. 31 00:02:45,070 --> 00:02:46,780 This is the bootstrap protocol. 32 00:02:48,180 --> 00:02:56,300 In other words, it's a DHCP discover message the client is trying to discover a DHCP server on the network. 33 00:02:56,910 --> 00:02:59,760 Now, in addition, I'll start a Wireshark capture on this side 34 00:03:01,060 --> 00:03:01,870 to see 35 00:03:03,230 --> 00:03:07,760 if any DHCP messages are received on the server side. 36 00:03:08,940 --> 00:03:12,090 So back on the client, I'll shut the interface down. 37 00:03:14,970 --> 00:03:15,990 I'll no shut it 38 00:03:17,640 --> 00:03:24,050 and let's see if we see any DHCP traffic on the server-side, server-side is seeing no traffic at all 39 00:03:26,820 --> 00:03:28,440 but the client side 40 00:03:30,620 --> 00:03:34,850 is seeing DHCP discover messages, and there are quite a few of them. 41 00:03:35,790 --> 00:03:40,820 Now, in Wireshark, if you filter for DHCP, it doesn't work. 42 00:03:41,730 --> 00:03:49,230 So you need to filter for BOOTP, so use BOOTP rather than DHCP when filtering for messages, we see 43 00:03:49,230 --> 00:03:56,580 a lot of DHP discover messages on the client-side, but none on the server-side. 44 00:03:58,440 --> 00:04:05,110 So it looks like the DHCP Discover message is hitting the router, but is not being sent to the server. 45 00:04:05,700 --> 00:04:08,690 Now notice the type of message used here. 46 00:04:08,700 --> 00:04:10,050 This is a broadcast. 47 00:04:10,960 --> 00:04:16,870 A broadcast is not forwarded by a router or layer 3 switch. 48 00:04:17,560 --> 00:04:23,770 Something needs to be configured on the router to enable that traffic to be sent to the server. 49 00:04:24,970 --> 00:04:27,610 So show run interface gigabit00. 50 00:04:28,240 --> 00:04:29,530 Can you find the problem? 51 00:04:29,950 --> 00:04:31,560 I've given you a few hints. 52 00:04:32,440 --> 00:04:40,090 Once again, DHCP messages are being received by the router, but they're not being sent to the DHCP server. 53 00:04:41,720 --> 00:04:43,610 What's missing in this configuration? 54 00:04:45,410 --> 00:04:55,790 OK, so DHCP messages are dropped by the router because they broadcast messages unless you enable the IP helper 55 00:04:56,060 --> 00:04:57,080 address command. 56 00:04:58,120 --> 00:05:04,210 So we need to enable the IP, helper-address and then send the traffic to the DHCP server. 57 00:05:05,460 --> 00:05:15,090 Now in this topology, the DHCP server has this IP address, so we need to configure the IP helper-address on 58 00:05:15,090 --> 00:05:20,910 router 2 and point it to the DHCP server. Now that I've done that 59 00:05:22,160 --> 00:05:29,630 let's see if DHCP messages are forwarded to the server and notice without doing anything else, we can 60 00:05:29,630 --> 00:05:35,480 now see the DHCP Discover this is between the router 61 00:05:36,400 --> 00:05:45,640 and the server. I'll filter for BOOTP notice there's the discover message from 10.1.1.254 62 00:05:45,640 --> 00:05:47,800 to 10.1.2.1. 63 00:05:48,800 --> 00:05:50,000 Now 254 64 00:05:51,890 --> 00:05:53,390 is router 2. 65 00:05:56,180 --> 00:06:00,860 So notice the Discover message was forwarded to the DHCP server 66 00:06:03,200 --> 00:06:04,490 for a client 67 00:06:05,710 --> 00:06:08,710 with the name client, in other words 68 00:06:11,200 --> 00:06:12,790 router 1, acting as the client. 69 00:06:14,580 --> 00:06:20,910 You can see in the output here that the router received an IP address from the DHCP server, and you 70 00:06:20,910 --> 00:06:22,290 can see that here as well. 71 00:06:25,080 --> 00:06:28,260 So this is the DHCP Discover forwarded to the server. 72 00:06:29,220 --> 00:06:32,250 The service then replying back to the router 73 00:06:34,270 --> 00:06:35,140 with an offer 74 00:06:36,150 --> 00:06:41,280 saying that this is the service IP address leased time is one day 75 00:06:42,730 --> 00:06:51,100 default gateway or default route is 10.1.1.254. The client is requesting the address, so 76 00:06:51,550 --> 00:06:54,550 this Wireshark captures on the right end side of this topology. 77 00:06:55,210 --> 00:07:00,040 So the client would have sent that message to the router and the router is now forwarding that message 78 00:07:00,040 --> 00:07:00,940 to the server. 79 00:07:04,330 --> 00:07:11,200 We can see that by looking at the Wireshark capture here. Here's the offer from the server to the client 80 00:07:12,090 --> 00:07:18,720 and here's the clients sending a broadcast requesting the address. Broadcasts are not forwarded by the 81 00:07:18,720 --> 00:07:19,230 router. 82 00:07:20,130 --> 00:07:24,660 The client is requesting this address from the DHCP server. 83 00:07:25,640 --> 00:07:31,250 The DHCP server acknowledges that and gives the client this address 10.1.1.2. 84 00:07:31,880 --> 00:07:38,330 So previously the address that was offered to the client was 10.1.1.2 85 00:07:39,250 --> 00:07:43,390 and that was given to the relay agent 10.1.1.254 86 00:07:43,450 --> 00:07:44,530 in other words, the router. 87 00:07:49,140 --> 00:07:56,670 The client is requesting that address and the DHCP server acknowledges it. So hence the client router 1 88 00:07:57,120 --> 00:08:04,290 is given this IP address and if we look at the routing table, it's been allocated 10.1.1.254 89 00:08:04,290 --> 00:08:06,060 as its default gateway 90 00:08:06,630 --> 00:08:14,760 and that's because on the DHCP server and notice here you can see all the debugs showing you DHCP Discover, 91 00:08:15,630 --> 00:08:17,370 DHCP request and so forth. 92 00:08:19,770 --> 00:08:22,200 The DHCP server has been configured 93 00:08:26,240 --> 00:08:33,350 with this configuration. Client is being allocated an address in this range default router is 10.1 94 00:08:33,350 --> 00:08:40,630 .1.254 DNS server is 10.1.2.1 which is the DHP server. 95 00:08:41,360 --> 00:08:47,350 So that was an example of how to troubleshoot dynamic host configuration protocol or DHCP. 96 00:08:47,960 --> 00:08:49,340 I hope you enjoyed the video. 97 00:08:49,730 --> 00:08:53,690 If you did, please like it, and please subscribe to my YouTube channel. 98 00:08:54,230 --> 00:08:55,970 I wish you all the very best.