classify.json 2.5 KB

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