From: "David S. Miller" <davem@davemloft.net>
To: ak@suse.de
Cc: qwejohn@gmail.com, netdev@vger.kernel.org
Subject: Re: determine outgoing interface (eth0,eth1) for a packet according to the dest IP
Date: Tue, 25 Apr 2006 00:58:31 -0700 (PDT) [thread overview]
Message-ID: <20060425.005831.64868698.davem@davemloft.net> (raw)
In-Reply-To: <200604250943.49422.ak@suse.de>
From: Andi Kleen <ak@suse.de>
Date: Tue, 25 Apr 2006 09:43:49 +0200
> On Tuesday 25 April 2006 09:31, John Que wrote:
> > Hello,
> > What is the right way to determine on which interface card
> > (eth0 or eth1) will a packet be sent (according to the dest IP)?
>
> You can send a rtnetlink RTM_GETROUTE message to ask the kernel.
> Result is the interface index in RTA_OIF, which can be converted
> into a name.
That scheme does not handle netfilter nor packet scheduler
classifier mangling and redirection of the packet.
next prev parent reply other threads:[~2006-04-25 7:58 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-25 7:31 determine outgoing interface (eth0,eth1) for a packet according to the dest IP John Que
2006-04-25 7:43 ` Andi Kleen
2006-04-25 7:58 ` David S. Miller [this message]
2006-04-25 14:44 ` John Que
2006-04-25 14:48 ` Andi Kleen
2006-04-26 10:24 ` John Que
2006-04-26 13:58 ` Herbert Xu
2006-04-30 9:17 ` Lennert Buytenhek
2006-04-30 12:55 ` Herbert Xu
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=20060425.005831.64868698.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=ak@suse.de \
--cc=netdev@vger.kernel.org \
--cc=qwejohn@gmail.com \
/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;
as well as URLs for NNTP newsgroup(s).