askvity

How to Create a DHCP Server?

Published in DHCP Configuration 2 mins read

Creating a DHCP server involves configuring a device (like a router or a dedicated server) to automatically assign IP addresses to devices on your network. This guide outlines the basic steps, using concepts applicable to devices like Cisco routers, based on the provided references.

Steps to Configure a DHCP Server

Here's a step-by-step guide to configuring a DHCP server:

  1. Access the Device:

    • Log in to the device (e.g., a Cisco router) using SSH or Telnet.
    • Enter enable mode.
  2. Enter Configuration Mode:

    • Go into global configuration mode using the command: configure terminal (or config t).
  3. Exclude IP Addresses:

    • Exclude a range of IP addresses from being assigned by the DHCP server. This is useful for static IP assignments.
    • Use the command: ip dhcp excluded-address FIRST_IP LAST_IP
    • Example: ip dhcp excluded-address 192.168.1.1 192.168.1.10 (This excludes addresses from 192.168.1.1 to 192.168.1.10).
  4. Create a DHCP Pool:

    • Create a new DHCP pool using the command: ip dhcp pool NAME
    • Replace NAME with a descriptive name for the pool.
    • Example: ip dhcp pool LAN_POOL
  5. Configure the DHCP Pool:

    • After creating the pool, you'll need to configure its parameters within the pool configuration mode.
    • Define the network: Use the network NETWORK_ADDRESS SUBNET_MASK command to specify the network address and subnet mask for the pool.
      • Example: network 192.168.1.0 255.255.255.0
    • Set the default gateway (router): Use the default-router GATEWAY_IP command to specify the default gateway IP address.
      • Example: default-router 192.168.1.1
    • Configure DNS server(s): Use the dns-server DNS_IP_ADDRESS1 DNS_IP_ADDRESS2 ... command to specify the DNS server IP addresses.
      • Example: dns-server 8.8.8.8 8.8.4.4

Example Configuration Summary

Here's a summarized example of the commands:

enable
configure terminal
ip dhcp excluded-address 192.168.1.1 192.168.1.10
ip dhcp pool LAN_POOL
network 192.168.1.0 255.255.255.0
default-router 192.168.1.1
dns-server 8.8.8.8 8.8.4.4
end

This example creates a DHCP pool named LAN_POOL for the 192.168.1.0/24 network, excluding the first 10 addresses, setting the default gateway to 192.168.1.1, and using Google's public DNS servers.

Related Articles