From 2fbf0729a137c5543693917aafc4a7936b6c1de5 Mon Sep 17 00:00:00 2001 From: Sergei Bulavintsev Date: Thu, 21 Nov 2024 13:39:22 +0300 Subject: [PATCH] fix(vpn): remove lan routes from vpn --- nix/modules/home/security/openconnect/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nix/modules/home/security/openconnect/default.nix b/nix/modules/home/security/openconnect/default.nix index ae3d4ce..fee3f3c 100644 --- a/nix/modules/home/security/openconnect/default.nix +++ b/nix/modules/home/security/openconnect/default.nix @@ -43,7 +43,7 @@ with lib.custom; let case "$1" in up) echo $OPENCONNECT_PW | \ - sudo ${pkgs.openconnect}/bin/openconnect --background \ + sudo ${pkgs.openconnect}/bin/openconnect --no-dtls --background \ --passwd-on-stdin -u $OPENCONNECT_USER $OPENCONNECT_SERVER if [[ $? -ne 0 ]]; then echo "******************************************************" @@ -55,6 +55,9 @@ with lib.custom; let grep "nameserver" /etc/resolv.conf echo "******************************************************" echo "VPN is up and running!" + echo "******************************************************" + echo "Removing LAN routes to VPN" + sudo route del -net 192.168.0.0/16 fi ;; down)