Configure DHCP Subnet

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

About this task

For subnet settings that you leave unconfigured, the global DHCP Server setting, 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 the subnet router address:

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

  5. Configure a subnet lease expiration timer:

    lease-time <60-300000000>

  6. Configure subnet DNS servers::

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

  7. Configure subnet NTP servers:

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

  8. Configure subnet TFTP settings:

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

    tftp server-name WORD<0-64>

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

  9. Configure a subnet domain name:

    domain-name WORD<0-255>

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

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

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

  11. Assign a subnet data value to any custom options that you defined using global settings:

    custom-option-data <code> value WORD<0-255>

What to do next

Configure static hosts if you want to reserve DHCP settings such as a specific IP address for any subnet hosts. Otherwise, enable DHCP Server.

Variable Definitions

Use the variable definitions in the following table to configure DHCP subnets.

Table 1. DHCP Subnet Settings
Variable Definition

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.

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.

lease-time <60-300000000>

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

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.

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.

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.

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

Specifies the filename of the subnet TFTP boot image file.

domain-name WORD<0-255>

Specifies a domain name for this DHCP subnet.

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.

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

Assigns a data value to an existing DHCP Custom Option.

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

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