When I setup my development environment with Docker, I’ll have to add a static route on every reboot.
Here is a simple workaround on how to add a persistent static route on OS X Yosemite.
This example will route all subnet-addresses 10.1.*.* traffic to the Vagrant machine with IP 172.17.8.101.
Create a simple bash script
Create a new file /usr/local/bin/static-routes.sh
Add the following lines in /usr/local/bin/static-routes.shYou can add more routes if you want to.
Make the script executable.
Add the bash script to the LaunchAgents
Load and enable the plist file
Check-up
Check if the route is added after a reboot
Thanks for reading
Feel free to leave a comment if you have remarks or like this post