{
  # Server configuration file example for DHCPv6
  # From the file used for TAHI tests - addresses chosen
  # to match TAHI rather than example block.
  # IPv6 address valid lifetime
  #  (at the end the address is no longer usable by the client)
  #  (set to 30 days, the usual IPv6 default)
  /// This configuration declares some subnets but has no interfaces-config
  /// Reference Kea #245
  "Dhcp6": {
 // Add names of your network interfaces to listen on.
    "interfaces-config": {
        // You typically want to put specific interface names here, e.g. eth0
        // but you can also specify unicast addresses (e.g. eth0/2001:db8::1) if
        // you want your server to handle unicast traffic in addition to
        // multicast. (DHCPv6 is a multicast based protocol).
        "interfaces": ["enp0s25/fd00::2"],
        "re-detect": false
    },

    // Kea supports control channel, which is a way to receive management commands
    // while the server is running. This is a Unix domain socket that receives
    // commands formatted in JSON, e.g. config-set (which sets new configuration),
    // config-reload (which tells Kea to reload its configuration from file),
    // statistic-get (to retrieve statistics) and many more. For detailed
    // description, see Sections 9.12, 16 and 15.
    "control-socket": {
        "socket-type": "unix",
        "socket-name": "/tmp/kea6-ctrl-socket"
       // "socket-type": "udp"
    },

     "dhcp-ddns": {
        // Connectivity parameters
        "enable-updates": true,
         "server-ip": "127.0.0.1",
         "server-port":53001,
         "sender-ip": "",
         "sender-port":0,
         "max-queue-size":1024,
         "ncr-protocol":"UDP",
         "ncr-format":"JSON"
     },

     // Behavioral parameters (global)
     "ddns-send-updates": true,
     "ddns-override-no-update": false,
     "ddns-override-client-update": true,
     "ddns-replace-client-name": "never",
     "ddns-generated-prefix": "myhost",
     "ddns-qualifying-suffix": "",
     "ddns-update-on-renew": false,
     "ddns-use-conflict-resolution": true,
     "hostname-char-set": "",
     "hostname-char-replacement": "",
     "dhcp4o6-port": 6767,
//     "hosts-database": {
//         "type": "mysql",
//         "name": "kea",
//         "user": "kea",
//         "password": "kea",
//         "host": "localhost",
//         "port": 3306
//     },
// Use Memfile lease database backend to store leases in a CSV file.
    // Depending on how Kea was compiled, it may also support SQL databases
    // (MySQL and/or PostgreSQL) and even Cassandra. Those database backends
    // require more parameters, like name, host and possibly user and password.
    // There are dedicated examples for each backend. See Section 8.2.2 "Lease
    // Storage" for details.
    "lease-database": {
        // Memfile is the simplest and easiest backend to use. It's an in-memory
        // C++ database that stores its state in CSV file.
        "type": "memfile",
        "persist": true,
        "lfc-interval": 1800,
        "name": "/var/lib/kea/dhcp6.leases",
        "max-row-errors": 100
    },

//    "server-id": {
//        "type": "LLT",
//        "htype": 0,
//        "identifier": "",
//        "time": 2518920166
//    },
 
   "valid-lifetime": 4000,
    "renew-timer": 1000,
    "rebind-timer": 2000,
    "preferred-lifetime": 3000,

    
     "dhcp-queue-control": {
       "enable-queue": true,
       "queue-type": "kea-ring6",
       "capacity" : 300
    },

    "option-data": [
      # T1, the delay before Renew
      #  (default is 1/2 preferred lifetime)
      #  (set to 1 hour)
      # T2, the delay before Rebind (if Renews failed)
      #  (default is 3/4 preferred lifetime)
      #  (set to 2 hours)
      # Global definitions for name server address(es) and domain search list
      {
        "space": "dhcp6",
        "name": "dns-servers",
        "code": 23,
//      "original-data": "fd00:0000:0000:0000::2, fd00:0000:0000:0000::ef",
        "data": "fd00::2, fd00::ef"
      },
      {
        "space": "dhcp6",
        "name": "domain-search",
        "code": 24,
//      "original-data": "\"ajlouni-homeserver.ddnsfree.com\"",
        "data": "ajlouni-homeserver.ddnsfree.com"
      },
     // but it's a lot of writing, so it's easier to do this instead:
        {
            "name": "dns-servers",
            "data": "fd00:0000:0000:0000::2, fd00:0000:0000:0000::ef"
      },
       {
            "code": 17,
            "data": "12345"
        },
          {
           "name": "dns-servers",
           "data": "fd00::2, fd00::ef",
           "always-send": true
        },
  
        {
            "name": "unicast",
            "data": "fd00::2"
        },

        {
           "name": "new-posix-timezone",
           "data": "EST3EDT2\\,M3.2.0/02:00\\,M11.1.0/02:00"
        },

         {
            "name": "subscriber-id",
            "code": 38,
            "space": "dhcp6",
            "csv-format": false,
            "data": "'convert this text to binary'"
        },
       // Typically people prefer to refer to options by their names, so they
        // don't need to remember the code names. However, some people like
        // to use numerical values. For example, DHCPv6 can optionally use
        // server unicast communication, if extra option is present. Option
        // "unicast" uses option code 12, so you can reference to it either
        // by "name": "unicast" or "code": 12. If you enable this option,
        // you really should also tell the server to listen on that address
        // (see interfaces-config/interfaces list above).
        {
            "code": 12,
           "data": "fd00::2"
      },
      # Set preference to 255 (maximum) in order to avoid waiting for
      # additional servers when there is only one
      #option dhcp6.preference 255;
      # Server side command to enable rapid-commit (2 packet exchange)
      #option dhcp6.rapid-commit;
      # The delay before information-request refresh
      #  (minimum is 10 minutes, maximum one day, default is to not refresh)
      #  (set to 6 hours)
      {
        "space": "dhcp6",
        "name": "information-refresh-time",
        "code": 32,
        "data": "21600"
    }
    ],
//  # Enable RFC 5007 support (same than for DHCPv4)
//  "statement": {
//    "config": {
//      "value": "allow",
//      "name": "leasequery",
//      "code": 49
//    }
//  },

    "subnet6": [
      # Static definition (must be global)
      #host myclient {
      #	# The entry is looked up by this
      #	host-identifier option
      #		dhcp6.client-id 00:01:00:01:00:04:93:e0:00:00:00:00:a2:a2;
      #
      #	# A fixed address
      #	fixed-address6 3ffe:501:ffff:100::1234;
      #
      #	# A fixed prefix
      #	fixed-prefix6 3ffe:501:ffff:101::/64;
      #
      #	# Override of the global definitions,
      #	# works only when a resource (address or prefix) is assigned
      #	option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:4f4e;
      #
      #	# For debug (to see when the entry statements are executed)
      #	#  (log "sol" when a matching Solicitation is received)
      #	##if packet(0,1) = 1 { log(debug,"sol"); }
      #}
      #
      #host otherclient {
      #        # This host entry is hopefully matched if the client supplies a DUID-LL
      #        # or DUID-LLT containing this MAC address.
      #        hardware ethernet 01:00:80:a2:55:67;
      #
      #        fixed-address6 3ffe:501:ffff:100::4321;
      #}
      # The subnet where the server is attached
      #  (i.e., the server has an address in this subnet)
      {
        "id": 1,
        "subnet": "fd00:0000:0000:0000::/64",
        "interface":"enp0s25",
        "rapid-commit": true,
        "pools": [
          {
            "pool": "fd00:0000:0000:0000::3-fd00:0000:0000:0000::ffff"
            }
        ],

        "option-data": [ {
        "name": "dhcp4o6-server-addr",
        "code": 88,
        "space": "dhcp6",
        "csv-format": true,
        "data": "fd00:0000:0000:0000::"
    } ], 
      
        "client-class": "VENDOR_CLASS_eRouter1.0",
        "relay": {
                "ip-addresses": [ "fd00:0000:0000:0000::ef" ]
        },

        "pd-pools": [
        {
          "prefix": "fd00:0000:0000:1000::",
          "prefix-len": 64,
          "delegated-len": 64,


          "user-context": {
                "threshold-percent": 85,
                "v4-network": "192.168.0.0/16",
                "v4-overflow": "10.0.0.0/16",
                "lw4over6-sharing-ratio": 64,
                "lw4over6-v4-pool": "192.168.1./24",
                "lw4over6-sysports-exclude": true,
                "lw4over6-bind-prefix-len": 64
        }

       // "option-data": [
      //    {
        //    "space": "dhcp6",
      //      "name": "dns-servers",
       //     "code": 23,
      //    "original-data": "fd00:0000:0000:0000::2, fd00:0000:0000:0000::ef",
      //      "data": "fd00::2, fd00::ef"
      //    },
      //    {
      //      "space": "dhcp6",
      //      "name": "domain-search",
      //      "code": 24,
      //    "original-data": "\"ajlouni-homeserver.ddnsfree.com\"",
      //      "data": "ajlouni-homeserver.ddnsfree.com"
}  
]

}]}}
