(E-Mail Removed) (data) wrote in message news:<(E-Mail Removed) om>...
> Hi,
>
> My setup is like this:
>
> eth0 = 10.10.5.5/24
> eth1 = 192.168.5.5/24
>
> When i try to send a hping to a host via eth1:
>
> /usr/sbin/hping 10.10.5.8 -1 -I eth1 -c 2
>
> the ICMP requests go through eth0, but the ICMP reply is received on
> the eth1 interface.
> - How to forcibly send the packet via eth1?
> - Is there a way to bypass the linux routing table?
>
> TIA.
This is "standard" Linux behavior -- the IPs attach to the host (main
route table), not to the interface, so Linux uses the "handiest"
interface. You pinged 10.10.5.8/24 so it sent out through the
interface on the same subnet. But you told hping to use eth1 -- which
is where the reply came. Sounds like the handiest route to 10.10.5.8
was via the interface on 10.10.5.0 -- are you really surprised?
As D.E. suggests, look at the lartc howto and several others to get a
good picture of how Linux handles IP. It's possible to associate an
interface with a particular route table, but maintainence is no fun
unless you really need it. See policy routing.
hth,
prg
email above disabled