Tip

This is the documentation for the 22.02 version. Looking for the documentation of the latest version? Have a look here.

DHCP Options

DHCP Options provide information to clients beyond the basic address assignment. These options give clients other aspects of the network configuration, tell clients how they should behave on the network, and give them information about services available on the network. Common examples are a default gateway, DNS Servers, Network Time Protocol servers, network booting behavior, and dozens of other possibilities.

See also

For a list of Standard IPv4 DHCP options, see Standard IPv4 DHCP Options. This list also includes the type of data expected and whether or not they take multiple values.

The general form of an option is:

tnsr(config-kea-dhcp4)# option <name>
tnsr(config-kea-dhcp4-opt)# data <comma-separated values>
tnsr(config-kea-dhcp4-opt)# exit

This example defines a global domain name for all clients in all subnets:

tnsr(config-kea-dhcp4)# option domain-name
tnsr(config-kea-dhcp4-opt)# data example.com
tnsr(config-kea-dhcp4-opt)# exit

This example defines a default gateway for a specific subnet:

tnsr(config-kea-subnet4)# option routers
tnsr(config-kea-subnet4-opt)# data 10.2.0.1
tnsr(config-kea-subnet4-opt)# exit

To see a list of option names, enter:

tnsr(config-kea-dhcp4)# option ?

When defining options the data can take different forms. The DHCP daemon uses comma-separated value (CSV) format by default and it will automatically convert the text representation of a value to the expected data in the daemon.

Inside the option configuration mode, the following choices are available:

always-send <boolean>:

Controls whether the DHCP server will always send this option in a response, or only when requested by a client. The default behavior varies by option and is documented in Standard IPv4 DHCP Options

csv-format <boolean>:

Toggles between either CSV formatted data or raw binary data. This defaults to true unless an option does not have a default definition. In nearly all cases this option should be left at the default.

data <data>:

Arbitrary option data. Do not enclose in quotes. To see option data types and expected formats, see Standard IPv4 DHCP Options

space <name>:

Option space in which this entry exists, defaults to dhcp4.

Standard IPv4 DHCP Options

This list contains information about the standard IPv4 DHCP options, sourced from the Kea Administrator Manual section on DHCP Options.

For a list of the Types and their possible values, see DHCP Option Types.

Name

Code

Type

Array

Always Return

time-offset

2

int32

false

false

routers

3

ipv4-address

true

true

time-servers

4

ipv4-address

true

false

name-servers

5

ipv4-address

true

false

domain-name-servers

6

ipv4-address

true

true

log-servers

7

ipv4-address

true

false

cookie-servers

8

ipv4-address

true

false

lpr-servers

9

ipv4-address

true

false

impress-servers

10

ipv4-address

true

false

resource-location-servers

11

ipv4-address

true

false

boot-size

13

uint16

false

false

merit-dump

14

string

false

false

domain-name

15

fqdn

false

true

swap-server

16

ipv4-address

false

false

root-path

17

string

false

false

extensions-path

18

string

false

false

ip-forwarding

19

boolean

false

false

non-local-source-routing

20

boolean

false

false

policy-filter

21

ipv4-address

true

false

max-dgram-reassembly

22

uint16

false

false

default-ip-ttl

23

uint8

false

false

path-mtu-aging-timeout

24

uint32

false

false

path-mtu-plateau-table

25

uint16

true

false

interface-mtu

26

uint16

false

false

all-subnets-local

27

boolean

false

false

broadcast-address

28

ipv4-address

false

false

perform-mask-discovery

29

boolean

false

false

mask-supplier

30

boolean

false

false

router-discovery

31

boolean

false

false

router-solicitation-address

32

ipv4-address

false

false

static-routes

33

ipv4-address

true

false

trailer-encapsulation

34

boolean

false

false

arp-cache-timeout

35

uint32

false

false

ieee802-3-encapsulation

36

boolean

false

false

default-tcp-ttl

37

uint8

false

false

tcp-keepalive-interval

38

uint32

false

false

tcp-keepalive-garbage

39

boolean

false

false

nis-domain

40

string

false

false

nis-servers

41

ipv4-address

true

false

ntp-servers

42

ipv4-address

true

false

vendor-encapsulated-options

43

empty

false

false

netbios-name-servers

44

ipv4-address

true

false

netbios-dd-server

45

ipv4-address

true

false

netbios-node-type

46

uint8

false

false

netbios-scope

47

string

false

false

font-servers

48

ipv4-address

true

false

x-display-manager

49

ipv4-address

true

false

dhcp-option-overload

52

uint8

false

false

dhcp-message

56

string

false

false

dhcp-max-message-size

57

uint16

false

false

vendor-class-identifier

60

binary

false

false

nwip-domain-name

62

string

false

false

nwip-suboptions

63

binary

false

false

tftp-server-name

66

string

false

false

boot-file-name

67

string

false

false

user-class

77

binary

false

false

client-system

93

uint16

true

false

client-ndi

94

record (uint8, uint8, uint8)

false

false

uuid-guid

97

record (uint8, binary)

false

false

subnet-selection

118

ipv4-address

false

false

domain-search

119

binary

false

false

vivco-suboptions

124

binary

false

false

vivso-suboptions

125

binary

false

false

DHCP Option Types

binary:

An arbitrary string of bytes, specified as a set of hexadecimal digits.

boolean:

Boolean value with allowed values true or false.

empty:

No value, data is carried in suboptions.

fqdn:

Fully qualified domain name (e.g. www.example.com).

ipv4-address:

IPv4 address in dotted-decimal notation (e.g. 192.0.2.1).

ipv6-address:

IPv6 address in compressed colon notation (e.g. 2001:db8::1).

ipv6-prefix:

An IPv6 address and prefix length

record:

Structured data of other types (except record and empty).

string:

Any arbitrary text.

int8:

8-bit signed integer with values between -128 to 127.

int16:

16-bit signed integer with values between -32768 to 32767.

int32:

32 bit signed integer with values between -2147483648 and 2147483647.

psid:

Port Set ID and length with values in the format <id>/<length>. Defines a port set for use by the client. The value of <id> is 0-65535, value of <length> is 0-16.

tuple:

A length encoded as an 8-bit unsigned integer followed by a string of this length.

uint8:

8 bit unsigned integer with values between 0 and 255.

uint16:

16 bit unsigned integer with values between 0 and 65535.

uint32:

32 bit unsigned integer with values between 0 and 4294967295.

IPv4 DHCP Option Definitions

TNSR also supports custom DHCP option definitions. These allow new options not listed in Standard IPv4 DHCP Options to be defined and they may also be used to change the standard definitions. Once created, these entries may be used as any other option, in the manner covered earlier in this document.

To create a new option definition, start in config-kea-dhcp4 mode and use the option-def <name> command:

tnsr(config-kea-dhcp4)# option-def <name>
tnsr(config-kea-dhcp4-optdef)#

Note

To create a custom option, use a unique custom name; to redefine a standard option, enter its name from Standard IPv4 DHCP Options.

This command enters config-kea-dhcp4-optdef mode where the following additional commands are available:

array <true|false>:

When set to true, the data for this option is an array of values.

code <code-val>:

The code number for the DHCP option.

encapsulate <encap>:

Encapsulated option space name.

record-types <types>:

Record field type list.

space <space-name>:

Option space name.

type <type>:

Type of the option data, see DHCP Option Types for a list of types and allowed values.