Skip to content

Instantly share code, notes, and snippets.

@athairus
Forked from GabLeRoux/0-ReadMe.md
Last active December 27, 2017 20:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save athairus/3363de4b0f3673958d0da194dac37d8c to your computer and use it in GitHub Desktop.
Save athairus/3363de4b0f3673958d0da194dac37d8c to your computer and use it in GitHub Desktop.

Attempt to manage vpn routing table with /etc/ppp/ip-up

Related Stackoverflow Question:
https://superuser.com/a/206826/55267

Related answer:
https://superuser.com/a/206826/55267

# setup
sudo touch /etc/ppp/ip-up
sudo vim /etc/ppp/ip-up # fill the script
sudo chmod +x /etc/ppp/ip-up
# tail the logs
sudo tail -f /var/log/ip-up.log

Tested on MacOS 10.13 and didn't work for me. Script doesn't get called.

#!/bin/sh
now=`date +%Y-%m-%d_%Hh%Mm%Ss`
logfile=/var/log/ip-up.log
echo "$0 called at $now with following params:" >> $logfile
echo "The VPN interface (e.g. ppp0): $1" >> $logfile
echo "Unknown, was 0 in my case $2" >> $logfile
echo "IP of the VPN server: $3" >> $logfile
echo "VPN gateway address: $4" >> $logfile
echo "Regular (non-vpn) gateway for your lan connections: $5" >> $logfile
#/sbin/route add 192.168.0.0/16 -interface $1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment