7

I have two networks available in my location, and am using a MacBook Pro running OS X Lion.

  • BLUE NETWORK -
    DHCP assigns me 10.x.x.x address, and is for internal traffic only. It has no connection to the Internet, and is available either on Ethernet or Wifi.

  • RED NETWORK -
    DHCP assigns me a 192.168.x.x address, and is a direct connection to the Internet. It has no connection to any internal resources, and is available either on Ethernet or Wifi.

By default, it seems that OS X favours the connection with the greater bandwidth almost exclusively. That's to say, if I'm connected via Ethernet on the RED network, and by Wifi on the BLUE network, I can access the outside world just fine, but RDP connections to internal servers fail and I can't connect to internal fileshares.

Conversely, if I'm connected via Ethernet on the BLUE network, and by Wifi on the RED network, FTP to external servers doesn't work (or Skype etc.) but internal fileshares can be accessed just fine.

Really, I only need 10.0.0.0/8 addresses to be routed on the BLUE network, and everything else on the RED. And for named servers, some rules like *.int.foo.com resolved on the BLUE network but everything else on the RED.

Is this something that can be achieved?

1
  • We need to wiki these questions. . .
    – surfasb
    Aug 12, 2011 at 19:05

2 Answers 2

9

Mac OS X gives the default route to the highest-ranked, active interface. It doesn't have anything to do with bandwidth. To change interface rankings, go to System Preferences > Network, click the cog drop-down menu under the list of devices and select Set Service Order. Then drag to rearrange your interface rankings. It sounds like you want RED ranked above BLUE.

If BLUE is a multi-hop network (i.e. not just the local subnet), then things may get tricky. You can also add specific routes using the route command. This would allow you to route 10.0.0.0/8 addresses over "BLUE".

2
  • This is your safest bet. I would also recommend statically addressing one or the other, and only having ONE link be using DHCP (preferably your outbound internet link).
    – peelman
    Aug 12, 2011 at 17:05
  • Thanks very much for the help - this looks like it'll be just what I'm looking for.
    – Rob Wright
    Aug 16, 2011 at 10:03
2

You can confirm the routing by looking at the routing table (if you know how to interpret that):

netstat -nr -f inet

or specifically querying the routing table:

route get 204.XXX.YYY.ZZZ

for some destination, 204.XXX.YYY.ZZZ.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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