2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-02 23:15:20 +00:00

[#136,!143] Updated global-reservations.json

As a result of review. Improved header comment, indentation and some other
comments.
This commit is contained in:
Marcin Siodelski
2018-11-27 19:02:25 +01:00
committed by Francis Dupont
parent 81f4f566b6
commit 2f64c86362
2 changed files with 131 additions and 115 deletions

View File

@@ -1,6 +1,11 @@
// This is an example configuration file for the DHCPv4 server in Kea. // This is an example configuration file for the DHCPv4 server in Kea.
// It contains one subnet and two global reservations for the clients // It demonstrates how global host reservations can be configured.
// identified by the MAC addresses. // The global reservations are not associated with any subnet. They
// are assigned regardless of the subnet to which the DHCP client belongs.
// Global reservations are assigned to the DHCP clients using the
// same host identifier types as subnet specific reservations. This file
// contains multiple examples of host reservations using different
// identifier types, e.g. MAC address, client identifier etc.
{ "Dhcp4": { "Dhcp4":
{ {
@@ -9,7 +14,7 @@
"interfaces": [ "ethX" ] "interfaces": [ "ethX" ]
}, },
// We need to specify the the database used to store leases. As of September // We need to specify the database used to store leases. As of September
// 2016, four database backends are supported: MySQL, PostgreSQL, Cassandra, and // 2016, four database backends are supported: MySQL, PostgreSQL, Cassandra, and
// the in-memory database, Memfile. We'll use memfile because it doesn't // the in-memory database, Memfile. We'll use memfile because it doesn't
// require any prior set up. // require any prior set up.
@@ -41,14 +46,15 @@
// The example below is not optimal from a performance perspective, but it // The example below is not optimal from a performance perspective, but it
// nicely showcases the host reservation capabilities. Please use the minimum // nicely showcases the host reservation capabilities. Please use the minimum
// set of identifier types used in your network. // set of identifier types used in your network.
"host-reservation-identifiers": [ "circuit-id", "hw-address", "duid", "host-reservation-identifiers": [ "circuit-id", "hw-address", "duid",
"client-id", "flex-id" ], "client-id", "flex-id" ],
// This directive tells Kea that reservations are global. // This directive tells Kea that reservations are global. Note that this
"reservation-mode": "global", // can also be specified at shared network and/or subnet level.
"reservation-mode": "global",
// Define some reservations at the global scope. // Define several global host reservations.
"reservations": [ "reservations": [
// This is a reservation for a specific hardware/MAC address. It's a very // This is a reservation for a specific hardware/MAC address. It's a very
// simple reservation: just an address and nothing else. // simple reservation: just an address and nothing else.
@@ -56,62 +62,63 @@
// the global scope: as it breaks the link between the reservation and // the global scope: as it breaks the link between the reservation and
// the subnet it can lead to a client localized in another subnet than // the subnet it can lead to a client localized in another subnet than
// its address belongs to. // its address belongs to.
{ {
"hw-address": "1a:1b:1c:1d:1e:1f", "hw-address": "1a:1b:1c:1d:1e:1f",
"ip-address": "192.0.2.201" "ip-address": "192.0.2.201"
}, },
// This is a reservation for a specific client-id. It also shows // This is a reservation for a specific client-id. It also shows
// the this client will get a reserved hostname. A hostname can be defined // the this client will get a reserved hostname. A hostname can be defined
// for any identifier type, not just client-id. Either a hostname or // for any identifier type, not just client-id. Either a hostname or
// an address is required. // an address is required.
{ {
"client-id": "01:11:22:33:44:55:66", "client-id": "01:11:22:33:44:55:66",
"hostname": "special-snowflake" "hostname": "special-snowflake"
}, },
// The third reservation is based on DUID. This reservation also // The third reservation is based on DUID. This reservation also
// defines special option values for this particular client. If // defines special option values for this particular client. If
// the domain-name-servers option would have been defined on a global, // the domain-name-servers option would have been defined on a global,
// subnet or class level, the host specific values take preference. // subnet or class level, the host specific values take precedence for
{ // this particular DHCP client.
"duid": "01:02:03:04:05", {
"ip-address": "192.0.2.203", "duid": "01:02:03:04:05",
"option-data": [ { "ip-address": "192.0.2.203",
"name": "domain-name-servers", "option-data": [ {
"data": "10.1.1.202,10.1.1.203" "name": "domain-name-servers",
} ] "data": "10.1.1.202,10.1.1.203"
}, } ]
},
// The fourth reservation is based on circuit-id. This is an option inserted // The fourth reservation is based on circuit-id. This is an option inserted
// by the relay agent that forwards the packet from client to the server. // by the relay agent that forwards the packet from client to the server.
// In this example the host is also assigned vendor specific options. // In this example the host is also assigned vendor specific options.
{ {
"circuit-id": "01:11:22:33:44:55:66", "circuit-id": "01:11:22:33:44:55:66",
"ip-address": "192.0.2.204", "ip-address": "192.0.2.204",
"option-data": [ "option-data": [
{ {
"name": "vivso-suboptions", "name": "vivso-suboptions",
"data": "4491" "data": "4491"
}, },
{ {
"name": "tftp-servers", "name": "tftp-servers",
"space": "vendor-4491", "space": "vendor-4491",
"data": "10.1.1.202,10.1.1.203" "data": "10.1.1.202,10.1.1.203"
} }
] ]
}, },
// This reservation is for a client that needs specific DHCPv4 fields to be // This reservation is for a client that needs specific DHCPv4 fields to be
// set. Three supported fields are next-server, server-hostname and // set. Three supported fields are next-server, server-hostname and
// boot-file-name // boot-file-name
{ {
"client-id": "01:0a:0b:0c:0d:0e:0f", "client-id": "01:0a:0b:0c:0d:0e:0f",
"ip-address": "192.0.2.205", "ip-address": "192.0.2.205",
"next-server": "192.0.2.1", "next-server": "192.0.2.1",
"server-hostname": "hal9000", "server-hostname": "hal9000",
"boot-file-name": "/dev/null" "boot-file-name": "/dev/null"
}, },
// This reservation is using flexible identifier. Instead of relying // This reservation is using flexible identifier. Instead of relying
// on specific field, sysadmin can define an expression similar to what // on specific field, sysadmin can define an expression similar to what
@@ -122,11 +129,12 @@
// quotes. // quotes.
// Note: flexible identifier requires flex_id hook library to be // Note: flexible identifier requires flex_id hook library to be
// loaded to work. // loaded to work.
{ {
"flex-id": "s0mEVaLue", "flex-id": "s0mEVaLue",
"ip-address": "192.0.2.206" "ip-address": "192.0.2.206"
} }
], ],
// Define a subnet. // Define a subnet.
"subnet4": [ "subnet4": [
{ {

View File

@@ -1,8 +1,11 @@
// This is an example configuration file for DHCPv6 server in Kea // This is an example configuration file for the DHCPv6 server in Kea.
// that showcases how to do globalhost reservations. It is // It demonstrates how global host reservations can be configured.
// assumed that one subnet (2001:db8:1::/64) is available directly // The global reservations are not associated with any subnet. They
// over ethX interface. // are assigned regardless of the subnet to which the DHCP client belongs.
// Global reservations are assigned to the DHCP clients using the
// same host identifier types as subnet specific reservations. This file
// contains multiple examples of host reservations using different
// identifier types, e.g. DUID, MAC address etc.
{ "Dhcp6": { "Dhcp6":
{ {
@@ -11,7 +14,7 @@
"interfaces": [ "ethX" ] "interfaces": [ "ethX" ]
}, },
// We need to specify the the database used to store leases. As of // We need to specify the database used to store leases. As of
// September 2016, four database backends are supported: MySQL, // September 2016, four database backends are supported: MySQL,
// PostgreSQL, Cassandra, and the in-memory database, Memfile. // PostgreSQL, Cassandra, and the in-memory database, Memfile.
// We'll use memfile because it doesn't require any prior set up. // We'll use memfile because it doesn't require any prior set up.
@@ -35,10 +38,11 @@
// given network. // given network.
"host-reservation-identifiers": [ "duid", "hw-address", "flex-id" ], "host-reservation-identifiers": [ "duid", "hw-address", "flex-id" ],
// This directive tells Kea that reservations are global. // This directive tells Kea that reservations are global. Note that this
// can also be specified at shared network and/or subnet level.
"reservation-mode": "global", "reservation-mode": "global",
// Host reservations. Define several reservations. // Define several global host reservations.
"reservations": [ "reservations": [
// This is a simple host reservation. The host with DUID matching // This is a simple host reservation. The host with DUID matching
@@ -47,10 +51,10 @@
// the global scope: as it breaks the link between the reservation and // the global scope: as it breaks the link between the reservation and
// the subnet it can lead to a client localized in another subnet than // the subnet it can lead to a client localized in another subnet than
// its address belongs to. // its address belongs to.
{ {
"duid": "01:02:03:04:05:0A:0B:0C:0D:0E", "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
"ip-addresses": [ "2001:db8:1::100" ] "ip-addresses": [ "2001:db8:1::100" ]
}, },
// This is similar to the previous one, but this time the reservation // This is similar to the previous one, but this time the reservation
// is done based on hardware/MAC address. The server will do its best to // is done based on hardware/MAC address. The server will do its best to
@@ -58,21 +62,23 @@
// 'mac-sources' directive for details). This particular reservation // 'mac-sources' directive for details). This particular reservation
// also specifies two extra options to be available for this client. If // also specifies two extra options to be available for this client. If
// there are options with the same code specified in a global, subnet or // there are options with the same code specified in a global, subnet or
// class scope, the values defined at host level take precedence. // class scope, the values defined at host level take precedence for
{ // this particular DHCP client.
"hw-address": "00:01:02:03:04:05", {
"ip-addresses": [ "2001:db8:1::101" ], "hw-address": "00:01:02:03:04:05",
"option-data": [ "ip-addresses": [ "2001:db8:1::101" ],
{ "option-data": [
"name": "dns-servers", {
"data": "3000:1::234" "name": "dns-servers",
}, "data": "3000:1::234"
{ },
"name": "nis-servers", {
"data": "3000:1::234" "name": "nis-servers",
}], "data": "3000:1::234"
"client-classes": [ "special_snowflake", "office" ] }
}, ],
"client-classes": [ "special_snowflake", "office" ]
},
// This is a bit more advanced reservation. The client with the specified // This is a bit more advanced reservation. The client with the specified
// DUID will get a reserved address, a reserved prefix and a hostname. // DUID will get a reserved address, a reserved prefix and a hostname.
@@ -80,21 +86,23 @@
// Finally, this reservation features vendor specific options for CableLabs, // Finally, this reservation features vendor specific options for CableLabs,
// which happen to use enterprise-id 4491. Those particular values will // which happen to use enterprise-id 4491. Those particular values will
// be returned only to the client that has a DUID matching this reservation. // be returned only to the client that has a DUID matching this reservation.
{ {
"duid": "01:02:03:04:05:06:07:08:09:0A", "duid": "01:02:03:04:05:06:07:08:09:0A",
"ip-addresses": [ "2001:db8:1:cafe::1" ], "ip-addresses": [ "2001:db8:1:cafe::1" ],
"prefixes": [ "2001:db8:2:abcd::/64" ], "prefixes": [ "2001:db8:2:abcd::/64" ],
"hostname": "foo.example.com", "hostname": "foo.example.com",
"option-data": [ { "option-data": [
"name": "vendor-opts", {
"data": "4491" "name": "vendor-opts",
}, "data": "4491"
{ },
"name": "tftp-servers", {
"space": "vendor-4491", "name": "tftp-servers",
"data": "3000:1::234" "space": "vendor-4491",
} ] "data": "3000:1::234"
}, }
]
},
// This reservation is using flexible identifier. Instead of relying // This reservation is using flexible identifier. Instead of relying
// on specific field, sysadmin can define an expression similar to what // on specific field, sysadmin can define an expression similar to what
@@ -104,31 +112,31 @@
// Expression can be specified either as hex or plain text using single // Expression can be specified either as hex or plain text using single
// quotes. // quotes.
// Note: flexible identifier requires flex_id hook library to be // Note: flexible identifier requires flex_id hook library to be
//loaded to work. // loaded to work.
{ {
"flex-id": "'somevalue'", "flex-id": "'somevalue'",
"ip-addresses": [ "2001:db8:1:cafe::2" ] "ip-addresses": [ "2001:db8:1:cafe::2" ]
} }
], ],
// The following list defines subnets. Subnet, pools and interface definitions // The following list defines subnets. Subnet, pools and interface definitions
// are the same as in the regular scenario. // are the same as in the regular scenario.
"subnet6": [ "subnet6": [
{ {
"subnet": "2001:db8::/47", "subnet": "2001:db8::/47",
"pools": [ { "pool": "2001:db8::/64" } ], "pools": [ { "pool": "2001:db8::/64" } ],
"pd-pools": [ "pd-pools": [
{ {
"prefix": "2001:db8:1:8000::", "prefix": "2001:db8:1:8000::",
"prefix-len": 56, "prefix-len": 56,
"delegated-len": 64 "delegated-len": 64
} }
], ],
"interface": "ethX" "interface": "ethX"
} }
] ]
}, },
// The following configures logging. It assumes that messages with at // The following configures logging. It assumes that messages with at