reservations.json 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. # This is an example configuration file for the DHCPv4 server in Kea.
  2. # It contains one subnet in which there are two static address reservations
  3. # for the clients identified by the MAC addresses.
  4. { "Dhcp4":
  5. {
  6. # Kea is told to listen on ethX interface only.
  7. "interfaces-config": {
  8. "interfaces": [ "ethX" ]
  9. },
  10. # We need to specify lease type. As of May 2014, three backends are supported:
  11. # memfile, mysql and pgsql. We'll just use memfile, because it doesn't require
  12. # any prior set up.
  13. "lease-database": {
  14. "type": "memfile"
  15. },
  16. # Addresses will be assigned with valid lifetimes being 4000. Client
  17. # is told to start renewing after 1000 seconds. If the server does not respond
  18. # after 2000 seconds since the lease was granted, client is supposed
  19. # to start REBIND procedure (emergency renewal that allows switching
  20. # to a different server).
  21. "valid-lifetime": 4000,
  22. # Renew and rebind timers are commented out. This implies that options
  23. # 58 and 59 will not be sent to the client. In this case it is up to
  24. # the client to pick the timer values according to RFC2131. Uncomment the
  25. # timers to send these options to the client.
  26. # "renew-timer": 1000,
  27. # "rebind-timer": 2000,
  28. # Kea supports reservations by several different types of identifiers:
  29. # hw-address (hardware/MAC address of the client), duid (DUID inserted by the
  30. # client), client-id (client identifier inserted by the client) and circuit-id
  31. # (circuit identifier inserted by the relay agent). When told to do so, Kea can
  32. # check for all of those identifier types, but it takes a costly database lookup
  33. # to do so. It is therefore useful from a performance perspective to use only
  34. # the reservation types that are actually used in a given network.
  35. # The example below is not optimal from a performance perspective, but it
  36. # nicely showcases the host reservation capabilities. Please use the minimum
  37. # set of identifier types used in your network.
  38. "host-reservation-identifiers": [ "circuit-id", "hw-address", "duid", "client-id" ],
  39. # Define a subnet with four reservations. Some of the reservations belong
  40. # to the dynamic pool. Kea is able to handle this case, but it is not
  41. # recommended from a performance perspective, as Kea would not only need to
  42. # check if a given address is free, but also whether it is reserved.
  43. # To avoid this check, one can change reservation-mode to out-of-pool, rather
  44. # than 'all'. If a subnet does not have reservations at all, the reservation
  45. # lookup can be skipped altogether (reservation-mode is set to 'disabled').
  46. # Note that the second reservation is for an address which is within the
  47. # range of the pool of the dynamically allocated address. The server will
  48. # exclude this address from this pool and only assign it to the client which
  49. # has a reservation for it.
  50. "subnet4": [
  51. {
  52. "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
  53. "subnet": "192.0.2.0/24",
  54. "interface": "eth0",
  55. "reservations": [
  56. # This is a reservation for a specific hardware/MAC address. It's a very
  57. # simple reservation: just an address and nothing else.
  58. {
  59. "hw-address": "1a:1b:1c:1d:1e:1f",
  60. "ip-address": "192.0.2.202"
  61. },
  62. # This is a reservation for a specific client-id. It also shows
  63. # the this client will get a reserved hostname. A hostname can be defined
  64. # for any identifier type, not just client-id.
  65. {
  66. "client-id": "01:11:22:33:44:55:66",
  67. "ip-address": "192.0.2.100",
  68. "hostname": "special-snowflake"
  69. },
  70. # The third reservation is based on DUID. This reservation also
  71. # defines special option values for this particular client. If
  72. # the domain-name-servers option would have been defined on a global,
  73. # subnet or class level, the host specific values take preference.
  74. {
  75. "duid": "01:02:03:04:05",
  76. "ip-address": "192.0.2.203",
  77. "option-data": [ {
  78. "name": "domain-name-servers",
  79. "data": "10.1.1.202,10.1.1.203"
  80. } ]
  81. },
  82. # The fourth reservation is based on circuit-id. This is an option inserted
  83. # by the relay agent that forwards the packet from client to the server.
  84. # In this example the host is also assigned vendor specific options.
  85. {
  86. "client-id": "01:11:22:33:44:55:66",
  87. "ip-address": "192.0.2.204",
  88. "option-data": [
  89. {
  90. "name": "vivso-suboptions",
  91. "data": "4491"
  92. },
  93. {
  94. "name": "tftp-servers",
  95. "space": "vendor-4491",
  96. "data": "10.1.1.202,10.1.1.203"
  97. }
  98. ]
  99. }
  100. ]
  101. }
  102. ]
  103. },
  104. # The following configures logging. It assumes that messages with at least
  105. # informational level (info, warn, error) will will be logged to stdout.
  106. "Logging": {
  107. "loggers": [
  108. {
  109. "name": "kea-dhcp4",
  110. "output_options": [
  111. {
  112. "output": "stdout"
  113. }
  114. ],
  115. "severity": "INFO"
  116. }
  117. ]
  118. }
  119. }