classify.json 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. // This is an example configuration file for the DHCPv4 server in Kea.
  2. // The purpose of this example is to showcase how clients can be classified.
  3. { "Dhcp6":
  4. {
  5. // Kea is told to listen on ethX interface only.
  6. "interfaces-config": {
  7. "interfaces": [ "ethX" ]
  8. },
  9. // Let's use the simplest backend: memfile and use some reasonable values
  10. // for timers. They are of no concern for the classification demonstration.
  11. "lease-database": {
  12. "type": "memfile",
  13. "lfc-interval": 3600
  14. },
  15. "renew-timer": 1000,
  16. "rebind-timer": 2000,
  17. "preferred-lifetime": 3000,
  18. "valid-lifetime": 4000,
  19. // This list defines several classes that incoming packets can be assigned to.
  20. // One packet can belong to zero or more classes.
  21. "client-classes": [
  22. // The first class attempts to match all packets coming in on ethX interface.
  23. {
  24. "name": "lab",
  25. "test": "pkt.iface == 'ethX'",
  26. "option-data": [{
  27. "name": "dns-servers",
  28. "data": "2001:db8::1"
  29. }]
  30. },
  31. // Let's classify all incoming RENEW (message type 5) to a separate
  32. // class.
  33. {
  34. "name": "renews",
  35. "test": "pkt6.msgtype == 5"
  36. },
  37. // Let's pick cable modems. In this simple example we'll assume the device
  38. // is a cable modem if it sends a vendor option with enterprise-id equal
  39. // to 4491.
  40. {
  41. "name": "cable-modems",
  42. "test": "vendor.enterprise == 4491"
  43. }
  44. ],
  45. // The following list defines subnets. Each subnet consists of at
  46. // least subnet and pool entries.
  47. "subnet6": [
  48. {
  49. "pools": [ { "pool": "2001:db8:1::/80" } ],
  50. "subnet": "2001:db8:1::/64",
  51. "client-class": "cable-modems",
  52. "interface": "ethX"
  53. },
  54. // The following subnet contains a class reservation for a client using
  55. // DUID 01:02:03:04:05:0A:0B:0C:0D:0E. This client will always be assigned
  56. // to this class.
  57. {
  58. "pools": [ { "pool": "2001:db8:2::/80" } ],
  59. "subnet": "2001:db8:2::/64",
  60. "reservations": [
  61. {
  62. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  63. "client-classes": [ "cable-modems" ]
  64. } ],
  65. "interface": "ethX"
  66. }
  67. ]
  68. },
  69. // The following configures logging. It assumes that messages with at
  70. // least informational level (info, warn, error and fatal) should be
  71. // logged to stdout.
  72. "Logging": {
  73. "loggers": [
  74. {
  75. "name": "kea-dhcp6",
  76. "output_options": [
  77. {
  78. "output": "stdout"
  79. }
  80. ],
  81. "debuglevel": 0,
  82. "severity": "INFO"
  83. }
  84. ]
  85. }
  86. }