Configure DHCP Subnet

Configure parameters for a DHCP subnet. Configure only the parameters that apply to your deployment.

Before you begin

Before you configure a custom subnet data value, you must define the custom option globally.

About this task

For subnet options that you leave unconfigured, the global DHCP Server configuration, if one exists, applies to the subnet.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Create a DHCP subnet:

    ip dhcp-server subnet {A.B.C.D/X}

  3. Configure the IP address pool that DHCP Server can use to assign IP addresses to clients within this subnet:

    pool {A.B.C.D} {A.B.C.D}

  4. Configure a subnet lease expiration timer:

    lease-time <60-300000000>

  5. Optional: Configure the router address to specify the default gateway for subnet clients:

    router {A.B.C.D} [...]

  6. Optional: Configure subnet DNS servers::

    domain-name-servers {A.B.C.D} [...]

  7. Optional: Configure a subnet domain name:

    domain-name WORD<1-128>

  8. Optional: Configure subnet NTP servers:

    ntp-servers {A.B.C.D} [...]

  9. Optional: Configure subnet TFTP settings:

    tftp server-ip {A.B.C.D}

    tftp server-name WORD<0-64>

    tftp boot-file-name WORD<0-128>

  10. Optional: Configure a subnet NetBIOS name server and node type:

    netbios-name-server {A.B.C.D}

    netbios-node-type [0x1|0x2|0x4|0x8]

  11. Optional: Assign a subnet data value to custom options that you defined globally:

    custom-option-data <224-254> value WORD<0-128>

Variable Definitions

Use the following table to configure DHCP subnets.

Variable Value
custom-option-data <224-254> value WORD<0-128>

Assigns a data value to an existing DHCP Custom Option.

  • <224-254>—Specifies the DHCP code that identifies the option.

  • value WORD<0-128>—Assigns a data value to this option. The value must use the data type that was specified in the custom option definition.

domain-name WORD<1-128>

Specifies a domain name for this DHCP subnet.

domain-name-servers {A.B.C.D} [...]

Specifies the IPv4 address of one or more DNS servers. You can assign a maximum of eight server addresses. Enter each server address on the same command line with a space separating each address entry.

lease-time <60-300000000>

Specifies the length of time, in seconds, before a host lease expires. The default value is 0 (unconfigured).

netbios-name-server {A.B.C.D} Specifies the IPv4 address of the NetBIOS name server for this subnet.
netbios-node-type [0x1|0x2|0x4|0x8]

Specifies the node type of the Net BIOS name server. Enter one of the following options:

  • 0x1—B node

  • 0x2—P node

  • 0x4—M node

  • 0x8—H node

The default value is 0x0—unconfigured.

ntp-servers {A.B.C.D} [...]

Specifies the IPv4 address of one or more NTP servers. You can assign a maximum of eight server addresses. Enter each server address on the same command line with a space separating each address entry.

pool {A.B.C.D} {A.B.C.D}

Assigns a range of IPv4 addresses that DHCP Server can use to assign addresses to clients. Enter the starting IP address followed by the ending IP address. Note the following:

  • The pool is a mandatory setting.

  • The start IP address must be lower than the end IP address. Both IP addresses must be non-zero.

  • Broadcast addresses cannot be leased.

router {A.B.C.D} […]

Specifies one or more default router IPv4 addresses for this subnet. You can assign a maximum of eight router addresses. Enter each address on the same command line with a space separating each address entry.

subnet {A.B.C.D/X}

Assigns a DHCP subnet that the DHCP Server services. Note that for the subnet address, the host bits must be zero.

tftp boot-file-name WORD<0-128>

Specifies the filename of the subnet TFTP boot image file.

tftp server-ip {A.B.C.D}

Specifies the IPv4 address of the subnet TFTP server.

tftp server-name WORD<0-64>

Specifies the server name of the subnet TFTP server.