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.
This works, shebang was wrong. Thanks to athairus and Mark Gaensicke in the comments. 🙌
- 2022-11-02: I've updated the script to reflect suggested changes in comments and I've added logging of the command
@GabLeRoux It's much easier nowadays.
As user run
networksetup -listnetworkserviceorder
to find out the name of the Network.Run this to permanently add 172.20.20.0/24 with gateway 172.20.19.1
It's save to leave out the gateway :)
networksetup -setadditionalroutes "network name" 172.20.20.0 255.255.255.0 172.17.19.1
No need to rerun it :)