advanced.json 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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
  41. // order specified until hardware address is obtained. If you don't care
  42. // which method is used, using 'any' is marginally faster than enumerating
  43. // them all.
  44. //
  45. // If mac-sources are not specified, a default value of 'any' is used.
  46. "mac-sources": [ "client-link-addr-option", "duid", "ipv6-link-local" ],
  47. // RFC6422 defines a mechanism called relay-supplied options option. The
  48. // relay agent may insert certain options that the server will echo back to
  49. // the client, if certain criteria are met. One condition is that the option
  50. // must be RSOO-enabled (i.e. allowed to be echoed back). IANA maintains a
  51. // list of those options here:
  52. // http://www.iana.org/assignments/dhcpv6-parameters/dhcpv6-parameters.xhtml#options-relay-supplied
  53. // However, it is possible to allow the server to echo back additional
  54. // options. This entry marks options 110, 120 and 130 as RSOO-enabled.
  55. "relay-supplied-options": [ "110", "120", "130" ],
  56. // This defines a control socket. If defined, Kea will open a UNIX socket
  57. // and will listen for incoming commands. See section 15 of the Kea User's
  58. // Guide for list of supported commands.
  59. "control-socket": {
  60. "socket-type": "unix",
  61. "socket-name": "/tmp/kea6-ctrl-socket"
  62. },
  63. // Addresses will be assigned with preferred and valid lifetimes
  64. // being 3000 and 4000, respectively. Client is told to start
  65. // renewing after 1000 seconds. If the server does not respond
  66. // after 2000 seconds since the lease was granted, client is supposed
  67. // to start REBIND procedure (emergency renewal that allows switching
  68. // to a different server).
  69. "preferred-lifetime": 3000,
  70. "valid-lifetime": 4000,
  71. "renew-timer": 1000,
  72. "rebind-timer": 2000,
  73. // The following list defines subnets. Each subnet consists of at
  74. // least subnet and pool entries. Note the user-context being
  75. // used throughout the definitions. This is something that is not
  76. // being used by Kea, it's simply parsed and stored in appropriate
  77. // structures. You can put anything you want in the user-context
  78. // as long as it is a valid JSON and it starts with a map (i.e.
  79. // is enclosed by curly brackets).
  80. "subnet6": [
  81. {
  82. "pools": [
  83. {
  84. "pool": "2001:db8:1::/80",
  85. // This is user context specified for this particular
  86. // pool. You can use it to describe the pool in some way.
  87. // Just keep in mind that the structure will not be used
  88. // by Kea itself. It will be made available to hooks if
  89. // they want to use it.
  90. "user-context": { "department": "engineering" }
  91. }],
  92. // Here's the user-context for the whole subnet.
  93. "user-context": { "comment": "Floor one, west wing" },
  94. // This defines PD (prefix delegation) pools. In this case
  95. // we have only one pool. That consists of /64 prefixes
  96. // being delegated out of large /48 pool. Each delegated
  97. // prefix will contain an excluded-prefix option.
  98. "pd-pools": [
  99. {
  100. "prefix": "2001:db8:abcd::",
  101. "prefix-len": 48,
  102. "delegated-len": 64,
  103. "excluded-prefix": "2001:db8:abcd:1234::",
  104. "excluded-prefix-len": 62,
  105. // Another user-context for this PD pool. Again, you can put
  106. // anything you want in there as long as it's valid JSON and
  107. // starts with a map.
  108. "user-context": {
  109. "purpose": "For CPE devices"
  110. }
  111. }
  112. ], // end of pools
  113. "subnet": "2001:db8:1::/64",
  114. "interface": "ethX",
  115. // Sometimes the relay may use an odd IPv6 address that's not matching
  116. // the subnet. This is discouraged, but there are valid cases when it
  117. // makes sense. One case is when the relay has only link-local address
  118. // and another is when there is a shared subnet scenario.
  119. "relay": {
  120. "ip-address": "3000::1"
  121. }
  122. }
  123. ]
  124. },
  125. // The following configures logging. It assumes that messages with at
  126. // least informational level (info, warn, error and fatal) should be
  127. // logged to stdout.
  128. "Logging": {
  129. "loggers": [
  130. {
  131. "name": "kea-dhcp6",
  132. "output_options": [
  133. {
  134. "output": "stdout",
  135. // Several additional parameters are possible in addition
  136. // to the typical output. Flush determines whether logger
  137. // flushes output to a file. Maxsize determines maximum
  138. // filesize before the file is being rotated. maxver
  139. // specifies the maximum number of rotated files being
  140. // kept.
  141. "flush": true,
  142. "maxsize": 204800,
  143. "maxver": 4
  144. }
  145. ],
  146. "debuglevel": 0,
  147. "severity": "INFO"
  148. }
  149. ]
  150. }
  151. }