diff --git a/nixos/snowglobe.nix b/nixos/snowglobe.nix index 679d6671b16000ed64f9ba8306ee7bec0768622c..840364077639983737ca16e47df9492fa8a97945 100644 --- a/nixos/snowglobe.nix +++ b/nixos/snowglobe.nix @@ -26,7 +26,12 @@ in networking.firewall.allowedTCPPorts = [ 80 443 ] ++ xmppTCPPorts; networking.firewall.allowedUDPPorts = xmppUDPPorts; networking.firewall.allowedUDPPortRanges = [{ from = xmppNetwork.relay_first; to = xmppNetwork.relay_last; }]; - networking.firewall.interfaces.enp4s0.allowedTCPPorts = [ 445 ]; + networking.firewall.extraCommands = lib.concatMapStrings ({ address, prefixLength, ... }: '' + iptables -A nixos-fw -i enp4s0 -s ${address}/${toString prefixLength} -p tcp --dport 445 -j nixos-fw-accept + '') config.networking.interfaces.enp4s0.ipv4.addresses + '' + ip6tables -A nixos-fw -i enp4s0 -s fe80::/10 -p tcp --dport 445 -j nixos-fw-accept + ip6tables -A nixos-fw -i enp4s0 -s fc00::/7 -p tcp --dport 445 -j nixos-fw-accept + ''; systemd.services.xmpp-nat = { wantedBy = [ "multi-user.target" ];