Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

 
 

Configure DHCP Server for Apstra 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

The DHCP file includes the following details:

Table 1: DHCP 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 Range Start

The first address of the IP subnet available for dynamic assignment

Subnet / IP Pools / IP Range End

The last address of the IP subnet available for dynamic assignment

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 allocted 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 allocted for the host

Table 2: 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

Use GUI Configurator to Configure DHCP

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 Dhcp4, then click Basic Setup.
    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 DHCP

  1. From the left navigation menu of the Apstra ZTP GUI, click Dhcp4, then click Code Editor.
    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.

Use Text Editor to Configure DHCP

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.

  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 /containers_data/dhcp directory.
    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.
    admin@apstra-ztp:~$ sudo vi /containers_data/dhcp/dhcpd.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.