WEBVTT 0:00:03.240000 --> 0:00:07.060000 Hello and welcome to this video, which is titled, Utilizing Network Devices 0:00:07.060000 --> 0:00:12.040000 for DHCP. Now, in previous videos, we did a review of exactly what DHCP 0:00:12.040000 --> 0:00:16.580000 does between a client and a DHCP server, how it operates, we did that 0:00:16.580000 --> 0:00:20.080000 review of Dora, which is the discover, the offer, the request, and the 0:00:20.080000 --> 0:00:21.080000 acknowledgement. 0:00:21.080000 --> 0:00:26.020000 We talked about the UDP port numbers of 67 and 68 use for DHCP. 0:00:26.020000 --> 0:00:30.480000 Now what we're going to look at is, what if, usually in a lab environment, 0:00:30.480000 --> 0:00:33.320000 but sometimes in a production environment, you actually want to configure 0:00:33.320000 --> 0:00:39.440000 your Cisco iOS device, like your router or your switch as a DHCP server. 0:00:39.440000 --> 0:00:43.620000 Instead of using a legitimate Linux or Windows DHCP server. 0:00:43.620000 --> 0:00:46.280000 You can do that, I'm going to show you the basics of how you would do 0:00:46.280000 --> 0:00:51.140000 that. So here are the steps for configuring your router or switch as a 0:00:51.140000 --> 0:00:57.140000 DHCP server. So step number one is you enable that functionality by typing 0:00:57.140000 --> 0:01:01.820000 service DHCP. Now I've seen in multiple lab environments that I don't 0:01:01.820000 --> 0:01:02.920000 have to do this. 0:01:02.920000 --> 0:01:07.900000 I think service DHCP is already on by default, but doesn't hurt, only 0:01:07.900000 --> 0:01:12.920000 takes a couple of seconds to type that in to ensure that it is operational. 0:01:12.920000 --> 0:01:16.400000 Then after that, you're going to create your DHCP pool. 0:01:16.400000 --> 0:01:21.880000 Now you're going to create one or more DHCP pools, depending on how many 0:01:21.880000 --> 0:01:25.020000 subnets are going to have DHCP clients. 0:01:25.020000 --> 0:01:30.080000 Clearly, if in my network, I've got 25 different subnets, one for payroll, 0:01:30.080000 --> 0:01:33.800000 one for marketing, one for HR, one for engineering, and on and on and 0:01:33.800000 --> 0:01:39.100000 on. I'm going to need a unique DHCP pool for each and every one of those 0:01:39.100000 --> 0:01:42.880000 subnets. So, but here we're just going to do one to make it simple. 0:01:42.880000 --> 0:01:45.900000 And then you give your pool a descriptive name, it's completely up to 0:01:45.900000 --> 0:01:49.920000 you. You might want to name it payroll, marketing, engineering, just to 0:01:49.920000 --> 0:01:50.900000 keep it separate. 0:01:50.900000 --> 0:01:55.960000 Then once you do that, that puts you into config-dacp mode, and now you 0:01:55.960000 --> 0:01:59.080000 configure the parameters that you're going to offer up to your clients 0:01:59.080000 --> 0:02:01.140000 in your DHCP offers. 0:02:01.140000 --> 0:02:02.900000 You can configure your network. 0:02:02.900000 --> 0:02:08.840000 For example, you can say network 10 .10.0, and then you do need to supply 0:02:08.840000 --> 0:02:12.800000 a subnet mask. This is one of those few places where you can actually 0:02:12.800000 --> 0:02:17.860000 supply the subnet mask in a slash notation in addition to data decimals. 0:02:17.860000 --> 0:02:23.740000 So certainly you could type in 255.255 .255.0, you could do that, or you 0:02:23.740000 --> 0:02:26.480000 can just simply type in slash 24. 0:02:26.480000 --> 0:02:28.780000 You could actually do it that way to make it easier. 0:02:28.780000 --> 0:02:34.060000 Then you're going to want to supply a default router, like 10.10.10.1, 0:02:34.060000 --> 0:02:37.220000 or whatever it is that's appropriate for this network. 0:02:37.220000 --> 0:02:42.800000 Probably want to give them a DNS server, maybe Google's DNS server. 0:02:42.800000 --> 0:02:44.520000 And then you want to specify the lease. 0:02:44.520000 --> 0:02:48.440000 And with the lease, you have three numbers you could supply. 0:02:48.440000 --> 0:02:54.840000 If you supply all three numbers, that first number is days, second number 0:02:54.840000 --> 0:03:01.960000 is hours, third number is minutes. 0:03:01.960000 --> 0:03:05.100000 And so those are now, if you do a question mark, there are other options 0:03:05.100000 --> 0:03:07.060000 you can specify as well. 0:03:07.060000 --> 0:03:10.280000 But those are probably the minimum parameters you want to put into your 0:03:10.280000 --> 0:03:16.900000 DHCP pool. Now, lastly, in this particular network, for example, let's 0:03:16.900000 --> 0:03:22.080000 say I'm doing the network of the 10 .10 network that I'm allocating. 0:03:22.080000 --> 0:03:27.040000 Maybe on that particular network segment, we actually have a couple of 0:03:27.040000 --> 0:03:31.640000 servers already there that have static IP addresses. 0:03:31.640000 --> 0:03:35.820000 Maybe one server, maybe server A is 10.10.10.1, and the other server B 0:03:35.820000 --> 0:03:40.700000 is 10.10.10.2. And we want to make sure we tell this router or the switch 0:03:40.700000 --> 0:03:42.480000 don't allocate those addresses. 0:03:42.480000 --> 0:03:44.980000 Those addresses are already in use. 0:03:44.980000 --> 0:03:47.320000 Exclude those from the pool. 0:03:47.320000 --> 0:03:52.160000 So to do that, we don't actually do that exclusion in the pool itself. 0:03:52.160000 --> 0:03:56.980000 We do that exclusion at the global configuration level with an IP DHCP 0:03:56.980000 --> 0:03:59.840000 excluded dash address command. 0:03:59.840000 --> 0:04:07.920000 So in this particular case, we would say 10.10.10.1, 10.10.10.2, and that 0:04:07.920000 --> 0:04:12.620000 would exclude those addresses from being allocated via DHCP. 0:04:12.620000 --> 0:04:20.640000 Now, if your DHCP clients are directly connected to this DHCP server, 0:04:20.640000 --> 0:04:24.640000 this router, or switch acting as a DHCP server, you're done. 0:04:24.640000 --> 0:04:29.900000 Because this guy will receive those broadcasts, those DHCP discover messages, 0:04:29.900000 --> 0:04:34.760000 those DHCP request messages which come in as broadcast. 0:04:34.760000 --> 0:04:36.640000 But what if that's not the case? 0:04:36.640000 --> 0:04:41.480000 Or if we have a situation like this where we have, let's say these are 0:04:41.480000 --> 0:04:45.880000 the clients, these are the laptops and PCs, they're probably connected 0:04:45.880000 --> 0:04:53.880000 to a switch. But what of here we have router one, router two, router three, 0:04:53.880000 --> 0:04:58.240000 and router three is going to be our DHCP server. 0:04:58.240000 --> 0:05:03.160000 Well, we could configure all that stuff we just saw on router three, but 0:05:03.160000 --> 0:05:07.260000 it's not going to do us any good if that's all we do, because we know 0:05:07.260000 --> 0:05:11.880000 that those DHCP messages are going to be coming in as broadcasts. 0:05:11.880000 --> 0:05:15.820000 And once they hit this interface right here on router one, router one's 0:05:15.820000 --> 0:05:18.260000 default behavior is going to be to drop those. 0:05:18.260000 --> 0:05:22.700000 So we have to configure on router one specifically on this interface right 0:05:22.700000 --> 0:05:28.820000 here. We have to configure that as a DHCP, what's called a relay agent. 0:05:28.820000 --> 0:05:36.340000 We have to give him relay agent functionality so that when he gets those 0:05:36.340000 --> 0:05:41.120000 broadcasts, he will encapsulate them in a unicast and send it directly 0:05:41.120000 --> 0:05:45.500000 to our router. And then the next slide, I'm going to show you how to do 0:05:45.500000 --> 0:05:50.100000 that. One other thing, in the lab that we have devised for this, if you 0:05:50.100000 --> 0:05:55.860000 choose to follow the lab, the actual DHCP clients are routers or switches. 0:05:55.860000 --> 0:05:57.660000 We're not going to be using an actual client. 0:05:57.660000 --> 0:06:02.360000 So how do I go onto a router's interface and configure that router's interface 0:06:02.360000 --> 0:06:06.200000 to obtain its address, not statically, which is what we would normally 0:06:06.200000 --> 0:06:10.220000 do, but to obtain its address via DHCP? 0:06:10.220000 --> 0:06:12.880000 Well, this is how we would do that. 0:06:12.880000 --> 0:06:17.020000 We go onto the interface and we simply say IP address DHCP. 0:06:17.020000 --> 0:06:23.140000 So that turns that layer three interface into a DHCP client interface. 0:06:23.140000 --> 0:06:26.540000 And then lastly, how do we go into that router one and configure him to 0:06:26.540000 --> 0:06:28.580000 be a DHCP relay agent? 0:06:28.580000 --> 0:06:33.200000 Just like this. Go onto the interface that's facing the DHCP clients and 0:06:33.200000 --> 0:06:36.980000 use the IP helper dash address command. 0:06:36.980000 --> 0:06:43.880000 In this particular case, this address right here is your DHCP server. 0:06:43.880000 --> 0:06:47.660000 Wherever that happens to be. 0:06:47.660000 --> 0:06:55.880000 So now when DHCP broadcasts, like DHCP offers, DHCP requests, when they 0:06:55.880000 --> 0:06:59.560000 come in and are seen on interface gigabit zero one, instead of just ignoring 0:06:59.560000 --> 0:07:04.760000 them and dropping them, he will encapsulate them in unicast and unicast 0:07:04.760000 --> 0:07:08.800000 those packets directly to our DHCP server. 0:07:08.800000 --> 0:07:11.900000 Now, how do we confirm that all this is working? 0:07:11.900000 --> 0:07:14.100000 Well, there's a couple of ways we can do it. 0:07:14.100000 --> 0:07:19.980000 So we can do show IP DHCP binding. 0:07:19.980000 --> 0:07:23.720000 So on the DHCP server, you can do that first command and actually see 0:07:23.720000 --> 0:07:28.620000 if he has allocated any addresses to any DHCP clients. 0:07:28.620000 --> 0:07:32.720000 And on the client side, so on the router that we're using as a DHCP client, 0:07:32.720000 --> 0:07:36.580000 we can do a debug command debug DHCP detail. 0:07:36.580000 --> 0:07:42.160000 And that will actually show you the DHCP transactions in a debug output. 0:07:42.160000 --> 0:07:47.740000 So that concludes that video on how to configure routers and switches 0:07:47.740000 --> 0:07:51.420000 as DHCP servers, as well as DHCP clients.