multiple-options.json 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 2 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. "subnet6": [
  38. {
  39. // This is how option values are defined for this particular subnet.
  40. "option-data": [
  41. // When specifying options, you typically need to specify
  42. // one of (name or code) and data. The full option specification
  43. // covers name, code, space, csv-format and data.
  44. // space defaults to "dhcp6" which is usually correct, unless you
  45. // use encapsulate options. csv-format defaults to "true", so
  46. // this is also correct, unless you want to specify the whole
  47. // option value as long hex string. For example, to specify
  48. // domain-name-servers you could do this:
  49. // {
  50. // "name": "dns-servers",
  51. // "code": 23,
  52. // "csv-format": "true",
  53. // "space": "dhcp6",
  54. // "data": "2001:db8:2::45, 2001:db8:2::100"
  55. // }
  56. // but it's a lot of writing, so it's easier to do this instead:
  57. {
  58. "name": "dns-servers",
  59. "data": "2001:db8:2::45, 2001:db8:2::100"
  60. },
  61. // Typically people prefer to refer to options by their names, so they
  62. // don't need to remember the code names. However, some people like
  63. // to use numerical values. For example, DHCPv6 can optionally use
  64. // server unicast communication, if extra option is present. Option
  65. // "unicast" uses option code 12, so you can reference to it either
  66. // by "name": "unicast" or "code": 12.
  67. {
  68. "code": 12,
  69. "data": "2001:db8:1:0:ff00::1"
  70. }
  71. ],
  72. "pools": [
  73. {
  74. "pool": "2001:db8:1::1 - 2001:db8:1::100",
  75. "option-data": [
  76. {
  77. "code": 12,
  78. "data": "3001:cafe::21"
  79. }
  80. ]
  81. },
  82. {
  83. "pool": "2001:db8:1::500 - 2001:db8:1::1000"
  84. }
  85. ],
  86. "subnet": "2001:db8:1::/64",
  87. "interface": "ethX"
  88. }
  89. ]
  90. },
  91. // The following configures logging. It assumes that messages with at least
  92. // informational level (info, warn, error and fatal) should be logged to stdout.
  93. "Logging": {
  94. "loggers": [
  95. {
  96. "name": "kea-dhcp6",
  97. "output_options": [
  98. {
  99. "output": "stdout"
  100. }
  101. ],
  102. "debuglevel": 0,
  103. "severity": "INFO"
  104. }
  105. ]
  106. }
  107. }