multiple-options.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. # This is an example configuration file for DHCPv6 server in Kea.
  2. # It demonstrates simple configuration of the options for a subnet.
  3. { "Dhcp6":
  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 preferred and valid lifetimes
  17. # being 3000 and 4000, respectively. Client is told to start
  18. # renewing after 1000 seconds. If the server does not respond
  19. # after 2000 seconds since the lease was granted, client is supposed
  20. # to start REBIND procedure (emergency renewal that allows switching
  21. # to a different server).
  22. "preferred-lifetime": 3000,
  23. "valid-lifetime": 4000,
  24. "renew-timer": 1000,
  25. "rebind-timer": 2000,
  26. # Defining a subnet. There are 3 DHCP options returned to the
  27. # clients connected to this subnet. The first option is identified
  28. # by the name. The second option is identified by the code.
  29. # There are two address pools defined within this subnet. Pool
  30. # specific value for option 12 is defined for the pool:
  31. # 2001:db8:1::1 - 2001:db8:1::100. Clients obtaining an address
  32. # from this pool will be assigned option 12 with a value of
  33. # 3001:cafe::21. Clients belonging to this subnet but obtaining
  34. # addresses from the other pool, or the clients obtaining
  35. # stateless configuration will be assigned subnet specific value
  36. # of option 12, i.e. 2001:db8:1:0:ff00::1.
  37. # For DHCPv6 subnets can have prefix delegation pools too so
  38. # a pd-pools with an option-data is defined too.
  39. "subnet6": [
  40. {
  41. "option-data": [
  42. {
  43. "name": "dns-servers",
  44. "data": "2001:db8:2::45, 2001:db8:2::100"
  45. },
  46. {
  47. "code": 12,
  48. "data": "2001:db8:1:0:ff00::1"
  49. },
  50. {
  51. // String options that have a comma in their values need to have
  52. // it escaped (i.e. each comma is predeced by two backslashes).
  53. // That's because commas are reserved for separating fields in
  54. // compound options. At the same time, we need to be conformant
  55. // with JSON spec, that does not allow "\,". Therefore the
  56. // slightly uncommon double backslashes notation is needed.
  57. "name": "new-posix-timezone",
  58. "data": "EST5EDT4\\,M3.2.0/02:00\\,M11.1.0/02:00"
  59. // Legal JSON escapes are \ followed by "\/bfnrt character
  60. // or \u followed by 4 hexa-decimal numbers (currently Kea
  61. // supports only \u0000 to \u00ff code points).
  62. // CSV processing translates '\\' into '\' and '\,' into ','
  63. // only so for instance '\x' is translated into '\x'. But
  64. // as it works on a JSON string value each of these '\'
  65. // characters must be doubled on JSON input.
  66. }
  67. ],
  68. "pools": [
  69. {
  70. "pool": "2001:db8:1::1 - 2001:db8:1::100",
  71. "option-data": [
  72. {
  73. "code": 12,
  74. "data": "3001:cafe::21"
  75. }
  76. ]
  77. },
  78. {
  79. "pool": "2001:db8:1::500 - 2001:db8:1::1000"
  80. }
  81. ],
  82. "pd-pools": [
  83. {
  84. "prefix": "2001:2b8:2::",
  85. "prefix-len": 56,
  86. "delegated-len": 64,
  87. "option-data": [
  88. {
  89. "code": 12,
  90. "data": "3001:cafe::12:"
  91. }
  92. ]
  93. }
  94. ],
  95. "subnet": "2001:db8:1::/64",
  96. "interface": "ethX"
  97. }
  98. ]
  99. },
  100. # The following configures logging. It assumes that messages with at least
  101. # informational level (info, warn, error and fatal) should be logged to stdout.
  102. "Logging": {
  103. "loggers": [
  104. {
  105. "name": "kea-dhcp6",
  106. "output_options": [
  107. {
  108. "output": "stdout"
  109. }
  110. ],
  111. "debuglevel": 0,
  112. "severity": "INFO"
  113. }
  114. ]
  115. }
  116. }