classify.json 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. {
  52. "pools": [ { "pool": "2001:db8:2::/80" } ],
  53. "subnet": "2001:db8:2::/64",
  54. "interface": "ethX"
  55. }
  56. ]
  57. },
  58. # The following configures logging. Kea will log all debug messages
  59. # to /var/log/kea-debug.log file.
  60. "Logging": {
  61. "loggers": [
  62. {
  63. "name": "kea-dhcp6",
  64. "output_options": [
  65. {
  66. "output": "/var/log/kea-debug.log"
  67. }
  68. ],
  69. "debuglevel": 99,
  70. "severity": "DEBUG"
  71. }
  72. ]
  73. }
  74. }