Configure DHCP Server Global Parameters

Configure DHCP global settings for the hosted DHCP Server. Configure only the settings that apply to your deployment.

About this task

It's not mandatory to configure all of the settings at the global level. You can also apply many of these settings to specific subnets or hosts.

Procedure

  1. Enter Global Configuration mode:

    enable

    configure terminal

  2. Configure the DHCP Server as an authoritative or non-authoritative DHCP server. Run only the command that applies to your deployment:
    • For authoritative mode—ip dhcp-server authoritative
    • For non-authoritative mode (the default setting)—no ip dhcp-server authoritative
  3. Configure the following optional parameters. Note that you can also configure these settings within a DHCP subnet. Configure only the settings that apply to your deployment.
    1. Configure the global lease expiration:
      ip dhcp-server lease-time <60-300000000>
    2. Configure global DNS servers:
      ip dhcp-server domain-name-servers {A.B.C.D} [...]
    3. Configure global NTP servers:
      ip dhcp-server ntp-servers {A.B.C.D} [...]
    4. Configure global TFTP settings with the following commands:

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

      ip dhcp-server tftp server-name WORD<0-64>

      ip dhcp-server tftp boot-file-name WORD<0-128>

    5. Configure a global domain name for the DHCP Server:

      ip dhcp-server domain-name WORD<0-255>

    6. Configure global NetBIOS settings by assigning a name server and node type:

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

      ip dhcp-server netbios-node-type {0x1|0x2|0x4|0x8}

  4. If you want to deploy High Availability (HA), configure HA on this switch:

    ip dhcp-server ha-peer {A.B.C.D}

    ip dhcp-server ha-role {primary | standby} (Optional)

  5. Configure DHCP custom options if you want to deploy non-standard DHCP options. For each custom option, do the following:
    1. Define the custom option by assigning a code, data type, and text label.

      ip dhcp-server custom-option-def <code> type <ipv4-address | uint32 | string> [name WORD<0-128>]

    2. Assign a data value to the custom option that you defined. Note that you can also do this within a subnet:

      ip dhcp-server custom-option-data <code> value WORD<0-255>

Variable Definitions

Use the variable definitions in the following table to configure DHCP Server global parameters using the CLI.

Table 1. DHCP Server Global Settings
Variable Definition
lease-time <60-300000000>

Assigns the global lease timer in seconds. The host lease expires when the timer expires. The default is 86400.

Note: The DHCP renewal process begins when a lease reaches 50% of the remaining expiration timer. The client unicasts a renewal request to DHCP Server, which checks its database before confirming the renewal.
domain-name-servers {A.B.C.D} [...]

Specifies the IPv4 address of one or more DNS servers. You can assign a maximum of eight servers. With multiple servers, list each server address on the same command line with a space between 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 servers. With multiple servers, list each server address on the same command line with a space between each address entry.

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

Specifies the IP address of the global TFTP server for DHCP Server.

You must assign an IP address to the server before you can assign other TFTP settings such as a server name and boot image file.

tftp server-name WORD<0-64>

Specifies the server name of the global TFTP server for DHCP Server.

tftp boot-file name WORD<0-128>

Specifies the file name of the global TFTP boot image file for DHCP Server

domain-name WORD<0-255>

Assigns a domain name to the DHCP Server.

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

Specifies the IPv4 address of the NetBIOS server.

netbios-node-type {0x1|0x2|0x4|0x8}

Specifies the node type of the NetBIOS server. Enter one of the following values according to which value fits your deployment:

  • 0x1—B node

  • 0x2—P-node

  • 0x4—M-node

  • 0x8—H-node

The default setting is 0x0 (unconfigured).

ha-peer {A.B.C.D}

Specifies the IPv4 address of the redundant peer switch in a High Availability (HA) pair.

ha-role {primary | standby}

Assigns the High Availability (HA) role of this switch. Within an HA pair, you must have one primary server and one standby server that do the following:

  • primary—This switch provides DHCP services while the switch is active.

  • standby—This switch provides DHCP services only when the primary switch is inactive.

Note: Assigning roles is optional. By default, the switch with the lower IP address is primary.
custom-option-def <224-254> type <ipv4-address | uint32 | string> [name WORD<0-128>]

Defines the format of a customized option that you want the DHCP Server to provide to clients.

  • <224-254>—Assigns the DHCP code that calls this custom option. Enter an integer in the unassigned range from 224 to 254.

  • type <ipv4-address | uint32 | string>—Assigns the data type for all data values that you assign to this custom option. The available data types are: IPv4 address, integer, or string.

  • name <WORD<0-128>—Specifies a text label that identitifies this custom option.

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

Assigns a data value to a DHCP Custom Option that you defined previously.

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

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