diff options
author | Kjetil Orbekk <kj@orbekk.com> | 2024-01-30 15:53:06 -0500 |
---|---|---|
committer | Kjetil Orbekk <kj@orbekk.com> | 2024-01-30 15:53:06 -0500 |
commit | 610c83285c80d255ad43793dee4beab4cee8acff (patch) | |
tree | 1e4f2a03c67e70a4c4514ee8e514e3c66d3d4d2c | |
parent | c4df969a0bd6f38e15099dd80e32d52ea24cae4d (diff) |
update router config
-rw-r--r-- | modules/router.nix | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/router.nix b/modules/router.nix index 63ea496..33e8407 100644 --- a/modules/router.nix +++ b/modules/router.nix @@ -32,10 +32,10 @@ let ip netns exec vpn ip link set lo up ip link set vpn-vport netns vpn - ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv4.conf.default.forwarding=1 - ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv4.conf.all.forwarding=1 - ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv6.conf.default.forwarding=1 - ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv6.conf.all.forwarding=1 + # ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv4.conf.default.forwarding=1 + # ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv4.conf.all.forwarding=1 + # ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv6.conf.default.forwarding=1 + # ip netns exec router ${pkgs.procps}/bin/sysctl -w net.ipv6.conf.all.forwarding=1 ''; router-netns-down = pkgs.writeScript "router-netns-down" '' @@ -45,6 +45,13 @@ let router-config = { config, lib, pkgs, ... }: { system.stateVersion = "22.05"; + boot.kernel.sysctl = { + "net.ipv4.conf.all.forwarding" = true; + "net.ipv4.conf.default.forwarding" = true; + "net.ipv6.conf.all.forwarding" = true; + "net.ipv6.conf.default.forwarding" = true; + }; + environment.systemPackages = with pkgs; [ tcpdump ]; virtualisation.vswitch.enable = true; virtualisation.vswitch.resetOnStart = false; @@ -320,13 +327,6 @@ in { }; config = mkIf cfg.enable { - boot.kernel.sysctl = { - "net.ipv4.conf.all.forwarding" = true; - "net.ipv4.conf.default.forwarding" = true; - "net.ipv6.conf.all.forwarding" = true; - "net.ipv6.conf.default.forwarding" = true; - }; - systemd.services."router-netns" = { description = "router network namespace"; before = ["network.target"]; |