netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "John Que" <qwejohn@gmail.com>
Cc: netdev@vger.kernel.org
Subject: Re: determine outgoing interface (eth0,eth1) for a packet according to the dest IP
Date: Tue, 25 Apr 2006 16:48:09 +0200	[thread overview]
Message-ID: <200604251648.10113.ak@suse.de> (raw)
In-Reply-To: <ada605fb0604250744w73c7766as1d3ceb0d62511764@mail.gmail.com>

On Tuesday 25 April 2006 16:44, John Que wrote:
> Thanks a lot !
> 
>   I had tried the sending RTM_GETROUTE message using a NETLINK_ROUTE
> 	socket in a User Space program and it went OK.
> 	
> 	It gaves correct routing struct which I could parse.
> 	In fact it gave the rotuing table.
> 	But in sending that message I did not specify a certain
> 	dest IP.
> 	Consider the follwing simple scenario: I have 2 gateways
> 	(one on eth0,one on eth1), and I am sending
> 	a packet to some dest IP ; I want to know according to
> 	that ip on which interface (or gw) it will be out
> 	
> 	But where do I specify that certain dest IP ?

You add RTA_SRC and RTA_DST attributes to the query.

-Andi

  reply	other threads:[~2006-04-25 14:48 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
2006-04-25 14:44   ` John Que
2006-04-25 14:48     ` Andi Kleen [this message]
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=200604251648.10113.ak@suse.de \
    --to=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).