reservations.json 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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. },
  19. # This is pretty basic stuff, it has nothing to do with reservations.
  20. "preferred-lifetime": 3000,
  21. "valid-lifetime": 4000,
  22. "renew-timer": 1000,
  23. "rebind-timer": 2000,
  24. # Kea supports two types of identifiers in DHCPv6: hw-address (hardware/MAC address
  25. # of the client) and duid (DUID inserted by the client). When told to do so, Kea can
  26. # check for each of these identifier types, but it takes a costly database lookup
  27. # to do so. It is therefore useful from a performance perspective to use only
  28. # the reservation types that are actually used in a given network.
  29. "host-reservation-identifiers": [ "duid", "hw-address" ],
  30. # The following list defines subnets. Subnet, pools and interface definitions
  31. # are the same as in the regular scenario, without host reservations.
  32. # least subnet and pool entries.
  33. "subnet6": [
  34. {
  35. "subnet": "2001:db8:1::/48",
  36. "pools": [ { "pool": "2001:db8:1::/80" } ],
  37. "pd-pools": [
  38. {
  39. "prefix": "2001:db8:1:8000::",
  40. "prefix-len": 56,
  41. "delegated-len": 64
  42. }
  43. ],
  44. "interface": "ethX",
  45. # Host reservations. Define several reservations, note that
  46. # they are all within the range of the pool of the dynamically
  47. # allocated address. The server will exclude the addresses from this
  48. # pool and only assign them to the client which has a reservation for
  49. # them.
  50. "reservations": [
  51. # This is a simple host reservation. The host with DUID matching
  52. # the specified value will get an address of 2001:db8:1::100.
  53. {
  54. "duid": "01:02:03:04:05:0A:0B:0C:0D:0E",
  55. "ip-addresses": [ "2001:db8:1::100" ]
  56. },
  57. # This is similar to the previous one, but this time the reservation is done
  58. # based on hardware/MAC address. The server will do its best to extract
  59. # the hardware/MAC address from received packets (see 'mac-sources' directive
  60. # for details). This particular reservation also specifies two extra options
  61. # to be available for this client. If there are options with the same code
  62. # specified in a global, subnet or class scope, the values defined at host level
  63. # take precedence.
  64. {
  65. "hw-address": "00:01:02:03:04:05",
  66. "ip-addresses": [ "2001:db8:1::101" ],
  67. "option-data": [
  68. {
  69. "name": "dns-servers",
  70. "data": "3000:1::234"
  71. },
  72. {
  73. "name": "nis-servers",
  74. "data": "3000:1::234"
  75. }],
  76. "client-classes": [ "special_snowflake", "office" ]
  77. },
  78. # This is a bit more advanced reservation. The client with the specified
  79. # DUID will get a reserved address, a reserved prefix and a hostname.
  80. # This reservation is for an address that it not within the dynamic pool.
  81. # Finally, this reservation features vendor specific options for CableLabs,
  82. # which happen to use enterprise-id 4491. Those particular values will
  83. # be returned only to the client that has a DUID matching this reservation.
  84. {
  85. "duid": "01:02:03:04:05:06:07:08:09:0A",
  86. "ip-addresses": [ "2001:db8:1:cafe::1" ],
  87. "prefixes": [ "2001:db8:2:abcd::/64" ],
  88. "hostname": "foo.example.com",
  89. "option-data": [ {
  90. "name": "vendor-opts",
  91. "data": "4491"
  92. },
  93. {
  94. "name": "tftp-servers",
  95. "space": "vendor-4491",
  96. "data": "3000:1::234"
  97. } ]
  98. }
  99. ]
  100. }
  101. ]
  102. },
  103. # The following configures logging. It assumes that messages with at least
  104. # informational level (info, warn, error and fatal) should be logged to stdout.
  105. "Logging": {
  106. "loggers": [
  107. {
  108. "name": "kea-dhcp6",
  109. "output_options": [
  110. {
  111. "output": "stdout"
  112. }
  113. ],
  114. "debuglevel": 0,
  115. "severity": "INFO"
  116. }
  117. ]
  118. }
  119. }