# Configuring DHCP Local Address Pools

Tasks to configure DHCP local address pool include:

- Basic Configuration of DHCP Local Address Pools
- Linking Local Address Pools
- Setting Grace Periods for Address Leases

## Basic Configuration of DHCP Local Address Pools

To configure the DHCP local address pool:

1. Specify the pool name and access DHCP Local Pool Configuration mode.
   host1(config)#ip dhcp-local pool ispBoston host1(config-dhcp-local)#
2. Specify the IP address of the router for the subscriber's computer to use for traffic destined for locations beyond the local subnetwork.
   host1(config-dhcp-local)#default-router 10.10.1.1

   The default router must be on the same subnetwork as the local server pool IP addresses that you configure with the network command.

   You specify the IP address of a primary server, and optionally, the IP address of a secondary server.

3. (Optional) Assign a DNS server to an address pool. Some DHCP clients request the DHCP local server to assign a DNS server.
   host1(config-dhcp-local)#dns-server 10.10.1.1
4. (Optional) Specify a domain name that can be returned to the subscriber if requested.
   host1(config-dhcp-local)#domain-name ispBoston

   The name of the domain must match the name you specified for the RADIUS vendor-specific attribute (VSA) and for authentication, authorization, accounting, and address assignment.

5. Specify the time period for which the supplied IP address is valid.
   host1(config-dhcp-local)#lease 0 0 24

   Specify the number of days, and optionally, the number of hours, minutes, and seconds. Use the keyword infinite to specify a lease that does not expire. The default lease time is 30 minutes.

6. (Optional) Link the DHCP local address pool being configured to another local address pool. See Linking Local Address Pools for more information about linking local address pools.
   host1(config-dhcp-local)#link ispChicago
7. (Optional) Assign a NetBIOS server for subscribers. Some DHCP clients request the DHCP local server to assign a NetBIOS server.
   host1(config-dhcp-local)#netbios-name-server 10.10.1.1 10.10.1.2

   Specify the IP address of a primary server and, optionally, the address of a secondary server.

8. (Optional) Specify NetBIOS node type.
   host1(config-dhcp-local)#netbios-node-type b-node

   Specify one of the following types of NetBIOS nodes. By default, the node type is unspecified.

   - b-node—Broadcast
   - p-node—Peer-to-peer
   - m-node—Mixed
   - h-node—Hybrid
9. Specify the IP addresses that the DHCP local server can provide from an address pool.
   host1(config-dhcp-local)#network 10.10.1.0 255.255.0.0

   Use the force keyword with the no version of the command to delete the address pool even if the pool is in use.

10. For both equal-access and standalone modes, you can reserve an IP address for a specific MAC address.
    host1(config-dhcp-local)#reserve 10.10.13.8 0090.1a10.0552
11. For standalone mode, you can specify the DHCP server address that is sent to DHCP clients.
    host1(config-dhcp-local)#server-address 10.10.20.0
12. (Optional) Enable Simple Network Management Protocol (SNMP) traps for local address pool utilization, including normal, linked, and shared address pools. Traps are generated based on threshold values for utilization. You can define threshold values by using the warning command. See Using SNMP Traps to Monitor DHCP Local Server Events for more information about SNMP and local address pools.
    host1(config-dhcp-local)#snmpTrap host1(config-dhcp-local)#warning 50 40
13. (Optional) Configure a grace period for address leases allocated from the current DHCP local address pool. Specify the number of days and, optionally, the number of hours, minutes, and seconds in the grace period.
    host1(config-dhcp-local)#grace-period 0 12

    This command applies only to address leases that expire. Use the use-release-grace-period command to also apply the configured grace period to the local pool addresses that are explicitly released by clients. See Setting Grace Periods for Address Leases for more information about grace periods.

14. (Optional) Specify that the grace period is applied to addresses that have been explicitly released by clients. By default, the grace period is applied only to address leases that expire, not to addresses that have been released. See Setting Grace Periods for Address Leases for more information about grace periods.
    host1(config-dhcp-local)#use-release-grace-period

## Linking Local Address Pools

In both equal-access mode and standalone mode, you can link a DHCP local pool to another local pool. The linked pool serves as a backup pool. If no addresses are available in a pool, the DHCP local server attempts to allocate an address from the linked pool. The address pools that are linked are viewed as a group.

## Setting Grace Periods for Address Leases

The JunosE Software enables you to configure a grace period for a particular local address pool—the grace period is applied to all address leases associated with the address pool. The grace period is the amount of time that a client continues to retain its address lease after the lease expires or is released. An address cannot be assigned to any other client during the grace period. When the grace period expires, the address is released back to the address pool.

Grace periods help to ensure that a DHCP client retains its previously assigned IP address in situations that might normally cause a lease termination followed by a new address assignment. For example, if a client loses its lease due to a network disruption, the grace period enables the client to be reassigned the same address when the client requests an address after the network stabilizes. Grace periods are also useful during client reboots and in cases where a non-compliant or unreliable DHCP implementation triggers a lease renewal.

You configure a grace period for a local address pool. The grace period is immediately applied to all addresses that are allocated from the pool, including previously allocated addresses that are currently active—the new grace period takes precedence over a previously configured grace period for the address pool.

| Note: Configuring a new grace period that is shorter than the address pool current grace period immediately terminates any existing address leases that are in the grace period state and that have already exceeded the length of the new grace period. An address continues to be counted against the address pool resources while in a grace period. For example, if the address pool is exhausted, a new address cannot be assigned to other clients.

Client address leases enter the grace period in two ways—the lease might expire or the address can be explicitly released by the client. In both cases the address remains unavailable to other clients and can only be reapplied to the original client during the grace period. The address is released back to the address pool if the grace period expires before the address is reapplied to the original client.

When you configure a grace period, by default it is applied to address leases that expire, but not to addresses that are released by clients. However, you can optionally apply the grace period to released addresses.