Skip to content

Instantly share code, notes, and snippets.

@BirknerAlex
Last active May 17, 2016 11:19
Show Gist options
  • Save BirknerAlex/5554a843b9a1161f3b8a to your computer and use it in GitHub Desktop.
Save BirknerAlex/5554a843b9a1161f3b8a to your computer and use it in GitHub Desktop.
Mac OS X: PPTP VPN - Add single ips to routes
#!/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