Skip to content

Commit

Permalink
fix(vpn): remove lan routes from vpn
Browse files Browse the repository at this point in the history
  • Loading branch information
sbulav committed Nov 21, 2024
1 parent db6cb67 commit 2fbf072
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion nix/modules/home/security/openconnect/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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 "******************************************************"
Expand All @@ -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)
Expand Down

0 comments on commit 2fbf072

Please sign in to comment.