Bug 14007 - iproute2: socket lookup after policy-based local route returns "connect: Invalid argument"
Summary: iproute2: socket lookup after policy-based local route returns "connect: Inva...
Status: CLOSED INVALID
Alias: None
Product: Networking
Classification: Unclassified
Component: IPV4 (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Stephen Hemminger
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-19 08:55 UTC by Markus
Modified: 2014-08-12 19:29 UTC (History)
3 users (show)

See Also:
Kernel Version: 2.6.31
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Markus 2009-08-19 08:55:43 UTC
I want to add policy based routes to my local machine similar to the iptables redirect command. With this it is possible to redirect connections without losing the destination ip.
So i tried to add an route of type local to another routing table then table local:

sudo ip route add local 192.168.33.0/24 dev eth0 table local
ping 192.168.33.1 -c 1
#working

sudo ip route add local 192.168.34.0/24 dev eth0 table main
ping 192.168.34.1 -c 1
#connect: Invalid argument

The first one is working, the secound one not. The only difference is another routing table. icmp is only an example, tcp and udp doesnt work neither.

I guess somewhere in the socketlookup linux checks the destination ip with the local routes only in the local table. perhaps the other tables are missed.

btw: i tried it on every linux with iproute2 i found. with no succeed

thanks

Markus
Comment 1 Andrew Morton 2009-08-20 21:36:51 UTC
(switched to email.  Please respond via emailed reply-to-all, not via the
bugzilla web interface).

On Wed, 19 Aug 2009 08:55:44 GMT
bugzilla-daemon@bugzilla.kernel.org wrote:

> http://bugzilla.kernel.org/show_bug.cgi?id=14007
> 
>            Summary: iproute2: socket lookup after policy-based local route
>                     returns "connect: Invalid argument"
>            Product: Networking
>            Version: 2.5
>     Kernel Version: 2.6.31
>           Platform: All
>         OS/Version: Linux
>               Tree: Mainline
>             Status: NEW
>           Severity: normal
>           Priority: P1
>          Component: IPV4
>         AssignedTo: shemminger@linux-foundation.org
>         ReportedBy: markus@selfnet.de
>         Regression: No
> 
> 
> I want to add policy based routes to my local machine similar to the iptables
> redirect command. With this it is possible to redirect connections without
> losing the destination ip.
> So i tried to add an route of type local to another routing table then table
> local:
> 
> sudo ip route add local 192.168.33.0/24 dev eth0 table local
> ping 192.168.33.1 -c 1
> #working
> 
> sudo ip route add local 192.168.34.0/24 dev eth0 table main
> ping 192.168.34.1 -c 1
> #connect: Invalid argument
> 
> The first one is working, the secound one not. The only difference is another
> routing table. icmp is only an example, tcp and udp doesnt work neither.
> 
> I guess somewhere in the socketlookup linux checks the destination ip with
> the
> local routes only in the local table. perhaps the other tables are missed.
> 
> btw: i tried it on every linux with iproute2 i found. with no succeed
>
Comment 2 Bjørnar Ness 2014-08-12 17:37:47 UTC
Why is this closed as invalid? Seem to me it is still valid,
and a explanation why it is invalid would be great.
Comment 3 Markus 2014-08-12 19:29:04 UTC
I don't remember why it was closed, but iirc it should be done with the 
iptables TPROXY extension.

Am 2014-08-12 19:37, schrieb Bjørnar Ness:
> Why is this closed as invalid? Seem to me it is still valid,
> and a explanation why it is invalid would be great.

Note You need to log in before you can comment on or make changes to this bug.