netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* function for getting the source ip defined in the routing table
@ 2014-05-20 12:46 Andreas Herz
  2014-05-20 14:03 ` Jan Engelhardt
  0 siblings, 1 reply; 10+ messages in thread
From: Andreas Herz @ 2014-05-20 12:46 UTC (permalink / raw)
  To: netfilter-devel

Hi,

i was looking for a function to get the source ip that is defined in the
routing table. I looked into the MASQUERADE module but the
"inet_select_addr" function returns the source ip from the interface
(the first one, in most use cases).

See the following routing table entry:

10.0.13.0/24 dev eth1  proto kernel  scope link  src 10.0.13.4

while the interface has multiple IPs:

    inet 10.0.12.1/24 scope global eth0
    inet 10.0.13.2/24 scope global eth0
    inet 10.0.13.4/24 scope global secondary eth0

So what i want is the value of the src part in the routing table (for connections to the related network).

thanks.

-- 
Andreas Herz

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-06-03  7:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-20 12:46 function for getting the source ip defined in the routing table Andreas Herz
2014-05-20 14:03 ` Jan Engelhardt
2014-05-20 14:18   ` Andreas Herz
2014-05-20 15:38     ` Maciej Żenczykowski
2014-05-21  8:36       ` Andreas Herz
2014-05-21 17:06         ` Maciej Żenczykowski
2014-05-21 17:07           ` Maciej Żenczykowski
2014-05-22  9:11           ` Andreas Herz
     [not found]             ` <CAJ26g5T1Ugfy-tfeFUBWABLrwuNkG26V7u=SvF6cr9pFwkGobA@mail.gmail.com>
2014-05-22 10:31               ` Andreas Herz
2014-06-03  7:55   ` Andreas Herz

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).