]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5017] Examples for echo-client-id and match-client-id added.
authorTomek Mrugalski <tomasz@isc.org>
Fri, 16 Dec 2016 17:57:48 +0000 (18:57 +0100)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 16 Dec 2016 17:57:48 +0000 (18:57 +0100)
doc/examples/kea4/hooks.json
doc/examples/kea4/several-subnets.json
src/bin/dhcp4/.gitignore
src/bin/dhcp4/dhcp4_lexer.ll

index e86e04fab962cd5062c8b2ed23ca84b1f44abe24..d6b441414f90364edf75e5237b7c148fc1c3124e 100644 (file)
         "library": "/opt/lib/security.so"
      },
      {
-        "library": "/opt/lib/charging.so"
+         "library": "/opt/lib/charging.so",
+         "parameters": {
+             "path": "/var/kea/var",
+             "base-name": "kea-forensic6"
+         }
      }
   ]
 }
index 79606f9184eb04b42ea42e6766d3d3a73c2f197b..b690faf9309f78eccdaaaaf78985e5aedfadf2ee 100644 (file)
   "renew-timer": 1000,
   "rebind-timer": 2000,
 
+# RFC6842 says that the server is supposed to echo back client-id option.
+# However, some older clients do not support this and are getting confused
+# when they get their own client-id. Kea can disable RFC6842 support.
+  "echo-client-id": false,
+
+# Some clients don't use stable client identifier, but rather generate them
+# during each boot. This may cause a client that reboots frequently to get
+# multiple leases, which may not be desirable. As such, sometimes admins
+# prefer to tell their DHCPv4 server to ignore client-id value altogether
+# and rely exclusively on MAC address. This is a parameter that is defined
+# globally, but can be overridden on a subnet level.
+  "match-client-id": true,
+
 # The following list defines subnets. Each subnet consists of at
 # least subnet and pool entries.
-  "subnet4": [ 
-  {    "pools": [ { "pool":  "192.0.2.1 - 192.0.2.200" } ],
-       "subnet": "192.0.2.0/24"  },
-  {    "pools": [ { "pool": "192.0.3.100 - 192.0.3.200" } ],
-       "subnet": "192.0.3.0/24"  },
-  {    "pools": [ { "pool": "192.0.4.1 - 192.0.4.254" } ],
-       "subnet": "192.0.4.0/24"  } ]
+  "subnet4": [
+  {
+      "pools": [ { "pool":  "192.0.2.1 - 192.0.2.200" } ],
+      "subnet": "192.0.2.0/24"
+  },
+  {
+# This particular subnet has match-client-id value changed.
+      "pools": [ { "pool": "192.0.3.100 - 192.0.3.200" } ],
+      "subnet": "192.0.3.0/24",
+      "match-client-id": false
+  },
+  {
+      "pools": [ { "pool": "192.0.4.1 - 192.0.4.254" } ],
+      "subnet": "192.0.4.0/24"
+  } ]
 },
 
 # The following configures logging. It assumes that messages with at least
index 882ce20dab8fa3d9548897d9445b0d8579138ba9..817adfcd20923be4c12739ef1cd5b572b4384925 100644 (file)
@@ -5,3 +5,4 @@
 /spec_config.h
 /spec_config.h.pre
 /s-messages
+/dhcp4_parser.report
index 4ba1e5280819593daf3838a3883384e519a38b2e..03a67981f4d07affe208edd82252224400383045 100644 (file)
@@ -862,6 +862,7 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
 
 \"echo-client-id\" {
     switch(driver.ctx_) {
+    case isc::dhcp::Parser4Context::DHCP4:
     case isc::dhcp::Parser4Context::SUBNET4:
         return isc::dhcp::Dhcp4Parser::make_ECHO_CLIENT_ID(driver.loc_);
     default:
@@ -871,6 +872,7 @@ ControlCharacterFill            [^"\\]|\\{JSONEscapeSequence}
 
 \"match-client-id\" {
     switch(driver.ctx_) {
+    case isc::dhcp::Parser4Context::DHCP4:
     case isc::dhcp::Parser4Context::SUBNET4:
         return isc::dhcp::Dhcp4Parser::make_MATCH_CLIENT_ID(driver.loc_);
     default: