Re: Advanced Source Routing using "ip rule add from <x.x.x.x> lookup <table>" returns error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Santosh Gupta <Santosh.Gupta@xxxxxxxxxxxxx> 2005-11-02 21:37
> I am trying to do advanced source routing. My setup is as follows
>  tunnel-client                        tunnel-server
>           ()==============================()
>   eth0    10.3.30.115/16            10.3.30.93
>   eth1    192.168.0.10/24
>   relay   221.221.1.1/32
> 
> "relay" is virtual ppp interface, which encapsulates packets into tunnel
> connecting the tunnel-server at 10.3.30.93.  Both boxes are on 10.3/16 LAN.
> 
> I have a kernel module (code below) which does route lookup using
> ip_route_output(dst, src, 0, 0).
> I have an "ip rule" to send all packets with src ip address 10.81.15.108 to
> lookup into table "rlm". Table "rlm" has only a default route towards "relay"
> device.
> When I do ip_route_output(dst, 0, 0, 0) it succeeds returning next hop as the
> default gw. If I do the lookup specifying the src ip address, the route lookup
> fails.

10.81.15.108 is not a local address so ip_route_output() will fail
because it cannot find the interface the packet is supposed to origin
from. See ip_route_output_slow() for more details. You have to use
ip_route_input() for the above to work.
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux