lkml.org 
[lkml]   [1999]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Do Routing-policies have effect on local-originated packets?
Andi Kleen wrote:
>
> adsmail@htl.de (Andreas Scherbaum) writes:
> >
> > Here's a tcpdump (sending a nameserver request to the second ip ...)
> > $ host 192.168.0.1 192.168.0.201
> >
> > # tcpdump -p -i eth1:
> > 18:13:59.988575 192.168.0.15.1128 > 192.168.0.201.domain: 34740+ (28)
> > 18:14:00.036535 192.168.0.15.1128 > 192.168.0.201.domain: 34741+ (28)
> >
> > # tcpdump -p -i eth0:
> > 18:14:09.514938 192.168.0.201.domain > 192.168.0.15.1128: 16413 1/3/3
> > (161)
> > 18:14:09.570556 192.168.0.201.domain > 192.168.0.15.1128: 16414 0/1/0
> > (81)
> >
> > Why is the kernel sending this packages trough the first interface and
> > how can i change it to using the right interface?
>
> Because the kernel does not know that the incoming packet and the outgoing
> packet are in any way related (UDP has no connection between packets, it
> is all in above layers if at all). The routing table doesn't say anything
> about it. So the only way to get the semantics you want is to change bind
> to receive the incoming interface with the IP_PKTINFO cmsg, look at the
> ipi_ifindex and set it for outgoing packets on the same conversation to the
> same interface.

But why is this relevant for policy-routing? The kernel sees: the local
packet has source-ip e.g. 192.168.0.2, then he looks at the rules...
rules say sth like: "from 192.168.0.2 table 20", and table 20 says route
through eth2
or the source-ip is 192.168.0.3... rules say "from 192.168.0.3 table
30", table 30 says route through eth3

So where´s the difference between TCP and UDP here? am I missing sth?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:55    [from the cache]
©2003-2011 Jasper Spaans