Routing WIFI and LAN for specific traffic

Posted by jakebird451 on Server Fault See other posts from Server Fault or by jakebird451
Published on 2012-06-15T20:03:13Z Indexed on 2012/06/22 3:18 UTC
Read the original article Hit count: 514

Filed under:
|
|
|
|

I have two network devices aboard my macbook pro:

  1. WIFI (en1): Used for general traffic. Connects to an ip of 192.168.19.* via DHCP
  2. LAN (en0): Used for specific traffic. Connects to an ip of 192.168.2.10 as a static IP. Does not connect to a router, only a switch for direct routing connection.

I have 4 IP addresses I need to access on the LAN:

  1. 192.168.2.1
  2. 192.168.2.21
  3. 192.168.2.20
  4. 192.168.2.30

The rest of the traffic needs to go to WIFI. I have tried setting up a routing table for the specific ip addresses, but I only managed to mess up my network. I do not venture out into the world of networking too often, but this was the latest command I have been trying:

sudo route add -host 192.168.2.30 -interface en0

This command killed my ability to use ping. It told me that ping could not allocate memory (is that even possible)? It also killed my wifi access. Logging out and back in fixed the issue. I really do not mind to make this solution permanent, so I am fine with a temporary routing.

EDIT:

If I currently have been trying:

sudo route flush
sudo route add default 192.168.19.1

This gets everything to work for about a minute. But after such minute it "forgets" the routing to WiFi while retaining LAN's (en0) routing. If I unplug and replug my LAN (en0) cable, the process works for another minute.

© Server Fault or respective owner

Related posts about macosx

Related posts about networking