From: Thomas Markwalder Date: Thu, 12 Jan 2017 13:23:21 +0000 (-0500) Subject: [5033] Added exmaple json files with dhcp-ddns, fixed copyrights X-Git-Tag: trac5112_base~6^2~8 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7114906f0d99e35c3267fa7327aaac8ca08a06e;p=thirdparty%2Fkea.git [5033] Added exmaple json files with dhcp-ddns, fixed copyrights --- diff --git a/doc/examples/kea4/with-ddns.json b/doc/examples/kea4/with-ddns.json new file mode 100644 index 0000000000..ab6fc8c736 --- /dev/null +++ b/doc/examples/kea4/with-ddns.json @@ -0,0 +1,77 @@ +# This is an example configuration file for the DHCPv4 server in Kea. +# It is a basic scenario with one IPv4 subnet configured but with DDNS +# enabled. + +{ "Dhcp4": + +{ +# Kea is told to listen on ethX interface only. + "interfaces-config": { + "interfaces": [ "ethX" ] + }, + +# We need to specify the the database used to store leases. As of +# September 2016, four database backends are supported: MySQL, +# PostgreSQL, Cassandra, and the in-memory database, Memfile. +# We'll use memfile because it doesn't require any prior set up. + "lease-database": { + "type": "memfile", + "lfc-interval": 3600 + }, + +# Addresses will be assigned with a lifetime of 4000 seconds. + "valid-lifetime": 4000, + +# Renew and rebind timers are commented out. This implies that options +# 58 and 59 will not be sent to the client. In this case it is up to +# the client to pick the timer values according to RFC2131. Uncomment the +# timers to send these options to the client. +# "renew-timer": 1000, +# "rebind-timer": 2000, + +# The following list defines subnets. We have only one subnet +# here. We tell Kea that it is directly available over local interface. + "subnet4": [ + { + "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ], + "subnet": "192.0.2.0/24", + "interface": "ethX" + } + ], + +# Enable dynamic DNS updates + "dhcp-ddns" : { + "enable-updates" : true, + "server-ip" : "192.0.2.0", + "server-port" : 3432, + "sender-ip" : "192.0.2.1", + "sender-port" : 3433, + "max-queue-size" : 2048, + "ncr-protocol" : "UDP", + "ncr-format" : "JSON", + "always-include-fqdn" : true, + "override-no-update" : true, + "override-client-update" : true, + "replace-client-name" : "when-present", + "generated-prefix" : "test.prefix", + "qualifying-suffix" : "test.suffix." + } +}, + +# The following configures logging. It assumes that messages with at least +# informational level (info, warn, error and fatal) should be logged to stdout. +"Logging": { + "loggers": [ + { + "name": "kea-dhcp4", + "output_options": [ + { + "output": "stdout" + } + ], + "severity": "INFO" + } + ] +} + +} diff --git a/doc/examples/kea6/with-ddns.json b/doc/examples/kea6/with-ddns.json new file mode 100644 index 0000000000..5bb53cb4b8 --- /dev/null +++ b/doc/examples/kea6/with-ddns.json @@ -0,0 +1,81 @@ +# This is an example configuration file for DHCPv6 server in Kea. +# It's a basic scenario with one IPv6 subnet configured. It is +# assumed that one subnet (2001:db8:1::/64 is available directly +# over ethX interface. + +{ "Dhcp6": + +{ +# Kea is told to listen on ethX interface only. + "interfaces-config": { + "interfaces": [ "ethX" ] + }, + +# We need to specify the the database used to store leases. As of +# September 2016, four database backends are supported: MySQL, +# PostgreSQL, Cassandra, and the in-memory database, Memfile. +# We'll use memfile because it doesn't require any prior set up. + "lease-database": { + "type": "memfile", + "lfc-interval": 3600 + }, + +# Addresses will be assigned with preferred and valid lifetimes +# being 3000 and 4000, respectively. Client is told to start +# renewing after 1000 seconds. If the server does not respond +# after 2000 seconds since the lease was granted, client is supposed +# to start REBIND procedure (emergency renewal that allows switching +# to a different server). + "preferred-lifetime": 3000, + "valid-lifetime": 4000, + "renew-timer": 1000, + "rebind-timer": 2000, + +# The following list defines subnets. Each subnet consists of at +# least subnet and pool entries. + "subnet6": [ + { + "pools": [ { "pool": "2001:db8:1::/80" } ], + "subnet": "2001:db8:1::/64", + "interface": "ethX" + } + ] + + "dhcp-ddns" : { + "enable-updates" : true, + "server-ip" : "3001::1", + "server-port" : 3432, + "sender-ip" : "3001::2", + "sender-port" : 3433, + "max-queue-size" : 2048, + "ncr-protocol" : "UDP", + "ncr-format" : "JSON", + "always-include-fqdn" : true, + "override-no-update" : true, + "override-client-update" : true, + "replace-client-name" : "when-present", + "generated-prefix" : "test.prefix", + "qualifying-suffix" : "test.suffix." + }, + +}, + +# The following configures logging. It assumes that messages with at least +# informational level (info, warn, error and fatal) should be logged to stdout. +"Logging": { + "loggers": [ + { + "name": "kea-dhcp6", + "output_options": [ + { + "output": "stdout" + } + ], + "debuglevel": 0, + "severity": "INFO" + } + ] +} + +} + diff --git a/src/bin/dhcp4/simple_parser4.cc b/src/bin/dhcp4/simple_parser4.cc index 29317d03d7..ce80900f0b 100644 --- a/src/bin/dhcp4/simple_parser4.cc +++ b/src/bin/dhcp4/simple_parser4.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/dhcp4/simple_parser4.h b/src/bin/dhcp4/simple_parser4.h index 3feea2f667..abc842b108 100644 --- a/src/bin/dhcp4/simple_parser4.h +++ b/src/bin/dhcp4/simple_parser4.h @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this diff --git a/src/bin/dhcp4/tests/parser_unittest.cc b/src/bin/dhcp4/tests/parser_unittest.cc index d39652e9fd..0dcab6a75e 100644 --- a/src/bin/dhcp4/tests/parser_unittest.cc +++ b/src/bin/dhcp4/tests/parser_unittest.cc @@ -1,4 +1,4 @@ -// Copyright (C) 2016 Internet Systems Consortium, Inc. ("ISC") +// Copyright (C) 2016-2017 Internet Systems Consortium, Inc. ("ISC") // // This Source Code Form is subject to the terms of the Mozilla Public // License, v. 2.0. If a copy of the MPL was not distributed with this @@ -322,7 +322,8 @@ TEST(ParserTest, file) { "pgsql-reservations.json", "reservations.json", "several-subnets.json", - "single-subnet.json" }; + "single-subnet.json", + "with-ddns.json" }; for (int i = 0; i