All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Surda <surda@shurdix.com>
To: lartc@vger.kernel.org
Subject: Re: [LARTC] Network Routing
Date: Wed, 07 Dec 2005 15:58:01 +0000	[thread overview]
Message-ID: <20051171658113031@mail.routehat.org> (raw)
In-Reply-To: <E1Ek1VV-0002Zl-02@smtp2.herald.ox.ac.uk>

On Wed, 7 Dec 2005 15:47:00 -0000 "Paul Lewis"
<paul.lewis@st-annes.oxford.ac.uk> 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
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

  reply	other threads:[~2005-12-07 15:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-12-07 15:47 [LARTC] Network Routing Paul Lewis
2005-12-07 15:58 ` Peter Surda [this message]
2005-12-07 17:12 ` Edmundo Carmona
2005-12-07 17:17 ` Edmundo Carmona

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20051171658113031@mail.routehat.org \
    --to=surda@shurdix.com \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.