All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martijn van Oosterhout <kleptog@svana.org>
To: Alpt <alpt@freaknet.org>,
	netfilter@lists.netfilter.org, linux-net@vger.kernel.org
Subject: Re: Different routes for different src addresses
Date: Wed, 7 Jul 2004 22:39:39 +1000	[thread overview]
Message-ID: <20040707123930.GD17226@svana.org> (raw)
In-Reply-To: <20040707120502.GA23120@nihil>

[-- Attachment #1: Type: text/plain, Size: 1114 bytes --]

On Wed, Jul 07, 2004 at 02:05:02PM +0200, Alpt wrote:
> Hi all,
> is it possible to create a route for a single src address?
> For example these are some routes I'd like to use: 
> 
> 1) "All the pkts coming from hostA with dst=hostX are routed to eth1".
> 2) "All the pkts coming from hostB with dst=hostT are routed to eth0"
> /*Normal routes start here*/
> 3) "All the pkts (that are not pkts of type 1) and 2)) with dst=hostX
> are routed to eth3"
> 4) "All the pkts (that are not pkts of type 1) and 2)) with dst=hostU
> are routed to eth2"
> 5) And so on...

Lookup ip rules, you can do something like:

ip rule add from hostA table tableA
ip rule add from hostB table tableB

ip route add hostX dev eth1 table tableA prio 500
ip route add hostY dev eth0 table tableB prio 501

etc...

Hope this helps,
-- 
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

  reply	other threads:[~2004-07-07 12:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-07-07 12:05 Different routes for different src addresses Alpt
2004-07-07 12:39 ` Martijn van Oosterhout [this message]
2004-07-07 13:10 ` Antony Stone
2004-07-07 21:02   ` Nick Taylor
2004-07-07 21:36     ` Antony Stone
2004-07-08  5:52       ` Alpt
2004-07-07 14:38 ` John A. Sullivan III

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=20040707123930.GD17226@svana.org \
    --to=kleptog@svana.org \
    --cc=alpt@freaknet.org \
    --cc=linux-net@vger.kernel.org \
    --cc=netfilter@lists.netfilter.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.