CISCO Configuring DHCP

CISCO routers offer a service called Dynamic Host Configuration Protocol (DHCP). DHCP provides IP addresses to our hosts, along with configuration items such as default gateways, DNS servers, static routes, host names, and more (with over 200 options available). DHCP uses the following process, often referred to as DORA:

  1. Discover: A client asks for an IP address.
  2. Offer: A DHCP server offers an IP address.
  3. Request: The client requests the IP address offered by the DHCP server.
  4. Acknowledgement: The DHCP server confirms the request and removes the allocated IP address from its pool.

Lab Setup

IP Schema

The IP schema for this lab will be This provides us with 254 usable addresses (256 minus the broadcast address and network address). The subnet mask will be

IP Configuration

In this lab, we aim to achieve the following IP configuration, primarily using DHCP:

  1. The router will act as the DHCP server and will be on (interface Gi0/0).
  2. Host1 will serve as an internal webserver and must always receive the IP address from the DHCP server.
  3. Host2 will receive a DHCP-allocated IP address from the DHCP pool.
  4. Host3 will have the IP address statically assigned, so the DHCP server must not offer this IP to any host.
  5. Finally, the DHCP pool will use the subnet. Hosts should receive a default gateway and DNS server of, with a lease time of 30 days for dynamically assigned IPs.

DHCP Excluding an IP

We first need to assign the router's connected interface an IP address of As we're statically assigning, we must exclude this from the DHCP allocations:

routerip excludeip

DHCP Statically Assigning an IP to a Host

Host1 must receive IP when it's connected. To achieve this, we need either its MAC address (for Linux) or client identifier (for Windows). We can inspect host1's properties in GNS3 to get this information:


Even though host1 is a Kali Linux machine, it's emulated by my Windows 11 host OS. So, we'll treat it as a Windows host for this emulation in GNS3. To convert this MAC address to a client identifier, we add "01" to the MAC address. We then input this into the router:

We now need to create a DHCP pool for this static assignment as follows: host1dhcp You will notice I made a mistake in that assignment by not including the subnet mask with the IP address. Simply use the 'no' command to remove a setting. All going well host1 should now receive the IP address when connected.

DHCP dynamically assign an IP to a host

Finally, we need to assign the remaining host (and any others that may be connected in the future) a dynamically allocated IP address from the remaining pool, with a lease time of 30 days. To create a dynamic pool we run the following: homedhcp At this point our DHCP server should be fully configured to meet our specification. We can switch host1 and host2 to DHCP IP address assignment and statically assign host3. Host1 is switched DHCP and picks up the correct address: host1ip Host2 is set to DHCP and should pick up a dynamic assignment from the pool (should be as this is the first available address). This host is switched DHCP: host2ip You will notice the simple PC emulator at host2 shows the DORA process when you switch it to DHCP assigment, this reinforces the process mentioned earlier. We can view the DHCP bindings on the router by using the following command: bindings If you are wondering where host2's lease is, it won't appear as the PC emulator at host2 is just replicating a TELNET client with no hardware address, therefore does not show up. If this was a fully fledged machine it would be showing up in the bindings table. This concludes the demonstration, we've covered the key types of DHCP assignment you'll probably see/use but bear in mind the DHCP application itself has a lot more functionality.


Email: [email protected]

Copyright © 2023 -