Skip to content

Commit

Permalink
virtualization/libvirt: fix dhcp
Browse files Browse the repository at this point in the history
  • Loading branch information
linyinfeng committed Oct 10, 2024
1 parent 592c0b9 commit 87c086f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 2 additions & 0 deletions nixos/modules/misc/ports.nix
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
ports = {
ssh-honeypot = 22;
dns = 53;
dhcp-server = 67;
dhcp-client = 68;
http = 80;
bgp = 179;
https = 443;
Expand Down
4 changes: 2 additions & 2 deletions nixos/profiles/graphical/gnome/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ lib.mkIf config.services.xserver.desktopManager.gnome.enable {
3389 # RDP
];
networking.firewall.allowedUDPPorts = [
53 # DNS server for hotsport
67 # DHCP server for hotsport
config.ports.dns # DNS server for hotsport
config.ports.dhcp-server # DHCP server for hotsport
];

environment.global-persistence.user = {
Expand Down
7 changes: 6 additions & 1 deletion nixos/profiles/virtualization/libvirt/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ pkgs, ... }:
{ config, pkgs, ... }:
let
winVirtioIso = pkgs.runCommand "win-virtio-iso" { } ''
mkdir -p "$out/share/win-virtio"
Expand All @@ -24,4 +24,9 @@ in
# virtio win
environment.systemPackages = [ winVirtioIso ];
environment.pathsToLink = [ "/share/win-virtio" ];

networking.firewall.allowedUDPPorts = [
config.ports.dns
config.ports.dhcp-server
];
}

0 comments on commit 87c086f

Please sign in to comment.