- DHCP Overview
- Configuring the Cisco IOS XE DHCP Server
- Configuring the DHCP Server On-Demand Address Pool Manager
- Configuring the Cisco IOS XE DHCP Relay Agent
- DHCP Relay Server ID Override and Link Selection Option 82 Suboptions
- DHCP Server RADIUS Proxy
- Configuring the Cisco IOS XE DHCP Client
- Configuring DHCP Services for Accounting and Security
- ISSU and SSO--DHCP High Availability Features
- Finding Feature Information
- Prerequisites for Configuring the DHCP Server
- Information About the Cisco IOS XE DHCP Server
- Configuring a DHCP Database Agent or Disabling Conflict Logging
- Excluding IP Addresses
- Configuring DHCP Address Pools
- Configuring Manual Bindings
- Customizing DHCP Server Operation
- Configuring a Remote Router to Import DHCP Server Options from a Central DHCP Server
- Configuring DHCP Address Allocation Using Option 82
- Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP
- Clearing DHCP Server Variables
- Configuring the DHCP Database Agent Example
- Excluding IP Addresses Example
- Configuring DHCP Address Pools Example
- Configuring Manual Bindings Example
- Importing DHCP Options Example
- Configuring DHCP Address Allocation Using Option 82 Example
- Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP Example
Configuring the Cisco IOS XE DHCP Server
Cisco routers running Cisco IOS XE software include Dynamic Host Configuration Protocol (DHCP) server and relay agent software. The Cisco IOS XE DHCP server is a full DHCP server implementation that assigns and manages IP addresses from specified address pools within the router to DHCP clients. The DHCP server can be configured to assign additional parameters such as the IP address of the domain name system (DNS) server and the default router.
This module describes the concepts and the tasks needed to configure the Cisco IOS XE DHCP server.
Finding Feature Information
Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the Feature Information Table at the end of this document.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Prerequisites for Configuring the DHCP Server
Before you configure the Cisco IOS XE DHCP server, you should understand the concepts documented in the "DHCP Overview" module.
The Cisco IOS XE DHCP server and relay agent are enabled by default. You can verify if they have been disabled by checking your configuration file. If they have been disabled, the no service dhcp command will appear in the configuration file. Use the service dhcp command to reenable the functionality if necessary.
The Cisco IOS XE DHCP relay agent will be enabled on an interface only when the ip helper-address is configured. This command enables the DHCP broadcast to be forwarded to the configured DHCP server.
Information About the Cisco IOS XE DHCP Server
- Overview of the DHCP Server
- Database Agents
- DHCP Address Pool Conventions
- Address Bindings
- Ping Packet Settings
- DHCP Attribute Inheritance
- DHCP Server Address Allocation Using Option 82
Overview of the DHCP Server
TheCisco IOS XE DHCP server accepts address assignment requests and renewals and assigns the addresses from predefined groups of addresses contained within DHCP address pools. These address pools can also be configured to supply additional information to the requesting client such as the IP address of the DNS server, the default router, and other configuration parameters. The Cisco IOS XE DHCP server can accept broadcasts from locally attached LAN segments or from DHCP requests that have been forwarded by other DHCP relay agents within the network.
Database Agents
A DHCP database agent is any host (for example, an FTP, TFTP, or rcp server) or storage media on the DHCP server (for example, disk0) that stores the DHCP bindings database. You can configure multiple DHCP database agents, and you can configure the interval between database updates and transfers for each agent.
Automatic bindings are IP addresses that have been automatically mapped to the MAC addresses of hosts that are found in the DHCP database. Automatic binding information (such as lease expiration date and time, interface index, and VPN routing and forwarding [VRF] name) is stored on a database agent. The bindings are saved as text records for easy maintenance.
Address Conflicts
An address conflict occurs when two hosts use the same IP address. During address assignment, DHCP checks for conflicts using ping and gratuitous Address Resolution Protocol (ARP). If a conflict is detected, the address is removed from the pool. The address will not be assigned until the administrator resolves the conflict.
DHCP Address Pool Conventions
You can configure a DHCP address pool with a name that is a symbolic string (such as "engineering") or an integer (such as 0). Configuring a DHCP address pool also puts the router into DHCP pool configuration mode--identified by the (dhcp-config)# prompt--from which you can configure pool parameters (for example, the IP subnet number and default router list).
DHCP Address Pool Selection
DHCP defines a process by which the DHCP server knows the IP subnet in which the DHCP client resides, and it can assign an IP address from a pool of valid IP addresses in that subnet. The process by which the DHCP server identifies which DHCP address pool to use to service a client request is described in this section.
The DHCP server identifies which DHCP address pool to use to service a client request as follows:
- If the client is not directly connected (the giaddr field of the DHCPDISCOVER broadcast message is non-zero), the DHCP server matches the DHCPDISCOVER with a DHCP pool that has the subnet that contains the IP address in the giaddr field.
- If the client is directly connected (the giaddr field is zero), the DHCP server matches the DHCPDISCOVER with DHCP pool(s) that contain the subnet(s) configured on the receiving interface. If the interface has secondary IP addresses, the subnets associated with the secondary IP addresses are examined for possible allocation only after the subnet associated with the primary IP address (on the interface) is exhausted.
Cisco IOS XE DHCP server software supports advanced capabilities for IP address allocation. See the "Configuring DHCP Address Allocation Using Option 82" section for more information.
Address Bindings
An address binding is a mapping between the IP address and MAC address of a client. The IP address of a client can be assigned manually by an administrator or assigned automatically from a pool by a DHCP server.
Manual bindings are IP addresses that have been manually mapped to the MAC addresses of hosts that are found in the DHCP database. Manual bindings are stored in NVRAM on the DHCP server. Manual bindings are just special address pools. There is no limit on the number of manual bindings, but you can only configure one manual binding per host pool.
Automatic bindings are IP addresses that have been automatically mapped to the MAC addresses of hosts that are found in the DHCP database. Because the bindings are stored in volatile memory on the DHCP server, binding information is lost in the event of a power failure or upon router reload for any other reason. To prevent the loss of automatic binding information in such an event, a copy of the automatic binding information can be stored on a remote host called a DHCP database agent. The bindings are periodically written to the database agent. If the router reloads, the bindings are read back from the database agent to the DHCP database on the DHCP server.
Note |
We strongly recommend using database agents. However, the Cisco IOS XE DHCP server can function without database agents. |
All DHCP clients send a client identifier (DHCP option 61) in the DHCP packet. To configure manual bindings, you must enter the client-identifier DHCP pool configuration command with the appropriate hexadecimal values identifying the DHCP client.
Ping Packet Settings
By default, the DHCP server pings a pool address twice before assigning a particular address to a requesting client. If the ping is unanswered, the DHCP server assumes (with a high probability) that the address is not in use and assigns the address to the requesting client.
By default, the DHCP server waits 2 seconds before timing out a ping packet.
DHCP Attribute Inheritance
The DHCP server database is organized as a tree. The root of the tree is the address pool for natural networks, branches are subnetwork address pools, and leaves are manual bindings to clients. Subnetworks inherit network parameters and clients inherit subnetwork parameters. Therefore, common parameters, for example the domain name, should be configured at the highest (network or subnetwork) level of the tree.
Inherited parameters can be overridden. For example, if a parameter is defined in both the natural network and a subnetwork, the definition of the subnetwork is used.
Address leases are not inherited. If a lease is not specified for an IP address, by default, the DHCP server assigns a one-day lease for the address.
DHCP Server Address Allocation Using Option 82
The Cisco IOS XE DHCP server can allocate dynamic IP addresses based on the relay information option (option 82) information sent by the relay agent.
Automatic DHCP address allocation is typically based on an IP address, whether it be the gateway address (giaddr field of the DHCP packet) or the incoming interface IP address. In some networks, it is necessary to use additional information to further determine which IP addresses to allocate. By using option 82, the Cisco IOS XE relay agent has long been able to include additional information about itself when forwarding client-originated DHCP packets to a DHCP server. The Cisco IOS XE DHCP server can also use option 82 as a means to provide additional information to properly allocate IP addresses to DHCP clients.
- DHCP Address Allocation Using Option 82 Feature Design
- Usage Scenario for DHCP Address Allocation Using Option 82
- DHCP Class Capability
DHCP Address Allocation Using Option 82 Feature Design
DHCP provides a framework for passing configuration information to hosts on a TCP/IP network. Configuration parameters and other control information are carried in tagged data items that are stored in the options field of the DHCP message. The data items themselves are also called options. Option 82 is organized as a single DHCP option that contains information known by the relay agent.
This feature is designed to allow the Cisco IOS XE DHCP server to use option 82 information to help determine which IP addresses to allocate to clients. The information sent via option 82 will be used to identify which port the DHCP request came in on. This feature does not parse out the individual suboptions contained within option 82. Rather, the address allocation is done by matching a configured pattern byte by byte.
The feature introduces a new DHCP class capability, which is a method to group DHCP clients based on some shared characteristics other than the subnet in which the clients reside.
Usage Scenario for DHCP Address Allocation Using Option 82
In an example application, DHCP clients are connected to two ports of a single switch. Each port can be configured to be part of two VLANs: VLAN1 and VLAN2. DHCP clients belong to either VLAN1 or VLAN2 and it is assumed that the switch can differentiate the VLAN that a particular DHCP Discover message belongs to (possibly through Layer 2 encapsulation). Each VLAN has its own subnet and all DHCP messages from the same VLAN (same switch) will have the giaddr field set to the same value indicating the subnet of the VLAN.
The problem is that for a DHCP client connecting to port 1 of VLAN1, it must be allocated an IP address from one range within the VLAN's subnet, whereas a DHCP client connecting to port 2 of VLAN1 must be allocated an IP address from another range. Both these two IP address ranges are part of the same subnet (and have the same subnet mask). In the normal DHCP address allocation, the DHCP server will look only at the giaddr field and thus will not be able to differentiate between the two ranges.
To solve this problem, a relay agent residing at the switch inserts the relay information option (option 82), which carries information specific to the port, and the DHCP server must inspect both the giaddr field and the inserted option 82 during the address selection process.
DHCP Class Capability
The Cisco IOS XE software will look up a pool based on IP address (giaddr or incoming interface IP address) and then match the request to a class or classes configured in the pool in the order the classes are specified in the DHCP pool configuration.
When a DHCP address pool has been configured with one or more DHCP classes, the pool becomes a restricted access pool, which means that no addresses will be allocated from the pool unless one or more of the classes in the pool is matched. This design allows DHCP classes to be used for either access control (no default class is configured on the pool) or to provide further address range partitions with the subnet of the pool.
Multiple pools can be configured with the same class, eliminating the need to configure the same pattern in multiple pools.
The following capabilities are currently supported for DHCP class-based address allocation:
- Specifying the full relay agent information option value as a raw hexadecimal string by using the relay-information hex command in the new relay agent information configuration mode.
- Support for bitmasking the raw relay information hexadecimal value.
- Support for a wildcard at the end of the hexadecimal string specified by the relay-information hex command.
How to Configure the Cisco IOS XE DHCP Server
- Configuring a DHCP Database Agent or Disabling Conflict Logging
- Excluding IP Addresses
- Configuring DHCP Address Pools
- Configuring Manual Bindings
- Customizing DHCP Server Operation
- Configuring a Remote Router to Import DHCP Server Options from a Central DHCP Server
- Configuring DHCP Address Allocation Using Option 82
- Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP
- Clearing DHCP Server Variables
Configuring a DHCP Database Agent or Disabling Conflict Logging
Perform this task to configure a DHCP database agent.
Note |
We strongly recommend using database agents. However, the Cisco IOS XE server can run without them. If you choose not to configure a DHCP database agent, disable the recording of DHCP address conflicts on the DHCP server by using the no ip dhcp conflict logging command in global configuration mode. If there is conflict logging but no database agent configured, bindings are lost across router reboots. Possible false conflicts can occur causing the address to be removed from the address pool until the network administrator intervenes. > |
- ip dhcp database url [timeout seconds | write-delay seconds]
- or
- no ip dhcp conflict logging
DETAILED STEPS
Command or Action | Purpose | |
---|---|---|
|
Example: Router> enable |
Enables privileged EXEC mode.
|
|
Example: Router# configure terminal |
Enters global configuration mode. |
|
Example: Router(config)# ip dhcp database ftp://user:password@172.16.1.1/router-dhcp timeout 80 Example:
Example: Router(config)# no ip dhcp conflict logging |
Configures a DHCP server to save automatic bindings on a remote host called a database agent. or Disables DHCP address conflict logging.
|
Excluding IP Addresses
Perform this task to specify IP addresses (excluded addresses) that the DHCP server should not assign to clients.
The IP address configured on the router interface is automatically excluded from the DHCP address pool. The DHCP server assumes that all other IP addresses in a DHCP address pool subnet are available for assigning to DHCP clients.
You need to exclude addresses from the pool if the DHCP server should not allocate those IP addresses. An example usage scenario is when two DHCP servers are set up to service the same network segment (subnet) for redundancy. If the two DHCP servers do not coordinate their services with each other using a protocol such as DHCP failover, then each DHCP server must be configured to allocate from a non-overlapping set of addresses in the shared subnet. See the "Configuring Manual Bindings Example" for a configuration example.
DETAILED STEPS
Configuring DHCP Address Pools
Configuring a DHCP Address Pool
Perform this task to configure a DHCP address pool. On a per-address pool basis, specify DHCP options for the client as necessary.
Before you configure the DHCP address pool, you need to:
- Identify DHCP options for devices where necessary, including the following:
- Decide on a NetBIOS node type (b, p, m, or h).
- Decide on a DNS domain name.
Note |
You cannot configure manual bindings within the same pool that is configured with the network DHCP pool configuration command. To configure manual bindings, see the "Configuring Manual Bindings" section. > |
DETAILED STEPS
Verifying the DHCP Address Pool Configuration
Perform this task to verify the DHCP address pool configuration.
DETAILED STEPS
Configuring Manual Bindings
Note |
You cannot configure manual bindings within the same pool that is configured with the networkcommand in DHCP pool configuration mode. See the "Configuring DHCP Address Pools" section for information about DHCP address pools and the network command. > |
DETAILED STEPS
Troubleshooting Tips
You can determine the client identifier by using the debug ip dhcp server packet command. In the following example, the client is identified by the value 0b07.1134.a029.
Router# debug ip dhcp server packet
DHCPD:DHCPDISCOVER received from client 0b07.1134.a029 through relay 10.1.0.253.
DHCPD:assigned IP address 10.1.0.3 to client 0b07.1134.a029.
.
.
.
Customizing DHCP Server Operation
Perform this task to customize the behavior of the DHCP server.
DETAILED STEPS
Configuring a Remote Router to Import DHCP Server Options from a Central DHCP Server
The Cisco IOS DHCP server can dynamically configure options such as the DNS and WINS addresses to respond to DHCP requests from local clients behind the customer premises equipment (CPE). Previously, network administrators needed to manually configure the Cisco IOS DHCP server on each device. The Cisco IOS DHCP server was enhanced to allow configuration information to be updated automatically. Network administrators can configure one or more centralized DHCP servers to update specific DHCP options within the DHCP pools. The remote servers can request or "import" these option parameters from the centralized servers.
This section contains the following tasks:
- Configuring the Central DHCP Server to Update DHCP Options
- Configuring the Remote Router to Import DHCP Options
Configuring the Central DHCP Server to Update DHCP Options
Perform this task to configure the central DHCP server to update DHCP options.
DETAILED STEPS
Configuring the Remote Router to Import DHCP Options
Perform this task to configure the remote router to import DHCP options from a central DHCP server.
DETAILED STEPS
Configuring DHCP Address Allocation Using Option 82
- Restrictions for DHCP Address Allocation Using Option 82
- Enabling Option 82 for DHCP Address Allocation
- Troubleshooting Tips
- Defining the DHCP Class and Relay Agent Information Patterns
- Troubleshooting Tips
- Defining the DHCP Address Pool
Restrictions for DHCP Address Allocation Using Option 82
If the relay agent inserts option 82 but does not set the giaddr field in the DHCP packet, the DHCP server interface must be configured as a trusted interface by using the ip dhcp relay information trusted global configuration command. This configuration prevents the server from dropping the DHCP message.
Enabling Option 82 for DHCP Address Allocation
By default, the Cisco IOS XE DHCP server can use information provided by option 82 to allocate IP addresses. To reenable this capability if it has been disabled, perform the task described in this section.
DETAILED STEPS
Troubleshooting Tips
If DHCP classes are configured in the pool, but the DHCP server does not make use of the classes, verify if the no ip dhcp use classcommand was configured.
Defining the DHCP Class and Relay Agent Information Patterns
Perform this task to define the DHCP class and relay agent information patterns.
You must know the hexadecimal value of each byte location in option 82 to be able to configure the relay-information hex command. The option 82 format may vary from product to product. Contact the relay agent vendor for this information.
DETAILED STEPS
Troubleshooting Tips
You can enable the debug ip dhcp server class command to display the class matching results.
Defining the DHCP Address Pool
Perform this task to define the DHCP address pool.
DETAILED STEPS
Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP
Perform this task to configure a static route to use a DHCP default gateway as the next-hop router.
This task enables static routes to be assigned using a DHCP default gateway as the next-hop router. This behavior was not possible before the introduction of this feature because the gateway IP address is not known until after the DHCP address assignment. A static route could not be configured with the command-line interface (CLI) that used that DHCP-supplied address.
The static routes are installed in the routing table when the default gateway is assigned by the DHCP server. The routes remain in the routing table until the DHCP lease expires at which time the routes are removed.
When a DHCP client releases an address, the corresponding static route (the route configured with the ip routecommand) is automatically removed from the routing table. If the DHCP router option (option 3 of the DHCP packet) changes during the client renewal, the DHCP default gateway changes to the new IP address supplied in the renewal.
This feature is particularly useful for VPN deployments such as Dynamic Multipoint VPNs (DMVPNs). This feature is useful when a non-physical interface like a multipoint generic routing encapsulation (mGRE) tunnel is configured on the router and certain traffic needs to be excluded from going to the tunnel interface.
Verify all DHCP client and server configuration steps. Ensure that the DHCP client and server are properly defined to supply a DHCP router option 3.
DETAILED STEPS
Clearing DHCP Server Variables
Perform this task to clear DHCP server variables.
DETAILED STEPS
Configuration Examples for the Cisco IOS XE DHCP Server
- Configuring the DHCP Database Agent Example
- Excluding IP Addresses Example
- Configuring DHCP Address Pools Example
- Configuring Manual Bindings Example
- Importing DHCP Options Example
- Configuring DHCP Address Allocation Using Option 82 Example
- Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP Example
Configuring the DHCP Database Agent Example
The following example shows how to store bindings on host 172.16.4.253. The file transfer protocol is FTP. The server should wait 2 minutes (120 seconds) before writing database changes.
ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120
Excluding IP Addresses Example
In the following example, server A and server B service the subnet 10.0.20.0/24. Splitting the subnet equally between the two servers, server A is configured to allocate IP addresses 10.0.20.1 to 10.0.20.125 and server B is configured to allocate IP addresses 10.0.20.126 to 10.0.20.254.
Server A
ip dhcp excluded-address 10.0.20.126 10.0.20.255 ! ip dhcp pool A network 10.0.20.0 255.255.255.0
Server B
ip dhcp excluded-address 10.0.20.0 10.0.20.125 ! ip dhcp pool B network 10.0.20.0 255.255.255.0
Configuring DHCP Address Pools Example
In the following example, three DHCP address pools are created: one in network 172.16.0.0, one in subnetwork 172.16.1.0, and one in subnetwork 172.16.2.0. Attributes from network 172.16.0.0--such as the domain name, DNS server, NetBIOS name server, and NetBIOS node type--are inherited in subnetworks 172.16.1.0 and 172.16.2.0. In each pool, clients are granted 30-day leases and all addresses in each subnetwork, except the excluded addresses, are available to the DHCP server for assigning to clients. The table below lists the IP addresses for the devices in three DHCP address pools.
Table 1 | DHCP Address Pool Configuration Example |
Pool 0 (Network 172.16.0.0) |
Pool 1 (Subnetwork 172.16.1.0) |
Pool 2 (Subnetwork 172.16.2.0) |
|||
---|---|---|---|---|---|
Device |
IP Address |
Device |
IP Address |
Device |
IP Address |
Default routers |
- |
Default routers |
172.16.1.100 172.16.1.101 |
Default routers |
172.16.2.100 172.16.2.101 |
DNS server |
172.16.1.102 172.16.2.102 |
-- |
-- |
-- |
-- |
NetBIOS name server |
172.16.1.103 172.16.2.103 |
-- |
-- |
-- |
-- |
NetBIOS node type |
h-node |
-- |
-- |
-- |
-- |
ip dhcp database ftp://user:password@172.16.4.253/router-dhcp write-delay 120 ip dhcp excluded-address 172.16.1.100 172.16.1.103 ip dhcp excluded-address 172.16.2.100 172.16.2.103 ! ip dhcp pool 0 network 172.16.0.0 /16 domain-name cisco.com dns-server 172.16.1.102 172.16.2.102 netbios-name-server 172.16.1.103 172.16.2.103 netbios-node-type h-node ! ip dhcp pool 1 network 172.16.1.0 /24 default-router 172.16.1.100 172.16.1.101 lease 30 ! ip dhcp pool 2 network 172.16.2.0 /24 default-router 172.16.2.100 172.16.2.101 lease 30
Configuring Manual Bindings Example
The following example shows how to create a manual binding for a client named Mars.cisco.com. The MAC address of the client is 02c7.f800.0422 and the IP address of the client is 172.16.2.254.
ip dhcp pool Mars host 172.16.2.254 hardware-address 02c7.f800.0422 ieee802 client-name Mars
Because attributes are inherited, the previous configuration is equivalent to the following:
ip dhcp pool Mars host 172.16.2.254 mask 255.255.255.0 hardware-address 02c7.f800.0422 ieee802 client-name Mars default-router 172.16.2.100 172.16.2.101 domain-name cisco.com dns-server 172.16.1.102 172.16.2.102 netbios-name-server 172.16.1.103 172.16.2.103 netbios-node-type h-node
Importing DHCP Options Example
The following example shows a remote and central server configured to support the importing of DHCP options. The central server is configured to automatically update DHCP options, such as DNS and WINs addresses, within the DHCP pools. In response to a DHCP request from a local client behind CPE equipment, the remote server can request or "import" these option parameters from the centralized server. See the figure below for a diagram of the network topology.
Figure 1 | DHCP Example Network Topology |
Central Router
!do not assign this range to DHCP clients ip dhcp-excluded address 10.0.0.1 10.0.0.5 ! ip dhcp pool central ! Specifies network number and mask for DHCP clients network 10.0.0.0 255.255.255.0 ! Specifies the domain name for the client domain-name central ! Specifies DNS server that will respond to DHCP clients when they need to correlate host ! name to ip address dns-server 10.0.0.2 !Specifies the NETBIOS WINS server netbios-name-server 10.0.0.2 ! interface GigabitEthernet0/0/0 ip address 10.0.0.1 255.255.255.0 duplex auto speed auto
Remote Router
ip dhcp pool client ! Imports DHCP option parameters into DHCP server database import all network 20.0.0.0 255.255.255.0 ! interface GigabitEthernet0/0/0 ip address dhcp duplex auto speed auto
Configuring DHCP Address Allocation Using Option 82 Example
This example configures two DHCP classes. CLASS1 defines the group of DHCP clients whose address requests contain the relay agent information option with the specified hexadecimal values. CLASS2 defines the group of DHCP clients whose address requests contain the configured relay agent information suboptions. CLASS3 has no pattern configured and is treated as a "match to any" class. This type of class is useful for specifying a "default" class.
In the following example, the subnet of pool ABC has been divided into three ranges without further subnetting of the 10.0.20.0/24 subnet. If there is a DHCP Discover message from the 10.0.20.0/24 subnet with option 82 matching that of class CLASS1, an available address in the range from 10.0.20.1 to 10.0.20.100 will be allocated. If there is no free address in CLASS1's address range, the DHCP Discover message will be matched against CLASS2, and so on.
Thus, each class in the DHCP pool will be examined for a match in the order configured by the user. In pool ABC, the order of matching is CLASS1, CLASS2, and finally CLASS3. In pool DEF, class CLASS2 does not have any address range configured. By default, the address range for a particular class is the pool's entire subnet(s). Therefore, clients matching CLASS2 may be allocated addresses from 11.0.20.1 to 11.0.20.254.
Multiple pools can be configured with the same class, eliminating the need to configure the same patterns in multiple pools. In the future, further classification method may be implemented. For example, there may be a need to specify that one or more pools should only be used to service a particular class of devices (for example, cable modems and IP phones).
! Defines the DHCP classes and relay information patterns ip dhcp class CLASS1 relay agent information relay-information hex 01030a0b0c02050000000123 relay-information hex 01030a0b0c02* relay-information hex 01030a0b0c02050000000000 bitmask 0000000000000000000000FF ip dhcp class CLASS2 relay agent information relay-information hex 01040102030402020102 relay-information hex 01040101030402020102 ip dhcp class CLASS3 relay agent information ! Associates the DHCP pool with DHCP classes ip dhcp pool ABC network 10.0.20.0 255.255.255.0 class CLASS1 address range 10.0.20.1 10.0.20.100 class CLASS2 address range 10.0.20.101 10.0.20.200 class CLASS3 address range 10.0.20.201 10.0.20.254 ip dhcp pool DEF network 11.0.20.0 255.255.255.0 class CLASS1 address range 11.0.20.1 11.0.20.64 class CLASS2
Configuring a Static Route with the Next-Hop Dynamically Obtained Through DHCP Example
The following example shows how to configure two GigabitEthernet interfaces to obtain the next-hop router IP address from the DHCP server:
ip route 10.10.10.0 255.255.255.0 dhcp 200 ip route 10.10.20.1 255.255.255.255 gigaether 1 dhcp
Additional References
The following sections provide references related to the Cisco IOS XE DHCP server.
Related Documents
Related Topic |
Document Title |
---|---|
DHCP commands: complete command syntax, command mode, command history, defaults, usage guidelines, and examples |
Cisco IOS IP Addressing Services Command Reference |
DHCP conceptual information |
"DHCP Overview" module |
DHCP relay agent configuration |
"Configuring the Cisco IOS XE DHCP Relay Agent" module |
DHCP client configuration |
"Configuring the Cisco IOS XE DHCP Client" module |
DHCP On-Demand Address Pool Manager |
"Configuring the DHCP On-Demand Address Pool Manager" module |
Standards
Standards |
Title |
---|---|
No new or modified standards are supported by this functionality. |
-- |
MIBs
MIBs |
MIBs Link |
---|---|
No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature. |
To locate and download MIBs for selected platforms, Cisco IOS XE software releases, and feature sets, use Cisco MIB Locator found at the following URL: |
RFCs
RFCs |
Title |
---|---|
RFC 951 |
Bootstrap Protocol (BOOTP) |
RFC 1542 |
Clarifications and Extensions for the Bootstrap Protocol |
RFC 2131 |
Dynamic Host Configuration Protocol |
RFC 2132 |
DHCP Options and BOOTP Vendor Extensions |
Technical Assistance
Description |
Link |
---|---|
The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies. To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds. Access to most tools on the Cisco Support website requires a Cisco.com user ID and password. |
Feature Information for the Cisco IOS XE DHCP Server
The following table provides release information about the feature or features described in this module. This table lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.
Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to www.cisco.com/go/cfn. An account on Cisco.com is not required.
Table 2 | Feature Information for the Cisco IOS XE DHCP Server |
Feature Name |
Releases |
Feature Configuration Information |
---|---|---|
DHCP Server |
Cisco IOS XE Release 2.1 |
Cisco routers running Cisco IOS XE software include Dynamic Host Configuration Protocol (DHCP) server and relay agent software. The Cisco IOS XE DHCP server is a full DHCP server implementation that assigns and manages IP addresses from specified address pools within the router to DHCP clients. The DHCP server can be configured to assign additional parameters such as the IP address of the domain name system (DNS) server and the default router. |
DHCP Address Allocation Using Option 82 |
Cisco IOS XE Release 2.1 |
The Cisco IOS XE DHCP server can allocate dynamic IP addresses based on the relay information option (option 82) information sent by the relay agent. The following commands were introduced by this feature: address range, class, ip dhcp class, ip dhcp use class, relay agent information, relay-information hex. |
DHCP Statically Configured Routes Using a DHCP Gateway |
Cisco IOS XE Release 2.1 |
This feature enables the configuration of static routes that point to an assigned DHCP next hop router. The following commands were modified by this feature: ip route, show ip route. |
DHCP Server Options - Import and Autoconfiguration |
Cisco IOS XE Release 2.3 |
Options imported by multiple subsystems can co-exist in the DHCP address pool. When the session is terminated or the lease is released, the imported options are cleared. |
Cisco and the Cisco logo are trademarks or registered trademarks of Cisco and/or its affiliates in the U.S. and other countries. To view a list of Cisco trademarks, go to this URL: www.cisco.com/go/trademarks. Third-party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1110R)
Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.