Skip to content

Instantly share code, notes, and snippets.

@tuxnker
Last active November 29, 2017 01:23
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tuxnker/7632e24b60cdac106ef6 to your computer and use it in GitHub Desktop.
forticlient ssl vpn split tunnel fix for mac os el capitan(need to be made executable and run as sudo every time you connect to the vpn)
#!/bin/bash
default_line=$(netstat -rn |grep default)
gateway=$(echo $default_line | awk '{print $2}')
interface=$(echo $default_line | awk '{print $6}')
echo $gateway
echo $interface
scutil <<EOF
d.init
get State:/Network/Service/forticlientsslvpn/IPv4
d.add InterfaceName ppp0
set State:/Network/Service/forticlientsslvpn/IPv4
EOF
route delete default
route delete -ifscope $interface default
route add -ifscope $interface default $gateway
route add -net 0.0.0.0 -interface $interface
@savo92
Copy link

savo92 commented Apr 6, 2016

You got an extra % at the end of the last row. Removing it from the script works for me!
Thanks!

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