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

How to control on which interface linux replys incoming connections?

I mean : 
 i have machine with two interfaces, say eth0 and eth1, 
 called eth0 and eth1,
default route is on eth0.
when I ping eth0 from machine on eth0's side of network, it replies,
 when I ping eth1 from .. on eth0's it replies,
 when I ping eth0 from machine on eth1's side, it replies,
 but when I ping eth1 from machine on eth1's side.. it doesen't!

it look's like ping's come to my machine, but it replies
 to them with source address of eth0's interface.

situation changes when i set default route to route via eth1.
then eth0's side can't ping eth0.

when I try:
  route add default gw eth0's-gw metric 1
  route add default gw eth1's-gw metric 2

it stop's replaying to anyone besides it's networks 
 (eth0's and eth1's net)

This is something really strange to me, I don't know what to do.
i would like linux to reply to requests from eth0 with it's source address
 and to eth1 with it's own adress.

regards, Dariush Pietrzak

Reply to: