Last active
February 19, 2024 14:12
-
-
Save trollknurr/ef8a49a5a35e95e17635 to your computer and use it in GitHub Desktop.
openconnect vpn split routing sh script
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Add one IP to the list of split tunnel | |
add_ip () | |
{ | |
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_ADDR=$1 | |
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASK=255.255.255.255 | |
export CISCO_SPLIT_INC_${CISCO_SPLIT_INC}_MASKLEN=32 | |
export CISCO_SPLIT_INC=$(($CISCO_SPLIT_INC + 1)) | |
} | |
# Initialize empty split tunnel list | |
export CISCO_SPLIT_INC=0 | |
# Delete DNS info provided by VPN server to use internet DNS | |
# Comment following line to use DNS beyond VPN tunnel | |
unset INTERNAL_IP4_DNS | |
# List of IPs beyond VPN tunnel | |
add_ip *.*.*.* | |
# Execute default script | |
. /etc/vpnc/vpnc-script | |
# End of script |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Для макоюзеров - как поставить openconnect
http://zanshin.net/2013/08/27/setup-openconnect-for-mac-os-x-lion/