Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link

@savo92 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
You can’t perform that action at this time.