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 two Internet connections at work, my wired Ethernet connection (which is heavily filtered behind a firewall, can't connect to Apple Updates, etc.) and a wireless connection that is unfiltered. I use my wireless connection as my primary connection so that things generally work. However, I have some intranet resources that I need to access via the wired connection only. How can I set it up so that when I visit something like "intranet.mycompany.com" - it will automatically route to the wired network adapter?

share|improve this question
add comment

2 Answers

up vote 5 down vote accepted

You need to add a route manually to cover all the corporate networks. Find the smallest net block that will cover all the corporate IP addresses. For example, the corporate net might be entirely within the range 172.16.22.XXX—172.16.25.XXX. Thus your net block would be 172.16.16.0/20:

/sbin/route add -net 172.16.16.0/20 -interface en0

Note that on my machine, en0 is the Ethernet, en1 is the AirPort.

I have a script which sets up a bunch of routes for my local situation which is a corporate network for all corporatey stuff (time sheets, leave applications, workplace health & safety reporting, etc), with WiFi for the useful stuff (Bing, O'Reilly Safari, etc). I still haven't figured out where I need to put this script to have Mac OS X automatically add the arcane routes I need when the interface comes up though.

share|improve this answer
    
Another note: if you boneheadedly screw up your routing table like I did (and can't access anything anymore), run route -n flush a few times, then switch your network location to something else and back to get back your normal routing information. –  geerlingguy Jun 6 '13 at 17:21
add comment

You can setup your Network Service Order to pass most traffic through Wi-fi or Ethernet.

This makes the preferred connection be whatever service you put at the top of the list. Unfortunately, if you want most information to go through Wi-fi except for very specific items, this won't do that. If the Ethernet connection uses a different IP network range than the Wi-fi then it will automatically pass the required resources through Ethernet.

So, let's say you have the wolfing network. Wi-fi: 192.168.1.0-192.168.1.255 Ethernet: 192.168.5.0-192.168.5.255

Any services you need to access that have a DNS record pointing to 192.168.5.x will automatically go through Ethernet, but your DNS query WILL still go to 192.168.1.x

Any other websites that you services you visit will go through Wi-fi if Wi-fi as at the top.

To change the service order go to System Preferences->Network. Click on the Action menu (the gear at the bottom of the Services list) and choose "Set Service Order" Then drag the service you want to have precedence to the top of the list.

share|improve this answer
    
Yeah, I already have the service order set, but I'm looking for a way to modify the routing tables for specific items. In Windows I would use the "route add" console command. I'm looking for something similar on the Mac. –  JacobJ May 18 '12 at 16:46
    
I know that it is possible to add routing tables into OS X, since it is built on top of Unix, and I've heard of people doing it. But I do not know how. Try googling OpenBSD Routing Table CLI. This should tell you how to manage the routing tables through the command-line. If you can't find anything let me know, and I'll take a look. –  Phillip Boushy Jun 23 '12 at 23:53
add comment

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.