Last active
November 29, 2017 01:23
-
-
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)
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/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You got an extra % at the end of the last row. Removing it from the script works for me!
Thanks!