summaryrefslogtreecommitdiffstats
path: root/doc/examples/kea6/classify.json
blob: a5fc2e98a0166996caab96d63d0d400c89f8eb7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
// This is an example configuration file for the DHCPv6 server in Kea.
// The purpose of this example is to showcase how clients can be classified.

{ "Dhcp6":

{
// Kea is told to listen on eth0 interface only.
  "interfaces-config": {
    "interfaces": [ "eth0" ]
  },

// Let's use the simplest backend: memfile and use some reasonable values
// for timers. They are of no concern for the classification demonstration.
  "lease-database": {
      "type": "memfile",
      "lfc-interval": 3600
  },
  "renew-timer": 1000,
  "rebind-timer": 2000,
  "preferred-lifetime": 3000,
  "valid-lifetime": 4000,

// This list defines several classes that incoming packets can be assigned to.
// One packet can belong to zero or more classes.
  "client-classes": [

// The first class attempts to match all packets coming in on eth0 interface.
  {
      "name": "lab",
      "test": "pkt.iface == 'eth0'",
      "option-data": [{
          "name": "dns-servers",
          "data": "2001:db8::1"
      }]
  },

// Let's classify all incoming RENEW (message type 5) to a separate
// class.
  {
      "name": "renews",
      "test": "pkt6.msgtype == 5"
  },

// Let's pick cable modems. In this simple example we'll assume the device
// is a cable modem if it sends a vendor option with enterprise-id equal
// to 4491.
  {
      "name": "cable-modems",
      "test": "vendor.enterprise == 4491"
  }

  ],


// 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",
        "client-class": "cable-modems",
        "interface": "eth0"
    },

    // The following subnet contains a class reservation for a client using
    // DUID 01:02:03:04:05:0A:0B:0C:0D:0E. This client will always be assigned
    // to this class.
    {
        "pools": [ { "pool": "2001:db8:2::/80" } ],
        "subnet": "2001:db8:2::/64",
        "reservations": [
        {
            "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
            "client-classes": [ "cable-modems" ]
        } ],
        "interface": "eth0"
    },

    // The following subnet contains a pool with a class constraint: only
    // clients which belong to the class are allowed to use this pool.
    {
        "pools": [
           {
               "pool": "2001:db8:4::/80",
               "client-class": "cable-modems"
           } ],
         "subnet": "2001:db8:4::/64",
         "interface": "eth1"
    }

  ],

// The following configures logging. It assumes that messages with at
// least informational level (info, warn, error and fatal) should be
// logged to stdout.
    "loggers": [
        {
            "name": "kea-dhcp6",
            "output_options": [
                {
                    "output": "stdout"
                }
            ],
            "debuglevel": 0,
            "severity": "INFO"
        }
    ]
}

}