1
0
forked from extern/nix-config
donovanglover-nix-config/host/mullvad/default.nix
Donovan Glover aaa0fe82cd
mullvad: Add port forwarding example
This was my working solution at forwarding ports from a container to the
host. Although mullvad no longer supports port forwarding, this example
can still be used to forward e.g. web services from containers to the
host.
2023-06-03 11:50:21 -04:00

32 lines
557 B
Nix

{ pkgs, ... }:
{
environment.systemPackages = [ pkgs.mullvad-vpn ];
services.mullvad-vpn = {
enable = true;
enableExcludeWrapper = false;
};
networking.firewall.allowedTCPPorts = [ 11918 ];
networking = {
nat = {
enable = true;
internalInterfaces = [ "ve-+" ];
externalInterface = "wg-mullvad";
forwardPorts = [
{
destination = "192.168.100.11:80";
sourcePort = 11918;
}
];
};
networkmanager = {
unmanaged = [ "interface-name:ve-*" ];
};
};
}