shared-network.json 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. // This is an example configuration file for DHCPv4 server in Kea.
  2. // It demonstrates an advanced feature called shared network. Typically, for
  3. // each physical link there is one IPv4 subnet that the server is expected
  4. // to manage. However, in some cases there is a need to configure more subnets
  5. // in the same physical location. The most common use case is an existing
  6. // subnet that grew past its original assumptions and ran out of addresses,
  7. // so the sysadmin needs to add another subnet on top of existing one.
  8. {
  9. "Dhcp4": {
  10. // As with any other configuration, you need to tell Kea the interface
  11. // names, so it would listen to incoming traffic.
  12. "interfaces-config": {
  13. "interfaces": [ "ethX" ]
  14. },
  15. // You also need to tell where to store lease information.
  16. // memfile is the backend that is easiest to set up.
  17. "lease-database": {
  18. "type": "memfile",
  19. "lfc-interval": 3600
  20. },
  21. // The shared networks definition starts here. shared-networks can
  22. // contain a list of shared networks. There are many parameters
  23. // that can be specified here, so this example may be overwhelming
  24. // at first, but the only mandatory parameter for each shared
  25. // network is name. It must be unique. Typically, each shared
  26. // network also needs to have at least two subnets to be functional,
  27. // but if you really want to, you can define a degraded shared
  28. // network that has 1 or even 0 subnets. This may come in handy
  29. // when migrating between regular subnets and shared networks
  30. // or when debugging a problem. It is not recommended to use
  31. // 1 subnet per shared network, as there is extra processing
  32. // overhead for shared networks.
  33. "shared-networks": [
  34. {
  35. // Name of the shared network. It may be an arbitrary string
  36. // and it must be unique among all shared networks.
  37. "name": "frog",
  38. // You may specify interface name if the shared network is
  39. // reachable directly from the server.
  40. "interface": "eth1",
  41. // You can specify many parameters that are allowed in subnet scope
  42. // here. It's useful to put them here if they apply to all subnets
  43. // in this shared network. It's likely that the most common
  44. // parameter here will be option values defined with option-data.
  45. "match-client-id": false,
  46. "option-data": [ ],
  47. "rebind-timer": 150,
  48. // If all the traffic coming from that shared network is reachable
  49. // via relay and that relay always use the same IP address, you
  50. // can specify that relay address here. Since this example shows
  51. // a shared network reachable directly, we put 0.0.0.0 here.
  52. // It would be better to skip the relay scope altogether, but
  53. // it was left here for demonstration purposes.
  54. "relay": {
  55. "ip-address": "0.0.0.0"
  56. },
  57. // Timer values can be overridden here.
  58. "renew-timer": 100,
  59. "reservation-mode": "all",
  60. // This starts a list of subnets allowed in this shared network.
  61. // In our example, there are two subnets.
  62. "subnet4": [
  63. {
  64. "id": 1,
  65. "match-client-id": true,
  66. "next-server": "0.0.0.0",
  67. "option-data": [ ],
  68. "pools": [ ],
  69. "rebind-timer": 20,
  70. // You can override the value inherited from shared-network
  71. // here if your relay uses different IP addresses for
  72. // each subnet.
  73. "relay": {
  74. "ip-address": "0.0.0.0"
  75. },
  76. "renew-timer": 10,
  77. "reservation-mode": "all",
  78. "subnet": "10.0.0.0/8",
  79. "valid-lifetime": 30
  80. },
  81. {
  82. "id": 2,
  83. "match-client-id": true,
  84. "next-server": "0.0.0.0",
  85. "option-data": [ ],
  86. "pools": [ ],
  87. "rebind-timer": 20,
  88. "renew-timer": 10,
  89. "reservation-mode": "all",
  90. "subnet": "192.0.2.0/24",
  91. "valid-lifetime": 30
  92. }
  93. ],
  94. "valid-lifetime": 200
  95. } ], // end of shared-networks
  96. // It is likely that in your network you'll have a mix of regular,
  97. // "plain" subnets and shared networks. It is perfectly valid to mix
  98. // them in the same config file.
  99. //
  100. // This is regular subnet. It's not part of any shared-network.
  101. "subnet4": [
  102. {
  103. "pools": [ { "pool": "192.0.3.1 - 192.0.3.200" } ],
  104. "subnet": "192.0.3.0/24",
  105. "interface": "eth0",
  106. "id": 3
  107. }
  108. ]
  109. } // end of Dhcp4
  110. }