Usage of Dual Ethernet Jacks (One for LAN, One for WAN)

1

I'm working on an old Mac PowerPC G5 that has two Ethernet jacks. I'm interested in finding a way to have both jacks setup so that all internal traffic (all traffic to and from a specific IP address range. E.g., 192.168.*) to be routed through one of the jacks, and the other jack to route all other traffic.

It sounds doable, but I'm not sure how to approach this situation. Any help would be much appreciated.

EDIT

Thank you for the quick responses. I'm sorry for not being clear, I'm using OS X Tiger and I am not trying to share my internet connection.

My router provides two connections to my Mac (i.e., providing two internal IP address to my computer, e.g., jack #1 192.168.1.100 & jack #2 192.168.1.101)

Let's say I want to connect to a VPN on jack #2, but keep access to local resources on jack #1. (i.e, jack #1 192.168.1.100 & jack #2 VPN assigned 10.246.10.100)

In this example, I would want all internal traffic (to and from 192.168.*) to be routed through jack #1 and all other traffic routed through jack #2.

I hope this clears up my situation more.

user3033

Posted 2009-07-20T17:40:47.987

Reputation: 193

You just want to build it into a router/firewall, standing between your internet connection and your home network? – Stefan Thyberg – 2009-07-20T17:44:40.457

Unfortunately my problem is not is not that easy hehe. I've updated my post to hopefully clear up my situation. Thank you for your comment. – user3033 – 2009-07-20T18:02:12.520

Answers

2

This can definitely be done using the route command. I wish I could offer exact advice on how to use it but I haven't used it in 14 years. it should be something like this

Set the default route to the first ethernet (assuming eth0) using the GUI, then:

route add -net 192.168.0.0 netmask 255.255.0.0 dev eth1

This assumes that eth1 is where the vpn traffic will go (I think)

To view the routes that you have set up use netstat -rn

This can get quite complicated very quickly. You might get a better answer if you ask at serverfault.com on how to use the route command.

If you really want to learn how to do this, it would be covered in TCP/IP Illustrated, Volume 1: The Protocols which is an excellent, very technical book.

Bruce McLeod

Posted 2009-07-20T17:40:47.987

Reputation: 5 490

1

In newer versions of OSX you can turn on Internet Sharing from the System Preferences.

Update

After reading the poster's update, the above wouldn't work. You're looking at advanced routing for which I'd have to point you into the console. Open up Terminal and give these a read:

  • man route
  • man netstat
  • man ifconfig

Beyond that, I don't know of a tool for doing this within the GUI outside of the OSX built in tools which don't allow for specific route addition.

Jack M.

Posted 2009-07-20T17:40:47.987

Reputation: 3 133

1

What is your VPN subnet?
if it is 10.246.0.0/16 for example, you could setup the default route through interface on jack #2.

nik

Posted 2009-07-20T17:40:47.987

Reputation: 50 788