reservations.json 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. // This is an example configuration file for DHCPv6 server in Kea
  2. // that showcases how to do host reservations. It is
  3. // assumed that one subnet (2001:db8:1::/64) is available directly
  4. // over ethX interface. A number of hosts have various combinations
  5. // of addresses and prefixes reserved for them.
  6. { "Dhcp6":
  7. {
  8. // Kea is told to listen on ethX interface only.
  9. "interfaces-config": {
  10. "interfaces": [ "ethX" ]
  11. },
  12. // We need to specify the the database used to store leases. As of
  13. // September 2016, four database backends are supported: MySQL,
  14. // PostgreSQL, Cassandra, and the in-memory database, Memfile.
  15. // We'll use memfile because it doesn't require any prior set up.
  16. "lease-database": {
  17. "type": "memfile",
  18. "lfc-interval": 3600
  19. },
  20. // This is pretty basic stuff, it has nothing to do with reservations.
  21. "preferred-lifetime": 3000,
  22. "valid-lifetime": 4000,
  23. "renew-timer": 1000,
  24. "rebind-timer": 2000,
  25. // Kea supports two types of identifiers in DHCPv6: hw-address
  26. // (hardware/MAC address of the client) and duid (DUID inserted by the
  27. // client). When told to do so, Kea can check for each of these
  28. // identifier types, but it takes a costly database lookup to do so. It
  29. // is therefore useful from a performance perspective to use only the
  30. // reservation types that are actually used in a given network.
  31. "host-reservation-identifiers": [ "duid", "hw-address" ],
  32. // The following list defines subnets. Subnet, pools and interface definitions
  33. // are the same as in the regular scenario, without host reservations.
  34. // least subnet and pool entries.
  35. "subnet6": [
  36. {
  37. "subnet": "2001:db8:1::/48",
  38. "pools": [ { "pool": "2001:db8:1::/120" } ],
  39. "pd-pools": [
  40. {
  41. "prefix": "2001:db8:1:8000::",
  42. "prefix-len": 56,
  43. "delegated-len": 64
  44. }
  45. ],
  46. "interface": "ethX",
  47. "reservation-mode": "out-of-pool",
  48. // Host reservations. Define several reservations, note that
  49. // they are all within the range of the pool of the dynamically
  50. // allocated address. The server will exclude the addresses from this
  51. // pool and only assign them to the client which has a reservation for
  52. // them.
  53. "reservations": [
  54. // This is a simple host reservation. The host with DUID matching
  55. // the specified value will get an address of 2001:db8:1::100.
  56. {
  57. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  58. "ip-addresses": [ "2001:db8:1::100" ]
  59. },
  60. // This is similar to the previous one, but this time the reservation
  61. // is done based on hardware/MAC address. The server will do its best to
  62. // extract the hardware/MAC address from received packets (see
  63. // 'mac-sources' directive for details). This particular reservation
  64. // also specifies two extra options to be available for this client. If
  65. // there are options with the same code specified in a global, subnet or
  66. // class scope, the values defined at host level take precedence.
  67. {
  68. "hw-address": "00:01:02:03:04:05",
  69. "ip-addresses": [ "2001:db8:1::101" ],
  70. "option-data": [
  71. {
  72. "name": "dns-servers",
  73. "data": "3000:1::234"
  74. },
  75. {
  76. "name": "nis-servers",
  77. "data": "3000:1::234"
  78. }],
  79. "client-classes": [ "special_snowflake", "office" ]
  80. },
  81. // This is a bit more advanced reservation. The client with the specified
  82. // DUID will get a reserved address, a reserved prefix and a hostname.
  83. // This reservation is for an address that it not within the dynamic pool.
  84. // Finally, this reservation features vendor specific options for CableLabs,
  85. // which happen to use enterprise-id 4491. Those particular values will
  86. // be returned only to the client that has a DUID matching this reservation.
  87. {
  88. "duid": "01:02:03:04:05:06:07:08:09:0A",
  89. "ip-addresses": [ "2001:db8:1:cafe::1" ],
  90. "prefixes": [ "2001:db8:2:abcd::/64" ],
  91. "hostname": "foo.example.com",
  92. "option-data": [ {
  93. "name": "vendor-opts",
  94. "data": "4491"
  95. },
  96. {
  97. "name": "tftp-servers",
  98. "space": "vendor-4491",
  99. "data": "3000:1::234"
  100. } ]
  101. },
  102. // This reservation is using flexible identifier. Instead of relying
  103. // on specific field, sysadmin can define an expression similar to what
  104. // is used for client classification,
  105. // e.g. substring(relay[0].option[17],0,6). Then, based on the value of
  106. // that expression for incoming packet, the reservation is matched.
  107. // Expression can be specified either as hex or plain text using single
  108. // quotes.
  109. // Note: flexible identifier requires flex_id hook library to be
  110. //loaded to work.
  111. {
  112. "flex-id": "'somevalue'",
  113. "ip-addresses": [ "2001:db8:1:cafe::2" ]
  114. }
  115. ]
  116. }
  117. ]
  118. },
  119. // The following configures logging. It assumes that messages with at
  120. // least informational level (info, warn, error and fatal) should be
  121. // logged to stdout.
  122. "Logging": {
  123. "loggers": [
  124. {
  125. "name": "kea-dhcp6",
  126. "output_options": [
  127. {
  128. "output": "stdout"
  129. }
  130. ],
  131. "debuglevel": 0,
  132. "severity": "INFO"
  133. }
  134. ]
  135. }
  136. }