59-23
Catalyst 4500 Series Switch, Cisco IOS Software Configuration Guide - Cisco IOS XE 3.9.xE and IOS 15.2(5)Ex
 
Chapter 59      Configuring the Cisco IOS DHCP Server
Configuring DHCP Address Pools
Configuring Static Route with the Next-Hop Dynamically Obtained Through 
DHCP
This task enables static routes to be assigned using a DHCP default gateway as the next-hop device. 
Without this feature the gateway IP address is not known until after the DHCP address assignment. You 
cannot configure a static route with the CLI without knowing that DHCP-supplied address.
Before You Begin
Verify all DHCP client and server configuration steps. Ensure that the DHCP client and server are 
properly defined to supply a DHCP device option 3 of the DHCP packet.
Step 5
Switch(dhcp-config)# class class-name 
Associates a class with a pool and enters DHCP pool class 
configuration mode.
• This command also creates a DHCP class if the DHCP class 
is not yet defined.
Step 6
Switch(dhcp-pool-class)# address range 
start-ip end-ip 
(Optional) Sets an address range for the DHCP class in a DHCP 
server address pool.
• If this command is not configured for a class, the default 
value is the entire subnet of the pool. Each class in the DHCP 
pool is examined for a match in the order configured.
Step 7
Repeat Steps 5 and 6 for each DHCP class you 
need to associate with the DHCP pool. 
—
Step 8
Switch(dhcp-pool-class)# end
Exits DHCP pool class option mode and returns to privileged 
EXEC mode.
Step 1
Switch> enable
Enables privileged EXEC mode.
• Enter your password if prompted.
Step 2
Switch# configure terminal
Enters global configuration mode.
Step 3
Switch(config)# ip route prefix mask 
{ip-address | interface-type 
interface-number [ip-address]} dhcp 
[distance] 
Assigns a static route for the default next-hop device when the 
DHCP server is accessed for an IP address.
• If more than one interface is configured to obtain an IP 
address from a DHCP server, use the ip route prefix mask 
interface-type interface-number dhcp command for each 
interface. If the interface is not specified, the route is added 
to the routing table as soon as any of the interfaces obtain an 
IP address and a default device.
Step 4
Switch(config)# end
Exits global configuration mode and returns to privileged EXEC 
mode.
Step 5
Switch# show ip route 
(Optional) Displays the current state of the routing table.