On Wed, 7 Dec 2005 15:47:00 -0000 "Paul Lewis"
<[EMAIL PROTECTED]> wrote:

>Hi,
hi

>I have a linux router with 4 ethernet cards; eth0 through eth3. Basically,
>all I want to do is route all traffic from eth2 to eth0, and all traffic
>from eth1 to eth3.
This is easy, just set up 2 new routing tables and add rules to assign the
packets to the correct one.

Let's say you have
eth0: 1.2.0.2/30 (gateway 10.2.0.1)
eth1: 192.168.0.1/24
eth2: 192.168.1.1/24
eth3: 1.3.0.2/30 (gateway 10.3.0.1)

Then you do something like:

ip rule add from 192.168.0.0/24 table 101
ip rule add from 192.168.1.0/24 table 102
ip route add 192.168.0.0/24 dev eth1 table 101
ip route add 192.168.1.0/24 dev eth2 table 101
ip route add 127.0.0.1/8 dev lo table 101
ip route add default via 10.3.0.1 dev eth3 table 101
ip route add 192.168.0.0/24 dev eth1 table 102
ip route add 192.168.1.0/24 dev eth2 table 102
ip route add 127.0.0.1/8 dev lo table 102
ip route add default via 10.2.0.1 dev eth0 table 102

(it's likely I forgot some detail or have a typo there, it's just an example)

>Paul
Yours sincerely,
Peter

-- 
http://www.shurdix.org - Linux distribution for routers and firewalls
_______________________________________________
LARTC mailing list
[email protected]
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

Reply via email to