Networking: Adding specific route for printer, on Mac Connected to Two Networks

1

I have a Mac connected to two different networks (wireless en1 and ethernet en0 ). The ethernet network is the preferred (System Preferences->Set Service Order).

I'd like to be able to print to a printer on the wireless network side, without having to go to System Preferences and make the wireless network come first in the service order.

Is there a way to add a route for a specific printer?

Added image of netstat -nr http://skitch.com/jordanx/n5gd8/neo-matrix.home-bash-110x29

Router Config: I have an Apple Airport connected to an Internet Router. The printer is connected to the Airport (en1). When the Wireless (en1) is first (Set Order) I can print. When it isn't, I can't.

The Airport is setup as a wireless network off of the Internet Router.

Jordan

Posted 2010-03-22T15:25:47.753

Reputation: 123

Answers

0

The network you get to over wireless, and the network you get to over Ethernet -- are they really each separate multi-hop networks (each have multiple IP subnets divided by routers? Because if either network is all one subnet, you should still be able to reach anything on it even when it's not ranked first. The local subnet out any active network interface is always reachable via that interface. The interface rankings just determine which interface is used for accessing non-local subnets (a.k.a. the default route).

Chris S.'s questions are good too. If you're accidentally using the same private IP subnet on two different networks that you're connected to simultaneously, it's hard for your machine to automatically set up its route table correctly. So the answer could be as simple as choosing a different RFC 1918 private subnet for one of those networks.

Update since you added the netstat output and further description: So, that 192.168.1.x network out en0 (Ethernet) -- is that the same network that the WAN port of the AirPort Base Station is plugged into? If so, do you have a good reason for running NAT and DHCP on your AirPort Base Station when you've already got an upstream Internet router providing that service for your network? If not, then consider turning off NAT and DHCP on your AirPort Base Station (a.k.a. putting it in "bridge mode"). That way you'll have a single bridged Ethernet (including 802.11 wireless Ethernet) and won't have this problem.

Spiff

Posted 2010-03-22T15:25:47.753

Reputation: 84 656

I wanted to keep the en1 separate from the en0 network, which was the original reason for running NAT/DHCP on the Airport. I turned off Wireless mode from the upstream internet router and am using the Airport for wireless connections. I'm wondering if I delete default .0.1 if that'll work - everything else remaining equal. – Jordan – 2010-03-24T10:36:38.387

What do you mean by "keep...separate"? NAT won't keep wireless clients from reaching wired machines, it will only block automatic discovery and browsing. NAT will generally keep wired machines from reaching wireless machines (as you've discovered).

If the only thing you were worried about was keeping traffic on the wired from using up wireless bandwidth, you should use bridge mode. Bridges do that; they maintain filter tables of what MAC addresses are on what side of the bridge, so that they don't forward unicast traffic to the other side of the bridge if it's not actually destined there. – Spiff – 2010-03-24T15:10:55.970

1

Do your wired and wireless networks have different IP address ranges?
Are you connecting to the printer via it's IP address?

Update
Like Spiff said, if you switch your wireless network to bridged mode, you can eliminate this problem (and other wired computers, if you have any, can use the printer too).

Otherwise you've got two default gateways configured, and that will cause problems. It would probably be easiest to remove the default gateway associated with the wired connection. route delete default 192.168.0.1 should take care of that.

Chris S

Posted 2010-03-22T15:25:47.753

Reputation: 5 907

Yes, different IP Address. It has a local bonjour name (but, yes, it's a different IP Address). – Jordan – 2010-03-22T18:04:54.483

Added image of netstat -nr – Jordan – 2010-03-22T18:09:41.633

Much appreciated. – Jordan – 2010-03-24T10:36:57.527

Just realize that your route command won't survive reboot. If the route table you showed us was automatically created by Mac OS X (that is, if you handn't been playing with the "route" command before you made that screenshot), then Mac OS X will end up recreating that route table that way every time. – Spiff – 2010-03-24T15:03:50.743