Skip to content

DHCP Configuration

DHCP automatically assigns IP addresses to devices - saves you from manually configuring every PC.

You need DHCP when:

  • You have many devices that need IP addresses (too tedious to configure manually)
  • Devices move between networks (laptops, mobile devices)
  • You want centralized IP address management
  • You need to provide DNS, gateway, and other network settings automatically
Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
Router(config)# ip dhcp pool VLAN10_POOL
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 1.1.1.1 1.0.0.1
Router(dhcp-config)# domain-name domain.local
Router(dhcp-config)# lease 7
Router(dhcp-config)# exit

Parameters:

  • 192.168.10.1 192.168.10.10 - IP range to exclude from DHCP. Replace with your reserved IPs.
  • VLAN10_POOL - Pool name. Replace with any descriptive name.
  • 192.168.10.0 255.255.255.0 - Network and mask. Replace with your subnet.
  • 192.168.10.1 - Default gateway. Replace with your router/SVI IP.
  • 8.8.8.8 8.8.4.4 - DNS servers. Replace with Google DNS, your own DNS, or ISP DNS.
  • domain.local - Domain name. Replace with your domain (optional).
  • 7 - Lease time in days. Common values are 1-7 days.

Breakdown:

  • excluded-address - IPs reserved for servers, routers, printers (won’t be assigned by DHCP). In this example, .1-.10 are reserved.
  • network - Subnet to assign IPs from (DHCP will assign .11-.254 in this example)
  • default-router - Gateway address (usually the router/SVI IP)
  • dns-server - DNS servers for clients (can be public DNS or your own)
  • domain-name - Domain suffix (optional, helps with name resolution)
  • lease - How many days the IP assignment lasts (default is 1 day, 7 days is common for offices)
! Exclude addresses for VLAN 10
Router(config)# ip dhcp excluded-address 192.168.10.1 192.168.10.10
! DHCP Pool for VLAN 10
Router(config)# ip dhcp pool SALES_VLAN
Router(dhcp-config)# network 192.168.10.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.10.1
Router(dhcp-config)# dns-server 8.8.8.8
Router(dhcp-config)# exit
! Exclude addresses for VLAN 20
Router(config)# ip dhcp excluded-address 192.168.20.1 192.168.20.10
! DHCP Pool for VLAN 20
Router(config)# ip dhcp pool ENGINEERING_VLAN
Router(dhcp-config)# network 192.168.20.0 255.255.255.0
Router(dhcp-config)# default-router 192.168.20.1
Router(dhcp-config)# dns-server 8.8.8.8
Router(dhcp-config)# exit

When to use: When your DHCP server is on a different subnet/VLAN from your clients. This is VERY common - you might have a Windows DHCP Server or a central router providing DHCP for multiple VLANs.

Why needed: DHCP requests are broadcasts, and broadcasts don’t cross routers/VLANs. The helper-address tells the router to forward DHCP broadcasts to your DHCP server.

Scenario: DHCP server is at 10.10.10.10, but clients are on different VLANs.

Router(config)# interface vlan 10
Router(config-if)# ip helper-address 10.10.10.10
Router(config-if)# exit
Router(config)# interface vlan 20
Router(config-if)# ip helper-address 10.10.10.10

Parameters:

  • vlan 10, vlan 20 - Replace with your VLAN interface names (or subinterfaces like GigabitEthernet0/0.10).
  • 10.10.10.10 - Replace with your DHCP server’s IP address.

Note: Configure ip helper-address on the interface where DHCP clients live, NOT where the DHCP server is.

Now DHCP requests from VLAN 10 and VLAN 20 are forwarded to the DHCP server at 10.10.10.10.

If you’re using an external DHCP server (like Windows Server), disable the router’s DHCP service.

Router(config)# no service dhcp
Router(config)# no ip dhcp pool SALES_VLAN

Remove current DHCP leases (forces clients to renew).

Router# clear ip dhcp binding *

Clear specific binding:

Router# clear ip dhcp binding 192.168.10.50
Router# show ip dhcp pool
Router# show ip dhcp binding
Router# show ip dhcp server statistics
Router# show ip dhcp conflict
Router# show running-config | section dhcp

Typical output:

Router# show ip dhcp binding
IP address Client-ID/ Lease expiration Type
Hardware address
192.168.10.50 0100.5056.a3b2.4c Dec 20 2025 10:30 AM Automatic
192.168.10.51 0100.5056.a3b2.5d Dec 20 2025 11:45 AM Automatic