ISC DHCP Server

class container.dhcpd.Dhcpd(name, **kwargs)[source]

Bases: container.Docker

Docker container running a DHCP Daemon

conf

String storing dhcpd.conf settings.

add_global(option)[source]

Add global parameter to ‘conf’. Create these with functions within dhcpd.globals. :param option: String returned from one of the methods inside ‘dhcpd.globals’ class.

add_subnet(ip_network, option_list=None, addr_range=None)[source]

Adds a subnet configuration with the supplied parameters to ‘conf’.

Parameters:
  • ip_network – Network for subnet address and netmask.
  • addr_range – Range of IP addresses the DHCP server will assign.
  • option_list – List of options created by functions within ‘dhcpd.options’ or ‘dhcpd.globals’.
config(**kwargs)[source]

Extends Node.config. Creates a file containing the settings from ‘conf’ and writes them to /etc/dhcp inside the container.

Todo

If running and a config change is made restart the server

Todo

Store and mount the config file rather than copying it https://stackoverflow.com/questions/42248198/how-to-mount-a-single-file-in-a-volume

document(doc)[source]
class container.dhcpd.globals[source]

Global options as per http://www.ipamworldwide.com/ipam/dhcp-server-params.html. NOTE: not all options are implemented.

static authoritative()[source]
static default_lease_time(time)[source]
static local_address(address)[source]
static local_port(port)[source]
static max_lease_time(time)[source]
static min_lease_time(time)[source]
class container.dhcpd.options[source]

Per network options as per http://www.ipamworldwide.com/ipam/isc-dhcpv4-options.html NOTE: not all options are implemented.

class List

Bases: list, typing.MutableSequence

class Tuple

Bases: tuple

Tuple type; Tuple[X, Y] is the cross-product type of X and Y.

Example: Tuple[T1, T2] is a tuple of two elements corresponding to type variables T1 and T2. Tuple[int, float, str] is a tuple of an int, a float and a string.

To specify a variable-length tuple of homogeneous type, use Tuple[T, …].

static broadcast_address(ip_network)[source]
static cookie_servers(*addresses)[source]
static domain_name(name)[source]
static domain_name_servers(*addresses)[source]
static log_servers(*addresses)[source]
static ntp_servers(*addresses)[source]
static router_discovery(should_discover)[source]
static routers(*addresses)[source]
static static_routes(*addresses)[source]
static subnet_mask(ip_network)[source]
static time_servers(*addresses)[source]
container.dhcpd.example()[source]