Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have both ethernet and wifi access for my Mac OS X. Ethernet access is used for local area network only (ip range 192.168.0.0/16 and 10.0.0.0/8), while wifi access is used for the Internet.

Now I want to configure network so that it will access different routers according to destination. For example, if I'm going to visit google.com it will go by wifi access, but if I'm going to visit http://192.168.1.111 then it will go by ethernet access. How can I do that?

share|improve this question

2 Answers 2

up vote 1 down vote accepted

I'm looking to do precisely the same thing. Unfortunately the 'route' options are explained as tersely as all others in the man pages, which is unfortunate.

I can't identify a meaningful way to accomplish this via the Network preference pane, and I am at a loss to grasp the intricacies of a routing table at-a-glance.

If there's anyone who's actually managed to accomplish this, particularly in 10.6.4, it'd be great to have some pointers. Thanks!

UPDATE: A discussion on this thread:

http://superuser.com/questions/166563/selectively-routing-traffic-via-ethernet-or-wifi-with-proper-dns-mac-os-x-10-6

seems to have addressed part of the issue for me. Specifically the OP mentioned using 'sudo route add' to modify the routing table. In his case the command was:

sudo route add 10.0.0.0/8 <intranet gateway>

That works for my setup, since our intranet IP addresses are all 10.x numbers. (Note that I believe you have to have your root user active to make this work.) Now, anything I access directly by IP address is handled via my wireless connection to the intranet, while everything else seems to be passing through the internet.

In the above example, BTW, the <intranet gateway> would be the IP address of the router for the 10.* connections, as given in the Network preferences pane. Hence, if your router IP was 10.32.0.1, you'd do this in a terminal window:

sudo route add 10.0.0.0/8 10.32.0.1

I hope this is of some use to you, as it was for me - though it doesn't handle internal domain resolution ('nw.company.com', for instance), as far as I can tell.

share|improve this answer

While I do not know specifically the command you will need to run, I know it can be accomplished with the "route" command from terminal. Take a look at the man pages. Also, note that you will need to use sudo route to make changes.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.