config.xml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
  3. "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
  4. <!ENTITY mdash "&#x2014;" >
  5. ]>
  6. <chapter id="kea-config">
  7. <title>Kea configuration</title>
  8. <para>Depending on configuration backend chosen (see <xref
  9. linkend="dhcp-config-backend"/>), configuration mechanisms are different. The
  10. following sections describe details of specific configuration backends. Note
  11. that only one configuration backend can be used and its selection is
  12. determined during compilation time.</para>
  13. <section id="bundy-backend">
  14. <title>Bundy configuration backend</title>
  15. <para>This legacy configuration backend allows Kea to use former BIND10
  16. framework. That framework and this Kea configuration backend is no longer
  17. supported by ISC. It is currently developed as part of Bundy project (see
  18. <ulink url="http://bundy-dns.de">Bundy homepage</ulink>). See Bundy project
  19. documentation regarding configuration.</para>
  20. </section>
  21. <section id="json-backend">
  22. <title>JSON configuration backend</title>
  23. <para>JSON is the default configuration backend and the only one supported
  24. as of 0.9 release. It assumes that the servers are started from command line
  25. (either directly or using a script, see TODO for details). JSON backend uses
  26. certain signals to influence certain behaviors. The configuration file is
  27. specified upon startup using -c parameter.</para>
  28. <section id="json-format">
  29. <title>JSON syntax</title>
  30. <para>Configuration files for DHCPv4, DHCPv6 and DDNS modules are defined
  31. in extended JSON format. The basic JSON is defined in <ulink
  32. url="http://tools.ietf.org/html/rfc4627">RFC 4627</ulink>. Kea components
  33. use extended JSON, which extends basic format by allowing bash-style
  34. comments in the file. Comment lines must have hash (#) in the first
  35. column.</para>
  36. <para>Configuration file consists of a single object (often colloquially
  37. called a map) started with a curly bracket. It consists "Dhcp4", "Dhcp6",
  38. "DhcpDdns" and/or "Logging" objects. It is possible to define additional
  39. elements, but they will be ignored. That principle was chosen to ease
  40. configuration management. For example, it is possible to define Dhcp4,
  41. Dhcp6 and Logging elements in one configuration file that can be used to
  42. start both DHCPv4 and DHCPv6 components. When starting, DHCPv4 component
  43. will use Dhcp4 object to configure itself and Logging to configure logging
  44. parameters, while ignoring Dhcp6 object.</para>
  45. <para>For example, a very simple configuration for both DHCPv4 and DHCPv6
  46. could look like this:
  47. <screen>
  48. # The whole configuration starts here.
  49. {
  50. # DHCPv4 specific configuration starts here.
  51. "Dhcp4": {
  52. "interfaces": [ "eth0" ],
  53. "valid-lifetime": 4000,
  54. "renew-timer": 1000,
  55. "rebind-timer": 2000,
  56. "subnet4": [{
  57. "pool": "192.0.2.1-192.0.2.200",
  58. "subnet": "192.0.2.0/24"
  59. }],
  60. ...
  61. },
  62. # DHCPv4 specific configuration ends here.
  63. # DHCPv6 specific configuration starts here.
  64. "Dhcp6": {
  65. "interfaces": [ "eth1" ],
  66. "preferred-lifetime": 3000,
  67. "valid-lifetime": 4000,
  68. "renew-timer": 1000,
  69. "rebind-timer": 2000,
  70. "subnet6": [{
  71. "pool": "2001:db8::/80",
  72. "subnet": "2001:db8::/64"
  73. }],
  74. ...
  75. },
  76. # DHCPv6 specific configuration ends here.
  77. # Logger parameters (that could be shared among several components) start here.
  78. # That section can be used by both DHCPv4 and DHCPv6 servers.
  79. "Logging": {
  80. "loggers": [{
  81. "name": "*",
  82. "severity": "DEBUG"
  83. }],
  84. ...
  85. }
  86. # Logger parameters end here.
  87. # The whole configuration structure ends here.
  88. }
  89. </screen>
  90. </para>
  91. <para>More examples are available in the Kea source code in the
  92. <filename>doc/examples</filename> directory.</para>
  93. <para>To avoid repetition of mostly similar structures, specific
  94. examples will showcase only subset of parameters appropriate for a given
  95. context. For example, when discussing IPv6 subnets configuration in
  96. DHCPv6, only subnet6 parameters will be mentioned. It is implied that
  97. remaining elements (global that holds Dhcp6, Logging and possibly
  98. DhcpDdns) are present, but are omitted for clarity. Usually, locations
  99. where extra parameters may appear are denoted with ellipsis (triple
  100. dot).</para>
  101. </section>
  102. <section>
  103. <title>Simplified notation</title>
  104. <para>It is sometimes convenient to refer to specific element in the
  105. configuration hierarchy. Each hierarchy level is separated by a slash.
  106. If there is an array, specific instance within that array is referred by
  107. a number in square brackets. For example, in the above configuration the
  108. valid-lifetime in Dhcp6 component can be referred to as
  109. Dhcp6/valid-lifetime, first interface for the DHCPv4 server as
  110. Dhcp4/interfaces[0] and the pool in the first IPv6 defined in DHCPv6
  111. configuration as Dhcp6/subnet6[0]/pool.</para>
  112. <!-- @todo Add a reference here after #3422 is done -->
  113. </section>
  114. </section>
  115. </chapter>