advanced.json 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. // This is an example configuration file for DHCPv6 server in Kea.
  2. // It attempts to showcase some of the more advanced features.
  3. // Topology wise, it's a basic scenario with one IPv6 subnet configured.
  4. // It is assumed that one subnet (2001:db8:1::/64) is available directly
  5. // over ethX interface.
  6. //
  7. // The following features are currently showcased here:
  8. // 1. Configuration of MAC/hardware address sources in DHCPv6
  9. // 2. RSOO (Relay supplied options) - Some relays may insert options with the
  10. // intention for the server to insert them into client directed messages.
  11. // 3. Control socket. Kea can open a socket and listen for incoming
  12. // commands.
  13. { "Dhcp6":
  14. {
  15. // Kea is told to listen on ethX network interface only.
  16. "interfaces-config": {
  17. "interfaces": [ "ethX" ],
  18. // This makes interfaces to be re-detected at each (re-)configuration.
  19. // By default it is true.
  20. "re-detect": true
  21. },
  22. // We need to specify the the database used to store leases. As of
  23. // September 2016, four database backends are supported: MySQL,
  24. // PostgreSQL, Cassandra, and the in-memory database, Memfile.
  25. // We will use memfile because it doesn't require any prior set up.
  26. "lease-database": {
  27. "type": "memfile",
  28. "lfc-interval": 3600
  29. },
  30. // Kea 0.9.1 introduced MAC/hardware addresses support in DHCPv6. There is
  31. // no single reliable method of getting MAC address information in DHCPv6.
  32. // Kea supports several methods. Depending on your network set up, some
  33. // methods may be more preferable than others, hence the configuration
  34. // parameter. 'mac-sources' is a list of methods. Allowed parameters are:
  35. // any, raw, duid, ipv6-link-local, client-link-addr-option, rfc6939 (which
  36. // is an alias for client-link-addr-option), remote-id, rfc4649 (which is an
  37. // alias for remote-id, subscriber-id, rfc4580 (which is an alias for
  38. // subscriber-id) and docsis.
  39. //
  40. // Note that the order matters. Methods are attempted one by one in the order
  41. // specified until hardware address is obtained. If you don't care which method
  42. // is used, using 'any' is marginally faster than enumerating them all.
  43. //
  44. // If mac-sources are not specified, a default value of 'any' is used.
  45. "mac-sources": [ "client-link-addr-option", "duid", "ipv6-link-local" ],
  46. // RFC6422 defines a mechanism called relay-supplied options option. The relay
  47. // agent may insert certain options that the server will echo back to the
  48. // client, if certain criteria are met. One condition is that the option must
  49. // be RSOO-enabled (i.e. allowed to be echoed back). IANA maintains a list
  50. // of those options here:
  51. // http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#options-relay-supplied
  52. // However, it is possible to allow the server to echo back additional options.
  53. // This entry marks options 110, 120 and 130 as RSOO-enabled.
  54. "relay-supplied-options": [ "110", "120", "130" ],
  55. // This defines a control socket. If defined, Kea will open a UNIX socket
  56. // and will listen for incoming commands. See section 15 of the Kea User's
  57. // Guide for list of supported commands.
  58. "control-socket": {
  59. "socket-type": "unix",
  60. "socket-name": "/tmp/kea6-ctrl-socket"
  61. },
  62. // Addresses will be assigned with preferred and valid lifetimes
  63. // being 3000 and 4000, respectively. Client is told to start
  64. // renewing after 1000 seconds. If the server does not respond
  65. // after 2000 seconds since the lease was granted, client is supposed
  66. // to start REBIND procedure (emergency renewal that allows switching
  67. // to a different server).
  68. "preferred-lifetime": 3000,
  69. "valid-lifetime": 4000,
  70. "renew-timer": 1000,
  71. "rebind-timer": 2000,
  72. // The following list defines subnets. Each subnet consists of at
  73. // least subnet and pool entries. Note the user-context being
  74. // used throughout the definitions. This is something that is not
  75. // being used by Kea, it's simply parsed and stored in appropriate
  76. // structures. You can put anything you want in the user-context
  77. // as long as it is a valid JSON.
  78. "subnet6": [
  79. {
  80. "pools": [
  81. {
  82. "pool": "2001:db8:1::/80",
  83. // This is user context specified for this particular
  84. // pool. You can use it to describe the pool in some way.
  85. // Just keep in mind that the structure will not be used
  86. // by Kea itself. It will be made available to hooks if
  87. // they want to use it.
  88. "user-context": { "department": "engineering" }
  89. }],
  90. // Here's the user-context for the whole subnet.
  91. "user-context": { "comment": "Floor one, west wing" },
  92. // This defines PD (prefix delegation) pools. In this case
  93. // we have only one pool. That consists of /64 prefixes
  94. // being delegated out of large /48 pool. Each delegated
  95. // prefix will contain an excluded-prefix option.
  96. "pd-pools": [
  97. {
  98. "prefix": "2001:db8:abcd::",
  99. "prefix-len": 48,
  100. "delegated-len": 64,
  101. "excluded-prefix": "2001:db8:abcd:1234::",
  102. "excluded-prefix-len": 62,
  103. // Another user-context for this PD pool. Again, you can put anything
  104. // you want in there as long as it's valid JSON.
  105. "user-context": {
  106. "purpose": "For CPE devices"
  107. }
  108. }
  109. ],
  110. "subnet": "2001:db8:1::/64",
  111. "interface": "ethX",
  112. // Sometimes the relay may use an odd IPv6 address that's not matching
  113. // the subnet. This is discouraged, but there are valid cases when it
  114. // makes sense. One case is when the relay has only link-local address
  115. // and another is when there is a shared subnet scenario.
  116. "relay": {
  117. "ip-address": "3000::1"
  118. }
  119. }
  120. ]
  121. },
  122. // The following configures logging. It assumes that messages with at
  123. // least informational level (info, warn, error and fatal) should be
  124. // logged to stdout.
  125. "Logging": {
  126. "loggers": [
  127. {
  128. "name": "kea-dhcp6",
  129. "output_options": [
  130. {
  131. "output": "stdout",
  132. // Several additional parameters are possible in addition
  133. // to the typical output. Flush determines whether logger
  134. // flushes output to a file. Maxsize determines maximum
  135. // filesize before the file is being rotated. maxver
  136. // specifies the maximum number of rotated files being
  137. // kept.
  138. "flush": true,
  139. "maxsize": 204800,
  140. "maxver": 4
  141. }
  142. ],
  143. "debuglevel": 0,
  144. "severity": "INFO"
  145. }
  146. ]
  147. }
  148. }