Configuration Examples for the Cisco IOS DHCP Server
!
Switch(config)# ip dhcp pool 2
Switch(dhcp-config)# network 172.16.2.0 /24
Switch(dhcp-config)# default-router 172.16.2.100 172.16.2.101
Switch(dhcp-config)# lease 30
Example: Configuring a DHCP Address Pool with Multiple Disjoint Subnets
Multiple disjoint subnets in a DHCP pool can be used in any of the following network topologies:
•
•
•
In the following example, one DHCP address pool named pool3 is created; the primary subnet is
172.16.0.0/16, one secondary subnet is 172.16.1.0/24, and the other secondary subnet is 172.16.2.0/24.
•
•
•
•
The table below lists the IP addresses for the devices in the DHCP address pool that consists of three
disjoint subnets.
Table 59-3
Device Type
Default Devices
DNS Server
Catalyst 4500 Series Switch, Cisco IOS Software Configuration Guide - Cisco IOS XE 3.9.xE and IOS 15.2(5)Ex
59-26
IP address pooling—The DHCP client and server reside on the same subnet.
DHCP relay—The DHCP client and DHCP server communicate through a DHCP relay agent where
the relay interface is configured with secondary IP addresses.
Hierarchical DHCP—The DHCP server is configured as the DHCP subnet allocation server. The
DHCP client and DHCP subnet allocation server communicate through an on-demand address pool
(ODAP) router.
When IP addresses in the primary subnet are exhausted, the DHCP server inspects the secondary
subnets in the order in which the subnets were added to the pool.
When the DHCP server allocates an IP address from the secondary subnet 172.16.1.0/24, the server
uses the subnet-specific default device list that consists of IP addresses 172.16.1.100 and
172.16.1.101. However, when the DHCP server allocates an IP address from the subnet
172.16.2.0/24, the server uses the pool-wide list that consists of the four IP addresses from
172.16.0.100 to 172.16.0.103.
Other attributes from the primary subnet 172.16.0.0/16—such as the domain name, DNS server,
NetBIOS name server, and NetBIOS node type—are inherited in both the secondary subnets.
DHCP clients are granted 30-day leases on IP addresses in the pool. All addresses in each subnet,
except the excluded addresses, are available to the DHCP server for assigning to clients.
DHCP Address Pool Configuration
Primary Subnet
(172.16.0.0/16)
IP Address
172.16.0.100
172.16.0.101
172.16.0.102
172.16.0.103
172.16.1.102
172.16.2.102
Chapter 59
First Secondary
Subnet
Second Secondary
(172.16.1.0/24)
Subnet (172.16.2.0/24)
IP Address
IP Address
172.16.1.100
172.16.0.100
172.16.1.101
172.16.0.101
172.16.0.102
172.16.0.103
Configuring the Cisco IOS DHCP Server