Configure DHCPv4 and DHCPv6 Server for HPE Networking Apstra Data Center Director ZTP

When a device connects to a network, Dynamic Host Configuration Protocol (DHCP) automatically assigns an available IP address to it. Apstra, by default, uses a Kea DHCP server for device management (as of Apstra version 5.0.0, previously it was ISC). If you set up a different DHCP server, you’re responsible for configuring the same details as described here.

DHCP Parameters

Table 1: DHCPv4 Basic Setup Parameters

Field Name

Description

Domain Search (domain-search)

Option to configure multiple search domains

(Example entry: dc1.yourdatacenter.com) To specify more than one value, separate them with a comma (,). For the parsing of the file to succeed, each line must end with a semicolon (;)

Domain Name (domain-name)

Option to indicate the domain name to use

(Example entry: dc1.yourdatacenter.com)

Domain Name Servers (domain-name-servers)

Option to list all of the DNS IP addresses. To specify more than one value, separate them with a comma (,). For the parsing of the file to succeed, each line must end with a semicolon (;)

TFTP Server IP (tftp-server-name)

IP address of the TFTP server

Subnet / subnet subnet

CIDR notation of IPv4 subnet (Example entry: 10.28.180.4/24)

Subnet / IP Pools / IP Pool

First address and last address of the IP subnet available for dynamic assignment. (for example: 10.28.180.101 - 10.28.180.200)

Subnet / Router

The default gateway IP address

Reservation Mode

Defines the reservation modes to use for this subnet

Host Reservations / Hardware Address

The host MAC address

Host Reservations / Fixed IP Address

The fixed IP address allocated for the host

Reservation Mode Default

All, Global, Out of Pool, or Disabled

Global Host Reservations / Hardware Address

The host MAC address

Global Host Reservations / Fixed IP Address

The fixed IP address allocated for the host

Table 2: DHCPv4 Configurator Parameters

Field Name

Description

valid-lifetime (valid-lifetime)

Defines the default IP lease validity duration

max-valid-lifetime (max-valid-lifetime)

Defines the maximum IP lease duration

match-client-id (match-client-id)

To indicate if server will use client id for lease lookups

interfaces-config / interfaces (interfaces)

The interfaces on which the DHCP server would listen for DHCP messages

lease-database / type (type)

Defines the lease-database type

lease-database / name (name)

The file path inside DHCPD container where lease information would be stored

lease-database / lfc-interval (lfc-interval)

The intervals at which DHCP will initiate lease file cleanup

subnet / id (id)

subnet (subnet)

CIDR notation of IPv4 subnet

option-date / name

The standard DHCPv4 option name

option-date / code

The standard DHCPv4 option code

option-date / space

space

option-date / data

The value passed to the specified option

option-def /name (name)

The standard DHCPv4 option name

option-def / code (code)

The standard DHCPv4 option code

option-def / space (space)

space

option-def / type (type)

The value passed to the specified option

client-classes / name (name)

"arista", "cisco", "sonic"

client-classes / test (test)

test

control-socket / socket-name (socket-name)

The location of UNIX socket file used to communicate with control agent

control-socket / socket-type (socket-type)

The DHCP socket type

loggers / name (name)

name

loggers / severity (severity)

Defines the logging severity level

loggers / debuglevel (debuglevel)

Specifies the level of debug message when severity is set to debug

loggers / output

output

reservation-mode (reservation-mode)

Types of reservations allowed (none, all, global, out of pool, disabled)

reservations-global (reservations-global)

Indicates if the server should look up global reservations

reservations-in-subnet (reservations-in-subnet)

Indicate if the server should look up in-subnet reservations

reservations-out-of-pool (reservations-out-of-pool)

Specify if the server can assume that all reserved addresses are out-of-pool. It can be ignored if "reservation-in-subnet" is false

reservations / Hardware Address

Used to list global reservations

reservations / Fixed IP Address

The fixed IP address allocated for the host

DHCPv6

Table 3: DHCPv6 Basic Setup Parameters
Field Name Description

Domain SearchDomain Search (domain-search)

Option to configure multiple search domains (Example entry: dc1.yourdatacenter.com) To specify more than one value, separate them with a comma (,). For the parsing of the file to succeed, each line must end with a semicolon (;)

DNS Servers (dns-servers)

Option to list all of the DNS IP addresses. To specify more than one value, separate them with a comma (,). For the parsing of the file to succeed, each line must end with a semicolon (;)

Subnet / subnet (subnet)

CIDR notation of IPv4 subnet (Example entry: 2001:db8:1::/64)

Subnet / IP Pools /

The first address and last address of the IP subnet available for dynamic assignment (

for example: entry: 2001:db8:1::1001-2001:db8:1::1fff)

Reservation Mode Defines the reservation modes to use for this subnet
Host Reservations / Hardware Address The host MAC address (Optional with DHCP Unique Identifier)
Host Reservations / DHCP Unique Identifier DHCP Unique Identifier (DUID) of the host (Optional with Hardware Address)
Host Reservations / Fixed IP Address The fixed IP address allocated for the host
Reservation Mode Default All, Global, Out of Pool, or Disabled
Global Host Reservations / Hardware Address The host MAC address (Optional with DHCP Unique Identifier)
Global Host Reservations / DHCP Unique Identifier DHCP Unique Identifier (DUID) of the host (Optional with Hardware Address)
Global Host Reservations / Fixed IP Address The fixed IP address allocated for the host
Table 4: DHCPv6 Configurator Parameters

Field Name

Description

valid-lifetime (valid-lifetime)

Defines the default IP lease validity duration

max-valid-lifetime (max-valid-lifetime)

Defines the maximum IP lease duration

preferred-lifetime (preferred-lifetime))

Defines the preferred lifetime

interfaces-config / interfaces (interfaces)

The interfaces on which the DHCP server would listen for DHCP messages within IP address

for example, eth0/2001:db8::1::1

lease-database / type (type)

Defines the lease-database type

lease-database / name (name)

The file path inside DHCPD container where lease information would be stored

lease-database / lfc-interval (lfc-interval)

The intervals at which DHCP will initiate lease file cleanup

subnet6 / id (ID)

ID of subnet 6

subnet6 / subnet (subnet)

CIDR notation of IPv6 subnet

subnet6 / interface (interface)

Interface with IPv6 global address

Default: eth0

option-date / name

The standard DHCPv6 option name

option-date / code

The standard DHCPv6 option code

option-date / space

space

option-date / data

The value passed to the specified option

option-def /name (name)

The standard DHCPv6 option name

option-def / code (code)

The standard DHCPv6 option code

option-def / space (space)

space

option-def / type (type)

The value passed to the specified option

client-classes / name (name)

juniper-evo

client-classes / test (test)

test

client-classes / option-data (name)

The standard DHCPv6 option name

client-classes /code (code)

The standard DHCPv6 option code

client-classes / space (space)

spaced

client-classes /option-data (data)

The value passed to the specified option

control-socket / socket-name (socket-name)

The location of UNIX socket file used to communicate with the control agent

control-socket / socket-type (socket-type)

The DHCP socket type

loggers / name (name)

name

loggers / severity (severity)

Defines the logging severity level

loggers / debuglevel (debuglevel)

Specifies the level of debug message when severity is set to debug

loggers / output

output

reservation-mode (reservation-mode)

Types of reservations allowed (none, all, global, out of pool, disabled)

reservations-global (reservations-global)

Indicates if the server should look up global reservations

reservations-in-subnet (reservations-in-subnet)

Indicate if the server should look up in-subnet reservations

reservations-out-of-pool (reservations-out-of-pool)

Specify if the server can assume that all reserved addresses are out-of-pool. It can be ignored if "reservation-in-subnet" is false

reservations / Hardware Address

Used to list global reservations (Optional with DHCP Unique Identifier

reservations / Fixed IP Address

The fixed IP address allocated for the host

Use GUI Configurator to Configure DHCPv4 and DHCPv6

You can set up optional parameters that the DHCP services will send to every device that asks for DHCP services. You have the option of configuring these parameters at a later time via configlets. (If you define these parameters in the DHCP service, don't try to set them up again via Apstra; the device OS may return an error.)

If in doubt, don't enter random parameters; it may result in timeouts as a service tries to resolve IP addresses.

  1. If you're using the wizard, step 2 is to configure DHCP. (You can skip this step for now and come back later to complete this configuration.) If you're not using the wizard, then from the left navigation menu of the Apstra ZTP GUI, click DHCP, then click Basic Setup.
    Configuration interface for setting up DHCPv4 with fields for domain search, domain name, DNS servers, TFTP server IP, and subnets. Includes options to load data, save, generate configuration, and enable IPv6. Required fields with errors are highlighted in red.
    The Basic Setup screen appears.
  2. Enter basic setup details, as applicable. See DHCP Parameters above for details. To cancel your entries, you can click Load Last Used Data at the bottom of the screen (new in Apstra version 5.0.0).
  3. Click Configurator (to the right of the Basic Setup tab).
    The Configurator screen appears.
  4. Enter details, as applicable. If you've entered details and want to start over, you can click Load Defaults (bottom left of screen) (new in Apstra version 5.0.0).
  5. Click Save to save the new configuration.

Use GUI Code Editor to Configure DHCPv4 and DHCPv6

  1. From the left navigation menu of the Apstra ZTP GUI, click DHCP, then click Code Editor.
    Configure DHCP4 interface of HPE Apstra ZTP platform showing JSON file in Code Editor tab with DHCP options for client classes like arista, cisco, sonic, and juniper. Left sidebar has navigation like Devices, Services, DHCP, Logs, Settings, and API. Top-right corner shows IPv6 toggle. Bottom has Load Defaults and Save buttons.
    The Code Editor screen opens.
  2. Update the file, as appropriate. If you've entered details and want to start over, you can click Load Defaults (bottom left of screen) (new in Apstra version 5.0.0).
  3. Click Save to save the new configuration.

Switch Between DHCPv4 and DHCPv6

You can switch between DHCPv4 and DHCPv6.

In the upper-right-hand corner of the screen, click the IPv6 edit box, and then click Basic Setup.

Configure DHCP4 interface of HPE Apstra ZTP platform showing JSON file in Code Editor tab with DHCP options for client classes like arista, cisco, sonic, and juniper. Left sidebar has navigation like Devices, Services, DHCP, Logs, Settings, and API. Top-right corner shows IPv6 toggle. Bottom has Load Defaults and Save buttons.
Configuration interface for DHCPv6 setup showing options for IP pool allocation, reservation mode selection, host reservations with DUID and IPv6 address fields, and buttons to load data or save config.

Use Text Editor to Configure DHCPv4 and DHCPv6

We recommend that you use the Apstra ZTP GUI Configurator to configure DHCP, but you have the option of configuring the file directly with a text editor, such as vi or nano.
Note:

All configuration files are owned by root. You must use sudo to run commands as root using the sudo command or after becoming root with the sudo -s command.

The following is an example configuration file for the DHCPv4 server in Kea. It outlines a basic scenario with a single IPv4 subnet, which includes one pool of dynamically allocated addresses.

  1. Open a terminal and SSH into the Apstra ZTP server.
    ssh admin@<apstra-ztp-server-ip> where <apstra-ztp-server-ip> is the IP address of the Apstra ZTP server.
  2. To see DHCP files on the Apstra ZTP VM, navigate to the DHCPv4 directory: /containers_data/dhcp or the DHCPv6 directory: /containers_data/dhcp6
    admin@apstra-ztp:~$ sudo ls -l /containers_data/dhcp
  3. Open the dhcpd.conf file in a text editor, such as vi or nano and update the file, as appropriate.
    For DHCPV4: admin@apstra-ztp:~$ sudo vi /containers_data/dhcp/dhcpd.conf
    For DHCPv6:
    admin@apstra-ztp:~$ sudo vi /containers_data/dhcp6/dhcpd6.conf
  4. After modifying any DHCP configuration, restart the Apstra ZTP DHCP process with the sudo docker restart dhcpd command. This forces it to read the new file values.