Skip to content

Commit

Permalink
nixos/openvpn: support setting IP forwarding
Browse files Browse the repository at this point in the history
  • Loading branch information
peterhoeg committed Jun 21, 2019
1 parent 282041f commit 5655968
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions nixos/modules/services/networking/openvpn.nix
Expand Up @@ -78,6 +78,14 @@ in

options = {

services.openvpn.enableForwarding = mkOption {
default = false;
type = types.bool;
description = ''
Set up IP forwarding on the host.
'';
};

services.openvpn.servers = mkOption {
default = {};

Expand Down Expand Up @@ -211,6 +219,8 @@ in

boot.kernelModules = [ "tun" ];

boot.kernel.sysctl = lib.mkIf cfg.enableForwarding { "net.ipv4.ip_forward" = true; };

};

}

0 comments on commit 5655968

Please sign in to comment.