DHCP Pool
DHCP (Dynamic Host Configuration Protocol) server pool configuration enables centralized IP address assignment to network clients. Each pool defines a scope of addresses along with associated network parameters such as the default gateway, DNS servers, domain name, lease duration, and custom DHCP options. Pools can be bound to a specific VRF for multi-tenant environments, and support both dynamic network-based allocation and static host bindings for devices that require fixed addresses.
Diagram
Section titled “Diagram”Classes
Section titled “Classes”configuration (iosxe.devices)
Section titled “configuration (iosxe.devices)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| dhcp_pools | List | [dhcp_pools] | No |
dhcp_pools (iosxe.devices.configuration)
Section titled “dhcp_pools (iosxe.devices.configuration)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| name | String | Yes | ||
| vrf | String | No | ||
| domain_name | String | No | ||
| bootfile | String | No | ||
| client_name | String | No | ||
| network_number | String | No | ||
| network_mask | String | No | ||
| secondary_networks | List | [secondary_networks] | No | |
| host_number | String | No | ||
| host_mask | String | No | ||
| default_routers | List | String | No | |
| dns_servers | List | String | No | |
| next_servers | List | String | No | |
| lease_days | Integer | min: 0, max: 365 | No | |
| lease_hours | Integer | min: 0, max: 23 | No | |
| lease_minutes | Integer | min: 0, max: 59 | No | |
| lease_infinite | Boolean | true, false | No | |
| utilization_mark_high | Integer | min: 1, max: 100 | No | |
| utilization_mark_high_log | Boolean | true, false | No | |
| utilization_mark_low | Integer | min: 1, max: 100 | No | |
| utilization_mark_low_log | Boolean | true, false | No | |
| subnet_prefix_length | Integer | min: 1, max: 32 | No | |
| options | List | [options] | No |
secondary_networks (iosxe.devices.configuration.dhcp_pools)
Section titled “secondary_networks (iosxe.devices.configuration.dhcp_pools)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| number | String | Yes | ||
| mask | String | Yes |
options (iosxe.devices.configuration.dhcp_pools)
Section titled “options (iosxe.devices.configuration.dhcp_pools)”| Name | Type | Constraint | Mandatory | Default Value |
|---|---|---|---|---|
| option_code | Integer | min: 0, max: 254 | Yes | |
| ascii | String | No | ||
| hex | String | No | ||
| ip | List | String | No | |
| ip_legacy | List | String | No |
Guidelines and Limitations
Section titled “Guidelines and Limitations”- DHCP pool option IP addresses have version-specific attributes:
- IOS-XE 17.15 and later: Use
ipwithinoptions - IOS-XE prior to 17.15: Use
ip_legacywithinoptions - These are mutually exclusive — configure only the appropriate one based on your target IOS-XE version.
- IOS-XE 17.15 and later: Use
- The
lease_days,lease_hours,lease_minutesattributes andlease_infiniteare mutually exclusive lease configurations. - The
network_number/network_maskandhost_number/host_maskattributes configure the pool for dynamic vs. manual (static) binding and should not both be set on the same pool.
DHCP pools are the core building block for on-device DHCP services. By defining multiple pools you can segment address allocation across VLANs, VRFs, or functional groups while maintaining consistent network parameters for each client population.
Examples
Section titled “Examples”Dynamic Pool with All Options
Section titled “Dynamic Pool with All Options”ip dhcp pool POOL_DATA network 10.1.1.0 255.255.255.0 network 10.1.3.0 255.255.255.0 secondary default-router 10.1.1.1 dns-server 8.8.8.8 8.8.4.4 domain-name example.com bootfile boot.cfg next-server 10.1.1.10 lease 7 12 30 option 150 ascii 10.1.1.1 option 66 hex 0a010101 option 42 ip 10.1.1.20 10.1.1.21 utilization mark high 80 log utilization mark low 20 logiosxe: devices: - name: Router1 configuration: dhcp_pools: - name: POOL_DATA network_number: "10.1.1.0" network_mask: "255.255.255.0" secondary_networks: - number: "10.1.3.0" mask: "255.255.255.0" default_routers: - "10.1.1.1" dns_servers: - "8.8.8.8" - "8.8.4.4" next_servers: - "10.1.1.10" domain_name: "example.com" bootfile: "boot.cfg" lease_days: 7 lease_hours: 12 lease_minutes: 30 subnet_prefix_length: 24 utilization_mark_high: 80 utilization_mark_high_log: true utilization_mark_low: 20 utilization_mark_low_log: true options: - option_code: 150 ascii: "10.1.1.1" - option_code: 66 hex: "0a010101" - option_code: 42 ip: # IOS-XE 17.15+ - "10.1.1.20" - "10.1.1.21" # - option_code: 42 # IOS-XE pre-17.15 # ip_legacy: # - "10.1.1.20" # - "10.1.1.21"VRF-Bound Pool
Section titled “VRF-Bound Pool”ip dhcp pool POOL_VOICE vrf VOICE network 10.1.2.0 255.255.255.0 default-router 10.1.2.1 dns-server 10.1.2.1 lease 0 8iosxe: devices: - name: Router1 configuration: dhcp_pools: - name: POOL_VOICE vrf: "VOICE" network_number: "10.1.2.0" network_mask: "255.255.255.0" default_routers: - "10.1.2.1" dns_servers: - "10.1.2.1" lease_days: 0 lease_hours: 8Static Host Binding with Infinite Lease
Section titled “Static Host Binding with Infinite Lease”ip dhcp pool POOL_PRINTER host 10.1.1.100 255.255.255.0 client-name printer1 lease infiniteiosxe: devices: - name: Router1 configuration: dhcp_pools: - name: POOL_PRINTER host_number: "10.1.1.100" host_mask: "255.255.255.0" client_name: "printer1" lease_infinite: true