Re: Kernel Routing sequence

From: Al Boldi
Date: Tue Aug 09 2005 - 23:58:30 EST


Marc Haber wrote:
> On Tue, Aug 09, 2005 at 10:38:21AM +0300, Al Boldi wrote:
> > Kernel IP routing table
> > Destination Gateway Genmask Flags Iface
> > 10.0.0.1 0.0.0.0 255.255.255.255 UH eth0
> > 10.0.1.1 0.0.0.0 255.255.255.255 UH eth1
> > 10.0.0.0 0.0.0.0 255.255.255.0 U eth0
> > 10.0.1.0 0.0.0.0 255.255.255.0 U eth1
> > 10.0.0.0 0.0.0.0 255.0.0.0 U eth0
> > 127.0.0.0 0.0.0.0 255.255.255.0 U lo
> >
> > Why does the Kernel route a packet from
> > 10.0.1.2 netmask 255.0.0.0 out to eth1?
>
> Neither packet source address nor netmask do affect the routing
> decision. It is only done based on the target address.
>
> ip route list match <target-address>
>
> is a big helper on systems that have iproute installed.
>

Thanks!

ip route list match 10.0.1.2 reveals:
10.0.1.0/24 dev eth1 proto kernel scope link src 10.0.1.1
10.0.0.0/8 dev eth0 proto kernel scope link src 10.0.0.1

But: ip route list match 10.0.1.2/8 reveals:
10.0.0.0/8 dev eth0 proto kernel scope link src 10.0.0.1

Is it possible to instruct the kernel to use the dest-mask instead of
just letting it assume /32 ?

-
To unsubscribe from this list: 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