NixOS deployment for LinuxLab
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

78 lines
1.4 KiB

1 week ago
1 week ago
  1. { pkgs, config, ... }:
  2. {
  3. services.kea.dhcp4 = {
  4. enable = true;
  5. settings = {
  6. interfaces-config = {
  7. interfaces = [
  8. "enp4s0f0"
  9. "enp4s0f1"
  10. ];
  11. };
  12. lease-database = {
  13. name = "/var/lib/kea/dhcp4.leases";
  14. persist = true;
  15. type = "memfile";
  16. };
  17. rebind-timer = 2000;
  18. renew-timer = 1000;
  19. subnet4 = [
  20. {
  21. subnet = "10.33.64.0/20";
  22. interface = "enp4s0f0";
  23. pools = [
  24. {
  25. pool = "10.33.65.100 - 10.33.65.200";
  26. }
  27. ];
  28. option-data = [
  29. {
  30. name = "routers";
  31. data = "10.33.64.1";
  32. }
  33. {
  34. name = "domain-name-servers";
  35. data = "10.0.0.53";
  36. }
  37. {
  38. name = "domain-name";
  39. data = config.networking.domain;
  40. }
  41. {
  42. name = "domain-search";
  43. data = config.networking.domain;
  44. }
  45. ];
  46. }
  47. {
  48. subnet = "10.32.44.0/24";
  49. interface = "enp4s0f1";
  50. pools = [
  51. {
  52. pool = "10.32.44.100 - 10.32.44.200";
  53. }
  54. ];
  55. }
  56. ];
  57. valid-lifetime = 4000;
  58. };
  59. };
  60. networking.firewall.allowedUDPPorts = [
  61. 67
  62. 68 # DHCP
  63. ];
  64. }