From: Aleksandar Milivojevic <amilivojevic@pbl.ca>
To: netfilter@lists.netfilter.org
Subject: Re: 2 NICs on same subnet
Date: Fri, 05 Nov 2004 08:47:14 -0600 [thread overview]
Message-ID: <418B9272.8040706@pbl.ca> (raw)
In-Reply-To: <20041105123843.GB11016@zion.homelinux.com>
Sven Schuster wrote:
> Hi everybody,
>
> I have a problem which I'm quite sure can be resolved easily, but
> at the moment I'm lacking the "how" :-)
> I have a machine (RH ES 3) with two Intel e1000 cards attached to
> a gigabit switch, each interface is assigned an IP address on the
> same subnet (say 1.2.3.4 on eth0 and 1.2.3.5 on eth1).
> What's happening is that if a connection to either of these addresses
> is made, it's always received via the same interface (eth1 most of the
> time), and the replies go out via this interface, too. But what I'd
> like is that packets to 1.2.3.4 come in via eth0 and packets to 1.2.3.5
> come in via eth1 and that replies from 1.2.3.4 leave via eth0, from
> 1.2.3.5 via eth1.
> I've already tried to resolve this issue with arptables, doing
Probably not easilly solvable. The thing is that both interfaces are
valid for sending responses out. So the kernel will probably use the
first where it gets the match (not sure about exact algorithm, so it may
as well be the last, or random).
Anyhow, said that, there are couple of things to try out.
For incomming packets, I do remember that there's kernel option to
instruct Linux kernel to send ARP responses from matching interface,
instead of interface ARP request was made on (ARP request is broadcast,
so both interfaces will get it, and by default Linux doesn't send from
"matching" interface). This way, client will get correct MAC address,
and switch will send packets down the correct wire. Might help, but on
the other hand it might not.
For outgoing packets, mark packets in INPUT chain of mangle table with
different marks depending if source is 1.2.3.4 or 1.2.3.5. Than you can
use fwmark with Linux Advanced Routing (see examples in howto,
http://www.lartc.org/lartc.txt, chapter 11) to route packets to eth0 or
eth1 depending on the fwmark. Should work (tm).
--
Aleksandar Milivojevic <amilivojevic@pbl.ca> Pollard Banknote Limited
Systems Administrator 1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB R3T 1L7
next prev parent reply other threads:[~2004-11-05 14:47 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-05 12:38 2 NICs on same subnet Sven Schuster
2004-11-05 12:41 ` Marc Haber
2004-11-05 12:54 ` Sven Schuster
2004-11-05 13:04 ` Marc Haber
2004-11-05 14:22 ` Sven Schuster
2004-11-05 14:52 ` Lumberjack
2004-11-05 15:25 ` Jason Opperisano
2004-11-05 15:32 ` John A. Sullivan III
2004-11-05 14:12 ` Jason Opperisano
2004-11-05 14:47 ` Aleksandar Milivojevic [this message]
2004-11-05 14:51 ` Aleksandar Milivojevic
2004-11-05 17:07 ` a.ledvinka
-- strict thread matches above, loose matches on Subject: below --
2004-11-05 13:00 Scott Knake
2004-11-05 13:21 ` Sven Schuster
2004-11-05 18:45 Daniel Chemko
2004-11-05 19:16 ` Sven Schuster
2004-11-05 23:37 ` Jorge Nerín
2004-11-06 0:05 ` George Alexandru Dragoi
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=418B9272.8040706@pbl.ca \
--to=amilivojevic@pbl.ca \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox