96Principles for selecting an address poolThe DHCP server observes the following principles to select an address pool for a client:1. If there is an address pool where an IP address is statically bound to the MAC address or ID ofthe client, the DHCP server selects this address pool and assigns the statically bound IPaddress and other configuration parameters to the client.2. If the receiving interface has an address pool applied, the DHCP server selects an IP addressand other configuration parameters from this address pool.3. If the receiving interface has a DHCP policy and the DHCP client matches a user class, theDHCP server selects the address pool that is bound to the matching user class. If no matchinguser class is found, the server assigns an IP address and other parameters from the defaultDHCP address pool. If no default address pool is specified or the default address pool does nothave assignable IP addresses, the address assignment fails.4. If the above conditions are not met, the DHCP server selects an address pool depending on theclient location.{ Client on the same subnet as the server—The DHCP server compares the IP address ofthe receiving interface with the primary subnets of all address pools.− If a match is found, the server selects the address pool with the longest-matchingprimary subnet.− If no match is found, the DHCP server compares the IP address with the secondarysubnets of all address pools. The server selects the address pool with thelongest-matching secondary subnet.{ Client on a different subnet than the server—The DHCP server compares the IPaddress in the giaddr field of the DHCP request with the primary subnets of all addresspools.− If a match is found, the server selects the address pool with the longest-matchingprimary subnet.− If no match is found, the DHCP server compares the IP address with the secondarysubnets of all address pools. The server selects the address pool with thelongest-matching secondary subnet.For example, two address pools 1.1.1.0/24 and 1.1.1.0/25 are configured but not applied to anyDHCP server's interfaces.• If the IP address of the receiving interface is 1.1.1.1/25, the DHCP server selects the addresspool 1.1.1.0/25. If the address pool has no available IP addresses, the DHCP server will notselect the other pool and the address allocation will fail.• If the IP address of the receiving interface is 1.1.1.130/25, the DHCP server selects the addresspool 1.1.1.0/24.To ensure correct address allocation, keep the IP addresses used for dynamic allocation on one ofthe subnets:• Clients on the same subnet as the server—Subnet where the DHCP server receivinginterface resides.• Clients on a different subnet than the server—Subnet where the first DHCP relay interfacethat faces the clients resides.NOTE:As a best practice, configure a minimum of one matching primary subnet in your network. Otherwise,the DHCP server selects only the first matching secondary subnet for address allocation. If thenetwork has more DHCP clients than the assignable IP addresses in the secondary subnet, not allDHCP clients can obtain IP addresses.