This discussion is archived
1496 Views 4 Replies Latest reply: Feb 5, 2009 12:56 PM by Camelot
Currently Being ModeratedFeb 4, 2009 10:31 PM (in response to Rtaxerxes)Your route statement is the right approach, just the wrong values.
If you're using two interfaces you have to remember that you can only have one default route. In this case with the USB modem handling your internet connection you should NOT have a router address set for the ethernet interface. Instead you should add a static route for just the subnets that should go over that link.
In this case you want to route 172.19.x.x addresses through 192.168.0.2, so you'd run:
sudo route add -net 172.19 192.168.0.2
That way your system will use the ethernet network for all 192.168.0.x traffic (since that's the LAN address of that interface). It'll send any traffic for 172.19.x.x over this interface (via 192.168.0.2) and all other traffic will use the USB interface.Mac OS X (10.5.6)
Currently Being ModeratedFeb 5, 2009 2:16 AM (in response to Camelot)Thanks, I will try that as soon as I get home. Any idea on how to make it permanent so it survives a reboot?Macbook, iMac, iPhone, Mac OS X (10.5.5)
Currently Being ModeratedFeb 5, 2009 7:56 AM (in response to Rtaxerxes)Thanks, that worked great. What do I need to do to get into the routing table permanently? Or what do I do to make the command survive a reboot?Macbook, iMac, iPhone, Mac OS X (10.5.5)
Currently Being ModeratedFeb 5, 2009 12:56 PM (in response to Rtaxerxes)Any changes via the route command are transient and will go away when the machine reboots.
You have several options for making the route persistent - have the OS run a script at startup that adds the route.
Your best option would be to save your routes setup in a shell script (such as /usr/local/bin/addroutes) and add a launchd script to launch that at boot time, like:
/sbin/route add -net 172.19 192.168.0.2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
The first file, /usr/local/bin/addroutes has the commands to execute while the .plist file runs the script at boot time.Mac OS X (10.5.6)