Last active
May 17, 2016 11:19
-
-
Save BirknerAlex/5554a843b9a1161f3b8a to your computer and use it in GitHub Desktop.
Mac OS X: PPTP VPN - Add single ips to routes
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 | |
if [[ `whoami` != "root" ]] | |
then | |
echo "Please run this script as root" | |
exit 1 | |
fi | |
ifname="ppp0" | |
mtu="1400" | |
ips="8.8.8.8/32 | |
8.8.4.4/32" | |
if [[ $1 == "start" ]] | |
then | |
for ip in $ips | |
do | |
/sbin/route add -net $ip -interface $ifname | |
done | |
/sbin/ifconfig $ifname mtu $mtu | |
fi | |
if [[ $1 == "stop" ]] | |
then | |
for ip in $ips | |
do | |
/sbin/route delete -net $ip -interface $ifname | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment