Last active
August 29, 2015 13:59
-
-
Save eduardodeoh/10994439 to your computer and use it in GitHub Desktop.
Add custom route to mac os x after vpn connection
This file contains 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
#!/usr/bin/env bash | |
MY_SERVER="192.168.0.150" | |
#Solution 1 | |
#VPN_GW=$(ifconfig | grep -A2 ppp | grep inet | awk '{print $4}') | |
##Add route to host only | |
#sudo route add -host $MY_SERVER $VPN_GW | |
# Solution 2 | |
/sbin/route add -host $MY_SERVER -interface ppp0 | |
#Instructions | |
# 1 - Copy this file content to /etc/ppp/ip-up | |
# 2 - chmod +x /etc/ppp/ip-up | |
# 3 - connect to vpn | |
# 4 - check new custom route with: netstat -rn | |
# 5 - Enjoy! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment