Skip to content

Instantly share code, notes, and snippets.

@trollknurr
Last active February 19, 2024 14:12
Show Gist options
  • Save trollknurr/ef8a49a5a35e95e17635 to your computer and use it in GitHub Desktop.
Save trollknurr/ef8a49a5a35e95e17635 to your computer and use it in GitHub Desktop.
openconnect vpn split routing sh script
#!/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
@RafRaf
Copy link

RafRaf commented Mar 12, 2015

Для макоюзеров - как поставить openconnect
http://zanshin.net/2013/08/27/setup-openconnect-for-mac-os-x-lion/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment