reservations.json 4.9 KB

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