How do I configure custom routes when an interface is configured?

Posted by ManicDee on Super User See other posts from Super User or by ManicDee
Published on 2012-07-10T01:18:08Z Indexed on 2012/07/10 3:18 UTC
Read the original article Hit count: 407

Filed under:
|
|

Other Superuser questions have addressed the issue of adding custom routes to access e.g.: multiple networks of a corporate network through one interface, while accessing the Internet through another interface.

So assuming that I have a script to add specific routes when en0 is configured, and a separate script to add specific routes when en1 is configured, is there some way I can trigger those scripts to run automatically when Mac OS X/Darwin starts and configures those interfaces?

Back in my Linux days, it was possible to add an option in /etc/network/interfaces along the lines of:

iface eth0 inet dhcp
  up /usr/local/sbin/eth0-routes-up

Is there something similar for Mac OS X?

© Super User or respective owner

Related posts about osx

Related posts about networking