1 00:00:00,000 --> 00:00:04,000 In this lab, we'll start off with a simple typology of two routers 2 00:00:05,000 --> 00:00:06,000 router 1 and router 2 3 00:00:07,000 --> 00:00:12,000 What we'll do here, is configure router 2 as the DHCP server 4 00:00:13,000 --> 00:00:20,000 and we'll configure router 1 as the DHCP client in this topology. 5 00:00:21,000 --> 00:00:25,000 No configuration has been done on this routers. 6 00:00:26,000 --> 00:00:31,000 At the moment as an example, on router 2, show IP interface brief 7 00:00:32,000 --> 00:00:34,000 shows me that all the interfaces are currently down 7 8 00:00:35,000 --> 00:00:37,000 no IP addresses has been configured. 9 00:00:38,000 --> 00:00:40,000 So the first thing I’m gonna do is go on to the FastEthernet interface 10 00:00:41,000 --> 00:00:48,000 and configure an IP address of 10.1.1.2/24 mask. 11 00:00:49,000 --> 00:00:56,000 I'll no shut that interface and now I'll configure the router as the DHCP server. 12 00:00:57,000 --> 00:01:01,000 So to configure the DHCP server, the first thing you need to do is type ip dhcp 13 00:01:02,000 --> 00:01:05,000 that gives you a range of options but the one that we're looking for is pool 14 00:01:06,000 --> 00:01:10,000 so pool, and then we specify a name such as clients, as an example. 15 00:01:11,000 --> 00:01:15,000 This is just the name, to uniquely identify the pool that you're creating 16 00:01:16,000 --> 00:01:18,000 and that’s because you can have multiple pools configured on a router. 17 00:01:19,000 --> 00:01:28,000 Network, we need to specify the network that devices will be allocated addresses from 18 00:01:29,000 --> 00:01:34,000 now it's important that the IP address that DHCP requests are being received on. 19 00:01:35,000 --> 00:01:41,000 Which in this example a F0/0 be in the same subnet as the network. 20 00:01:42,000 --> 00:01:45,000 Otherwise the router is not gonna allocate addresses from the pool. 21 00:01:46,000 --> 00:01:51,000 So this interface is configured with an IP address of 10.1.1.2 22 00:01:52,000 --> 00:02:00,000 and we are configuring a network of 10.1.1.0/24 23 00:02:01,000 --> 00:02:03,000 there are many options available in the pool. 24 00:02:04,000 --> 00:02:07,000 We’ve already configured the network and mask. 25 00:02:08,000 --> 00:02:12,000 Next option, you'll probably want to configure is default gateway or default router. 26 00:02:13,000 --> 00:02:15,000 I’m gonna set that to router 2. 27 00:02:16,000 --> 00:02:18,000 You'd also want to specify options such as DNS server. 28 00:02:19,000 --> 00:02:22,000 In this example, I'll configure the router as DNS server 29 00:02:23,000 --> 00:02:24,000 but typically what your going to do here 30 00:02:25,000 --> 00:02:29,000 is configure a real DNS server somewhere in your topology. 31 00:02:30,000 --> 00:02:35,000 So I'll just configure a single DNS server being the local router. 32 00:02:36,000 --> 00:02:41,000 You can specify how long addresses are allocated to hosts, the default is 1 day 33 00:02:42,000 --> 00:02:44,000 I’m gonna specify lease time of 7 days. 34 00:02:45,000 --> 00:02:50,000 Now for devices such as IP phones, you can specify different DHCP option codes. 35 00:02:51,000 --> 00:02:57,000 150 is TFTP and I’m gonna specify an IP address of a TFTP server. 36 00:02:58,000 --> 00:03:02,000 Now in the real implementation, your IP telephones will get their configuration 37 00:03:03,000 --> 00:03:07,000 typically from a Cisco Unified Communications Manager 38 00:03:08,000 --> 00:03:11,000 or from a Cisco Unified Communications Manager's express router. 39 00:03:12,000 --> 00:03:16,000 So this would be the IP address of the Cisco communications manager. 40 00:03:17,000 --> 00:03:20,000 In our example once again, I’m just gonna set that to the local router. 40 41 00:03:21,000 --> 00:03:27,000 Now to stop conflicts, an allocation of addresses that belong to servers and routers 42 00:03:28,000 --> 00:03:31,000 Use the command ip dhcp excluded-address 43 00:03:32,000 --> 00:03:37,000 and you specify a range of addresses to exclude from allocation to devices. 44 00:03:38,000 --> 00:03:40,000 Now my router has an IP address of 10.1.1.2 45 00:03:41,000 --> 00:03:44,000 I don’t want the router to allocate its own IP address to host devices. 46 00:03:45,000 --> 00:03:49,000 So I’m going to set the exclusion range to include the router's IP address 47 00:03:50,000 --> 00:03:54,000 and some extra IP addresses here, that would typically be determined 48 00:03:55,000 --> 00:04:00,000 by how many servers or other devices are going to have IP addresses statically configured. 49 00:04:01,000 --> 00:04:03,000 sh run will show me my configuration. 50 00:04:04,000 --> 00:04:07,000 So it’s quite a simple config, I’ve got my exclusion range 51 00:04:08,000 --> 00:04:09,000 I’ve created a pool called clients. 52 00:04:10,000 --> 00:04:14,000 Clients will be allocated addresses in this IP address subnet. 53 00:04:15,000 --> 00:04:17,000 Default router is router 2, the local router. 54 00:04:18,000 --> 00:04:23,000 DNS server is set to that and option 150 is set to that as well. 55 00:04:24,000 --> 00:04:28,000 Once again typically, this will be set to servers in your live network. 56 00:04:29,000 --> 00:04:33,000 I’ve set the lease to 7 days, the default is 1 day. 57 00:04:34,000 --> 00:04:40,000 show ip dhcp gives me different options, including pool. 58 00:04:41,000 --> 00:04:45,000 This can be useful because sometimes you can make a typing mistake 59 00:04:46,000 --> 00:04:48,000 and you may exclude all of your addresses. 60 00:04:49,000 --> 00:04:53,000 But notice here, total addresses is 254, lease addresses is 0 61 00:04:54,000 --> 00:04:57,000 no addresses have been leased, address range is in this range. 62 00:04:58,000 --> 00:05:02,000 Let’s look at bindings, of any address has been allocated 63 00:05:03,000 --> 00:05:04,000 at the moment no addresses has been allocated. 64 00:05:05,000 --> 00:05:06,000 So let’s go to the client 64 65 00:05:07,000 --> 00:05:12,000 I’m gonna change the MAC address of this client, to something very simple 66 00:05:13,000 --> 00:05:15,000 so that we can read it in the output 67 00:05:16,000 --> 00:05:17,000 so MAC address is gonna be A,B,C 68 00:05:18,000 --> 00:05:22,000 IP address is gonna be set to DHCP 69 00:05:23,000 --> 00:05:26,000 so the PC will request an IP address from the server 70 00:05:27,000 --> 00:05:29,000 when I type no shut show debug 71 00:05:30,000 --> 00:05:34,000 lets run a debug so we can see what’s happening 72 00:05:35,000 --> 00:05:40,000 debug ip dhcp server and we have different options 73 00:05:41,000 --> 00:05:44,000 I’m gonna go for packet, which shows me lots of detail. 74 00:05:45,000 --> 00:05:49,000 So debug ip dhcp server packet now when I hit no shut 75 00:05:50,000 --> 00:05:57,000 we should start seeing requests from the client, to the DHCP server and there we go 76 00:05:58,000 --> 00:06:05,000 we've got a DHCP discover message, received from the client on interface FastEthernet 0/0 77 00:06:06,000 --> 00:06:10,000 The DHCP server will allocate an address without class information 78 00:06:11,000 --> 00:06:13,000 we didn’t configure a name or class for this device. 79 00:06:14,000 --> 00:06:19,000 The DHCP servers offering an address to the client, offering it this IP address 80 00:06:20,000 --> 00:06:28,000 and then sending the reply to the MAC address of the PC that we configured, so that MAC address. 81 00:06:29,000 --> 00:06:32,000 The client then requests that IP address from the DHCP server 82 00:06:33,000 --> 00:06:35,000 DHCP server sents back an acknowledgement. 83 00:06:36,000 --> 00:06:47,000 So sh ip int brief FastEthernet 0/0 on router 1 84 00:06:48,000 --> 00:06:50,000 has been allocated to this address through DHCP 85 00:06:51,000 --> 00:06:57,000 sh ip route the router has learnt about the gateway of last resort 86 00:06:58,000 --> 00:07:05,000 because we've configured a default gateway or default router in the DHCP pool. 87 00:07:06,000 --> 00:07:07,000 So router 1 has learnt about that network 88 00:07:08,000 --> 00:07:12,000 and a static default router has been added to the routing table. 89 00:07:13,000 --> 00:07:17,000 It’s a simple as that to configure a basic DHCP server on the Cisco router 90 00:07:18,000 --> 00:07:20,000 and allocate addresses to client devices. 91 00:07:24,000 --> 00:07:27,000 to actually view the messages sent between the client and the server.