Configuring a DHCP policy for dynamic assignment
About a DHCP policy for dynamic assignment
In a DHCP policy, each DHCP user class has a bound DHCP address pool. Clients matching different user classes obtain IP addresses and other parameters from different address pools. The DHCP policy must be applied to the interface that acts as the DHCP server. When receiving a DHCP request, the DHCP server compares the packet against the user classes in the order that they are configured.
If a matching user class is found and the bound address pool has assignable IP addresses, the server assigns an IP address and other parameters from the address pool. If the address pool does not have assignable IP addresses, the address assignment fails.
If no match is found, the server assigns an IP address and other parameters from the default DHCP address pool. If no default address pool is specified or the default address pool does not have assignable IP addresses, the address assignment fails.
For successful address assignment, make sure the applied DHCP policy and the bound address pools exist.
Restrictions and guidelines
A DHCP policy take effect only after it is applied to an interface.
Procedure
Enter system view.
system-view
Create a DHCP policy and enter DHCP policy view.
dhcp policy policy-name
Specify a DHCP address pool for a DHCP user class.
class class-name ip-pool pool-name
By default, no address pool is specified for a user class.
Specify the default DHCP address pool.
default ip-pool pool-name
By default, no default address pool is specified.
Return to system view.
quit
Enter interface view.
interface interface-type interface-number
Apply the DHCP policy to the interface.
dhcp apply-policy policy-name
By default, no DHCP policy is applied to an interface.