How to use WiFi and Ethernet at the same time

Networkwifi

Brief Description:

I need my Ethernet card (en0) to see all traffic under 192.168.2.xxx.

However I also need to use WiFi card (en1) for all other traffic.

OS: OS X Lion


I am using a separate network location to deal with this specific use (since this is a for a robotics project that communicates via Ethernet). Ethernet (en0) had to be set up as a static IP (192.168.2.10) per the requirements for the device I am connecting to. All connections on the Ethernet card (en0) should be 192.168.2.xxx as specified above. WiFi (en1) is set up as DHCP to a router since their is no point in assigning it as a static for general purpose traffic. Ethernet (en0) is set up as priority over WiFi (en1).

I would also like to keep this under the network location preferences if at all possible since I do not require this feature to be on all the time.

I would really appreciate your help on this. No one I have talked to knows how to solve this.

Best Answer

The solution was extremely simple.

  1. Prioritize ethernet to be first.
  2. Under System Preferences->Network Settings: where EN0 is Manually configured, leave the router field blank.

I thought the router field was required, so I filled it in. My Ethernet connection has a "router" per say, but it is not used to access general connections. By filling in that field, the Mac OS would automatically try to create a default route through the Ethernet NIC. This would redirect all miscellaneous traffic through the wrong router.

I also tried to delete this route in the routing tables before I found the solution to my problem. This would delete the route appropriately and allow the my software system to run correctly. However after around a minute or so, the route was re-added (as I later discovered) by the operating system. After the route was re-added the connections would fail, so I had to restart the process all over again. This fix proved to be unproductive.

I hope this helps someone with their networking issues.