diff --git a/hosts/darkgui-vps/config/self-host/firewall.nix b/hosts/darkgui-vps/config/self-host/firewall.nix index d67e7d0..29c5456 100644 --- a/hosts/darkgui-vps/config/self-host/firewall.nix +++ b/hosts/darkgui-vps/config/self-host/firewall.nix @@ -6,7 +6,6 @@ ... }: { - # Open ports in the firewall. networking.firewall = { enable = true; @@ -21,8 +20,20 @@ 9000 11000 ]; + trustedInterfaces = [ "tailscale0" "docker0" ]; - allowedUDPPorts = [ config.services.tailscale.port ]; + allowedUDPPorts = [ + config.services.tailscale.port + 53 + 5300 + 7777 + 40000 + ]; + extraCommands = '' + iptables -A PREROUTING -t nat -i eth0 -p TCP --dport 80 -j REDIRECT --to-port 8000 + iptables -A PREROUTING -t nat -i eth0 -p TCP --dport 53 -j REDIRECT --to-port 5300 + iptables -A PREROUTING -t nat -i eth0 -p UDP --dport 53 -j REDIRECT --to-port 5300 + ''; }; }