diff --git a/systems/x86_64-linux/drivebystation-nix/configuration.nix b/systems/x86_64-linux/drivebystation-nix/configuration.nix index fed2f2c..66c08f2 100644 --- a/systems/x86_64-linux/drivebystation-nix/configuration.nix +++ b/systems/x86_64-linux/drivebystation-nix/configuration.nix @@ -197,11 +197,38 @@ networking.firewall.allowedTCPPorts = [ 24800 #Synergy 53317 #localsend + 3390 #rdp + 9090 ]; networking.firewall.allowedUDPPorts = [ 24800 #Synergy 53317 #localsend + 3390 #rdp + 9090 ]; + networking.firewall.trustedInterfaces = [ "virbr0" ]; + networking.nat = { + enable = true; + internalInterfaces = [ "virbr0" ]; + externalInterface = "enp75s0"; + extraCommands = '' + # MASQUERADE forwarded traffic to VM so it knows how to route back + iptables -t nat -A nixos-nat-post -o virbr0 -j MASQUERADE + ''; + forwardPorts = [ + { + sourcePort = 9090; + proto = "tcp"; + destination = "192.168.122.113:9090"; + } + { + sourcePort = 9090; + proto = "udp"; + destination = "192.168.122.113:9090"; + } + ]; + }; + # Or disable the firewall altogether. # networking.firewall.enable = false;