openvpn: enabled IP forwarding

This commit is contained in:
Tigor Hutasuhut 2024-06-14 16:44:08 +07:00
parent 9ec97fbda5
commit 4b3c971a12

View file

@ -21,6 +21,9 @@ in
config = mkIf cfg.enable {
environment.systemPackages = [ pkgs.openvpn ]; # To generate keys with openvpn --genkey --secret <name>.key
# Enable IP forwarding to allow the VPN to act as a gateway.
boot.kernel.sysctl."net.ipv4.ip_forward" = 1;
networking.nat = {
enable = true;
inherit externalInterface;