Browse Source

[5132] Reservation examples updated.

Tomek 8 years ago
parent
commit
db7d3965ba
2 changed files with 74 additions and 49 deletions
  1. 14 1
      doc/examples/kea4/reservations.json
  2. 60 48
      doc/examples/kea6/reservations.json

+ 14 - 1
doc/examples/kea4/reservations.json

@@ -113,12 +113,25 @@
 # 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:of",
+             "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 on specific
+// field, sysadmin can define an expression similar to what is used for client
+// classification, e.g. substring(relay[0].option[17],0,6). Then, based on the
+// value of that expression for incoming packet, the reservation is matched.
+// Expression can be specified either as hex or plain text using single
+// quotes.
+// Note: flexible identifier requires flex_id hook library to be loaded to work.
+         {
+             "flex-id": "s0mEVaLue",
+             "ip-address": "192.0.2.206"
          }
          }
+
        ]
        ]
     }
     }
   ]
   ]

+ 60 - 48
doc/examples/kea6/reservations.json

@@ -44,11 +44,11 @@
       "pools": [ { "pool": "2001:db8:1::/120" } ],
       "pools": [ { "pool": "2001:db8:1::/120" } ],
 
 
       "pd-pools": [
       "pd-pools": [
-          {
-              "prefix": "2001:db8:1:8000::",
-              "prefix-len": 56,
-              "delegated-len": 64
-          }
+	  {
+	      "prefix": "2001:db8:1:8000::",
+	      "prefix-len": 56,
+	      "delegated-len": 64
+	  }
       ],
       ],
       "interface": "ethX",
       "interface": "ethX",
 
 
@@ -62,10 +62,10 @@
       "reservations": [
       "reservations": [
 # This is a simple host reservation. The host with DUID matching
 # This is a simple host reservation. The host with DUID matching
 # the specified value will get an address of 2001:db8:1::100.
 # the specified value will get an address of 2001:db8:1::100.
-          {
-              "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
-              "ip-addresses": [ "2001:db8:1::100" ]
-          },
+	  {
+	      "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
+	      "ip-addresses": [ "2001:db8:1::100" ]
+	  },
 # This is similar to the previous one, but this time the reservation is done
 # 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 extract
 # based on hardware/MAC address. The server will do its best to extract
 # the hardware/MAC address from received packets (see 'mac-sources' directive
 # the hardware/MAC address from received packets (see 'mac-sources' directive
@@ -73,42 +73,54 @@
 # to be available for this client. If there are options with the same code
 # to be available for this client. If there are options with the same code
 # specified in a global, subnet or class scope, the values defined at host level
 # specified in a global, subnet or class scope, the values defined at host level
 # take precedence.
 # take precedence.
-          {
-              "hw-address": "00:01:02:03:04:05",
-              "ip-addresses": [ "2001:db8:1::101" ],
-              "option-data": [
-              {
-                  "name": "dns-servers",
-                  "data": "3000:1::234"
-              },
-              {
-                  "name": "nis-servers",
-                  "data": "3000:1::234"
-              }],
-              "client-classes": [ "special_snowflake", "office" ]
-          },
+	  {
+	      "hw-address": "00:01:02:03:04:05",
+	      "ip-addresses": [ "2001:db8:1::101" ],
+	      "option-data": [
+	      {
+		  "name": "dns-servers",
+		  "data": "3000:1::234"
+	      },
+	      {
+		  "name": "nis-servers",
+		  "data": "3000:1::234"
+	      }],
+	      "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.
 # This reservation is for an address that it not within the dynamic pool.
 # This reservation is for an address that it not within the dynamic pool.
 # 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",
-              "ip-addresses": [ "2001:db8:1:cafe::1" ],
-              "prefixes": [ "2001:db8:2:abcd::/64" ],
-              "hostname": "foo.example.com",
-              "option-data": [ {
-                  "name": "vendor-opts",
-                  "data": "4491"
-              },
-              {
-                  "name": "tftp-servers",
-                  "space": "vendor-4491",
-                  "data": "3000:1::234"
-              } ]
+	  {
+	      "duid": "01:02:03:04:05:06:07:08:09:0A",
+	      "ip-addresses": [ "2001:db8:1:cafe::1" ],
+	      "prefixes": [ "2001:db8:2:abcd::/64" ],
+	      "hostname": "foo.example.com",
+	      "option-data": [ {
+		  "name": "vendor-opts",
+		  "data": "4491"
+	      },
+	      {
+		  "name": "tftp-servers",
+		  "space": "vendor-4491",
+		  "data": "3000:1::234"
+	      } ]
+
+	  },
+// This reservation is using flexible identifier. Instead of relying on specific
+// field, sysadmin can define an expression similar to what is used for client
+// classification, e.g. substring(relay[0].option[17],0,6). Then, based on the
+// value of that expression for incoming packet, the reservation is matched.
+// Expression can be specified either as hex or plain text using single
+// quotes.
+// Note: flexible identifier requires flex_id hook library to be loaded to work.
+	 {
+	     "flex-id": "'somevalue'",
+	     "ip-addresses": [ "2001:db8:1:cafe::2" ]
+	 }
 
 
-          }
       ]
       ]
     }
     }
   ]
   ]
@@ -118,16 +130,16 @@
 # informational level (info, warn, error and fatal) should be logged to stdout.
 # informational level (info, warn, error and fatal) should be logged to stdout.
 "Logging": {
 "Logging": {
     "loggers": [
     "loggers": [
-        {
-            "name": "kea-dhcp6",
-            "output_options": [
-                {
-                    "output": "stdout"
-                }
-            ],
-            "debuglevel": 0,
-            "severity": "INFO"
-        }
+	{
+	    "name": "kea-dhcp6",
+	    "output_options": [
+		{
+		    "output": "stdout"
+		}
+	    ],
+	    "debuglevel": 0,
+	    "severity": "INFO"
+	}
     ]
     ]
 }
 }