classify.json 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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 least
  70. # informational level (info, warn, error and fatal) should be logged to stdout.
  71. "Logging": {
  72. "loggers": [
  73. {
  74. "name": "kea-dhcp6",
  75. "output_options": [
  76. {
  77. "output": "stdout"
  78. }
  79. ],
  80. "debuglevel": 0,
  81. "severity": "INFO"
  82. }
  83. ]
  84. }
  85. }