multiple-options.json 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  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. // A few options are encoded in (length, string) tuples
  69. // which can be defined using only strings as the CSV
  70. // processing computes lengths.
  71. "name": "bootfile-param",
  72. "data": "root=/dev/sda2, quiet, splash"
  73. }
  74. ],
  75. "pools": [
  76. {
  77. "pool": "2001:db8:1::1 - 2001:db8:1::100",
  78. "option-data": [
  79. {
  80. "code": 12,
  81. "data": "3001:cafe::21"
  82. }
  83. ]
  84. },
  85. {
  86. "pool": "2001:db8:1::500 - 2001:db8:1::1000"
  87. }
  88. ],
  89. "pd-pools": [
  90. {
  91. "prefix": "2001:2b8:2::",
  92. "prefix-len": 56,
  93. "delegated-len": 64,
  94. "option-data": [
  95. {
  96. "code": 12,
  97. "data": "3001:cafe::12:"
  98. }
  99. ]
  100. }
  101. ],
  102. "subnet": "2001:db8:1::/64",
  103. "interface": "ethX"
  104. }
  105. ]
  106. },
  107. # The following configures logging. It assumes that messages with at least
  108. # informational level (info, warn, error and fatal) should be logged to stdout.
  109. "Logging": {
  110. "loggers": [
  111. {
  112. "name": "kea-dhcp6",
  113. "output_options": [
  114. {
  115. "output": "stdout"
  116. }
  117. ],
  118. "debuglevel": 0,
  119. "severity": "INFO"
  120. }
  121. ]
  122. }
  123. }