1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
|
// This is an example configuration file for the DHCPv4 server in Kea.
// The purpose of this example is to showcase how configure
// Vendor Specific Information (code 43) RFC 2132 section 8.4
{
"Dhcp4": {
"option-def": [
{
// Two options that we are planning to include in option 43 as suboptions
// should be defined on global level
"array": false,
"code": 2,
"name": "vlanid",
// suboptions should have space configured and it can't start with 'vendor-'
// otherwise those will be included in 125 option not 43
"space": "339",
"type": "uint32"
},
{
"array": false,
"code": 3,
"name": "dls",
"space": "339",
"type": "string"
}
],
"client-classes": [
{
// Kea needs classification based on option 60, you can either use name:
// VENDOR_CLASS_ + option 60 content (test parameter is not required than)
// or use any name and add "test" parameter accordingly e.g.
// "test": "substring(option[60].hex,0,9) == 'partial-content-of-option-60'"
"name": "VENDOR_CLASS_339",
"option-def": [
{
// Vendor-specific option has to be defined on the class level, if we're planning
// to send a single value, then define its type accordingly. If this option
// should encapsulate other suboptions, the "space" parameter should be the same
// as included suboptions and "type" set to empty
"code": 43,
// Using the "encapsulate" direction, Kea is told to include options from
// the "339" namespace. We have defined several such options earlier.
// This way, the sub-options are "glued" to this option 43.
"encapsulate": "339",
"name": "vendor-encapsulated-options",
"type": "empty"
}
],
"option-data": [
{
// vendor-encapsulated-options and defined option on global level should
// be also configured with proper "data" parameters in "option-data" list.
// Because Kea will send only option that client ask for, and there is no way
// to ask for suboptions, parameter "always-send" with value set
// to true has also be included in all custom suboptions
"name": "vendor-encapsulated-options"
},
{
"always-send": true,
"data": "123",
"name": "vlanid",
"space": "339"
},
{
"always-send": true,
"data": "sdlp://192.0.2.11:18443",
"name": "dls",
"space": "339"
}
]
}
],
// Kea is told to listen on eth0 interface only.
"interfaces-config": {
"interfaces": ["eth0"]
},
// We need to specify the database used to store leases.
"lease-database": {
"type": "memfile"
},
// The following list defines subnets. We have only one subnet
// here. We tell Kea that it is directly available over local interface.
"subnet4": [
{
"interface": "eth0",
"pools": [
{
"pool": "192.0.2.50-192.0.2.50"
}
],
"subnet": "192.0.2.0/24"
}
]
}
}
|