Specifying a primary subnet and multiple address ranges in a DHCP address pool

About a primary subnet and multiple address ranges in a DHCP address pool

Some scenarios need to classify DHCP clients on the same subnet into different address groups. To meet this need, you can configure DHCP user classes and specify different address ranges for the classes. The clients matching a user class can then get the IP addresses of an address range. In addition, you can specify a common address range for the clients that do not match any user class. If no common address range is specified, such clients fail to obtain IP addresses.

If there is no need to classify clients, you do not need to configure DHCP user classes or their address ranges.

Restrictions and guidelines

Procedure

  1. Enter system view.

    system-view

  2. Enter DHCP address pool view.

    dhcp server ip-pool pool-name

  3. Specify the primary subnet in the address pool.

    network network-address [ mask-length | mask mask ]

    By default, no primary subnet is specified.

  4. (Optional.) Specify the common address range.

    address range start-ip-address end-ip-address

    By default, no IP address range is specified.

  5. (Optional.) Specify an IP address range for a DHCP user class.

    class class-name range start-ip-address end-ip-address

    By default, no IP address range is specified for a user class.

    The DHCP user class must already be created by using the dhcp class command.

  6. (Optional.) Set the address lease duration.

    expired { day day [ hour hour [ minute minute [ second second ] ] ] | unlimited }

    The default setting is 1 day.

  7. (Optional.) Exclude the specified IP addresses in the address pool from dynamic allocation.

    forbidden-ip ip-address&<1-8>

    By default, all IP addresses in the DHCP address pool are assignable.

  8. (Optional.) Exclude the specified IP addresses from automatic allocation in system view.

    1. Return to system view.

      quit

    2. Exclude the specified IP addresses from automatic allocation globally.

      dhcp server forbidden-ip start-ip-address [ end-ip-address ]

      By default, except for the IP address of the DHCP server interface, IP addresses in all address pools are assignable.