DHCP IOS

Function: 
Summary
  • DHCP assigns IP addresses from address pools to DHCP clients.
Detailed Description
  • DHCP has three IP address allocation mechanisms: automatic allocation, dynamic allocation, manual allocation.
  • Automatic allocation: DHCP assigns a permanent IP address to client.
  • Dynamic allocation: DHCP assigns an IP address to a client for a limited period of time, which is called a lease.
  • Manual allocation: The network administrator assigns an IP address to a client and DHCP is used simply to convey the assigned address to the client.

 

       Reference: IP Addressing: DHCP Configuration Guide, Cisco IOS Release 12.4 

Command Syntax

ip dhcp database url [timeout seconds | write-delay seconds]

Configures a DHCP server to save automatic bindings on a remote host called a database agent.

no ip dhcp conflict logging

Disables DHCP address conflict logging.

ip dhcp excluded-address low-address [high-address]

Specifies the IP addresses that the DHCP server should not assign to DHCP clients.

ip dhcp pool name

Creates a name for the DHCP server address pool and enters DHCP pool configuration mode.

network network-number [{mask | /prefix- length} [secondary]]

Specifies the subnet network number and mask of the DHCP address pool.

domain-name domain

Specifies the domain name for the client.

dns-server address [address2 ... address8]

Specifies the IP address of a DNS server that is available to a DHCP client.

default-router address [address2 ... address8]

Specifies the IP address of the default router for a DHCP client.

lease {days [hours [minutes]] | infinite}

Specifies the duration of the lease.

 

Reference: IP Addressing: DHCP Configuration Guide, Cisco IOS Release 12.4 

Example
  • R1>enable

    R1#configure terminal 

    Enter configuration commands, one per line.  End with CNTL/Z.

    R1(config)#no ip dhcp conflict logging

    R1(config)#ip dhcp excluded-address 1.1.1.10 1.1.1.20

    R1(config)#ip dhcp pool example

    R1(dhcp-config)#network 1.1.1.0 255.255.255.0

    R1(dhcp-config)#domain-name example.com

    R1(dhcp-config)#dns-server 1.1.1.100

    R1(dhcp-config)#default-router 1.1.1.1

    R1(dhcp-config)#lease 1