config.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  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>The following section describe details of the only configuration
  9. backend which can be configured and used.</para>
  10. <section id="json-backend">
  11. <title>JSON configuration backend</title>
  12. <para>JSON is the default configuration backend.
  13. It assumes that the servers are started from the command line
  14. (either directly or using a script, e.g. <filename>keactrl</filename>).
  15. The JSON backend uses certain signals to influence Kea. The
  16. configuration file is specified upon startup using the -c parameter.</para>
  17. <section id="json-format">
  18. <title>JSON syntax</title>
  19. <para>Configuration files for DHCPv4, DHCPv6 and DDNS modules are defined
  20. in an extended JSON format. Basic JSON is defined in <ulink
  21. url="http://tools.ietf.org/html/rfc4627">RFC 4627</ulink>. Kea components
  22. use a slightly modified JSON, in that they allow shell-style
  23. comments in the file: lines with the hash (#) character in the first column
  24. are comment lines and are ignored.</para>
  25. <para>The configuration file consists of a single object (often colloquially
  26. called a map) started with a curly bracket. It comprises the "Dhcp4", "Dhcp6",
  27. "DhcpDdns" and/or "Logging" objects. It is possible to define additional
  28. elements, but they will be ignored. For example, it is possible to define
  29. Dhcp4, Dhcp6 and Logging elements in a single configuration file that can
  30. be used to start both the DHCPv4 and DHCPv6 components. When starting,
  31. the DHCPv4 component will use Dhcp4 object to configure itself and the
  32. Logging object to configure logging parameters; it will ignore the Dhcp6
  33. object.</para>
  34. <para>For example, a very simple configuration for both DHCPv4 and DHCPv6
  35. could look like this:
  36. <screen>
  37. # The whole configuration starts here.
  38. {
  39. # DHCPv4 specific configuration starts here.
  40. "Dhcp4": {
  41. "interfaces-config": {
  42. "interfaces": [ "eth0" ],
  43. "dhcp-socket-type": "raw"
  44. },
  45. "valid-lifetime": 4000,
  46. "renew-timer": 1000,
  47. "rebind-timer": 2000,
  48. "subnet4": [{
  49. "pools": [ { "pool": "192.0.2.1-192.0.2.200" } ],
  50. "subnet": "192.0.2.0/24"
  51. }],
  52. ...
  53. },
  54. # DHCPv4 specific configuration ends here.
  55. # DHCPv6 specific configuration starts here.
  56. "Dhcp6": {
  57. "interfaces-config": {
  58. "interfaces": [ "eth1" ]
  59. },
  60. "preferred-lifetime": 3000,
  61. "valid-lifetime": 4000,
  62. "renew-timer": 1000,
  63. "rebind-timer": 2000,
  64. "subnet6": [{
  65. "pools": [ { "pool": "2001:db8::/80" } ],
  66. "subnet": "2001:db8::/64"
  67. }],
  68. ...
  69. },
  70. # DHCPv6 specific configuration ends here.
  71. # Logger parameters (that could be shared among several components) start here.
  72. # This section is used by both the DHCPv4 and DHCPv6 servers.
  73. "Logging": {
  74. "loggers": [{
  75. "name": "*",
  76. "severity": "DEBUG"
  77. }],
  78. ...
  79. }
  80. # Logger parameters end here.
  81. # The whole configuration structure ends here.
  82. }
  83. </screen>
  84. </para>
  85. <para>More examples are available in the installed
  86. <filename>share/doc/kea/examples</filename> directory.</para>
  87. <para>To avoid repetition of mostly similar structures, examples in the
  88. rest of this guide will showcase only the subset of parameters appropriate for a given
  89. context. For example, when discussing the IPv6 subnets configuration in
  90. DHCPv6, only subnet6 parameters will be mentioned. It is implied that
  91. the remaining elements (the global map that holds Dhcp6, Logging and possibly
  92. DhcpDdns) are present, but they are omitted for clarity. Usually, locations
  93. where extra parameters may appear are denoted with an ellipsis.</para>
  94. </section>
  95. <section>
  96. <title>Simplified Notation</title>
  97. <para>It is sometimes convenient to refer to a specific element in the
  98. configuration hierarchy. Each hierarchy level is separated by a slash.
  99. If there is an array, a specific instance within that array is referenced by
  100. a number in square brackets (with numbering starting at zero). For example, in the above configuration the
  101. valid-lifetime in the Dhcp6 component can be referred to as
  102. Dhcp6/valid-lifetime and the pool in the first subnet defined in the DHCPv6
  103. configuration as Dhcp6/subnet6[0]/pool.</para>
  104. <!-- @todo Add a reference here after #3422 is done -->
  105. </section>
  106. </section>
  107. </chapter>