multiple-options.json 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. # This is an example configuration file for the DHCPv4 server in Kea.
  2. # It demonstrates simple configuration of the options for a subnet.
  3. { "Dhcp4":
  4. {
  5. # Kea is told to listen on ethX interface only.
  6. "interfaces-config": {
  7. "interfaces": [ "ethX" ]
  8. },
  9. # We need to specify the the database used to store leases. As of
  10. # September 2016, four database backends are supported: MySQL,
  11. # PostgreSQL, Cassandra, and the in-memory database, Memfile.
  12. # We'll use memfile because it doesn't require any prior set up.
  13. "lease-database": {
  14. "type": "memfile"
  15. },
  16. # Addresses will be assigned with a lifetime of 4000 seconds.
  17. "valid-lifetime": 4000,
  18. # Renew and rebind timers are commented out. This implies that options
  19. # 58 and 59 will not be sent to the client. In this case it is up to
  20. # the client to pick the timer values according to RFC2131. Uncomment the
  21. # timers to send these options to the client.
  22. # "renew-timer": 1000,
  23. # "rebind-timer": 2000,
  24. // Defining a subnet. There are 3 DHCP options returned to the
  25. // clients connected to this subnet. The first and third options are
  26. // identified by the name. The third option is identified by the
  27. // option code.
  28. "subnet4": [
  29. {
  30. "pools": [ { "pool": "192.0.2.10 - 192.0.2.200" } ],
  31. "subnet": "192.0.2.0/24",
  32. "interface": "ethX",
  33. "option-data": [
  34. {
  35. "name": "domain-name-servers",
  36. "data": "192.0.2.1, 192.0.2.2"
  37. },
  38. {
  39. "name": "routers",
  40. "data": "192.0.2.1"
  41. },
  42. {
  43. // String options that have a comma in their values need to have
  44. // it escaped (i.e. each comma is predeced by two backslashes). That's
  45. // because commas are reserved for separating fields in compound
  46. // options. At the same time, we need to be conformant with JSON spec,
  47. // that does not allow "\,". Therefore the slightly uncommon double
  48. // backslashes natation is needed.
  49. "name": "boot-file-name",
  50. "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
  51. }
  52. ]
  53. }
  54. ]
  55. },
  56. # The following configures logging. It assumes that messages with at least
  57. # informational level (info, warn, error and fatal) should be logged to stdout.
  58. "Logging": {
  59. "loggers": [
  60. {
  61. "name": "kea-dhcp4",
  62. "output_options": [
  63. {
  64. "output": "stdout"
  65. }
  66. ],
  67. "severity": "INFO"
  68. }
  69. ]
  70. }
  71. }