David Schwartz <(E-Mail Removed)> wrote:
> On May 27, 5:44?am, astoni...@yahoo.com wrote:
> > I want to disable local routing between eth0 and eth1 so that
> > whenever I ping 20.0.0.1 from PC console, ICMP packets should come
> > out of interface eth0 and should reach eth1 through connected
> > switch.
> I don't believe it's sensible or possible. Linux uses a model where
> IP addresses are assigned to machines, not to interfaces.
It can be quite sensible - Linux's very braod application of the weak
end-system-model doesn't match all desires.
IIRC actual IP forwarding _is_ disabled by default in Linux - however,
you can check sysctl -a | grep forward to see the current setting and
what might need/want to be changed. On most (?) distros you would
then edit /etc/sysctl.conf to make that "stick" across reboots.
The weak-end-system-model that Linux employs extends to ARP. As such,
the ARP code is more than happy to send an ARP reply for any local IP
out any interface. So, if you check your local ARP tables on the
system from which you are sending pings you will probably find that
the IP for the one interface is associated with the MAC (ethernet)
address of the other.
So, when you connect two interfaces to the same switch, even if you
configure them in separate IP subnets, you have no idea which one will
be given-out in the ARP replies.
There are at least two ways to deal with the issue, you can use one,
the other, or even both.
If you sysctl -a | grep ignore and then set the default version of
that sysctl to "1," on the next ifconfig's (ie after a reboot) it
should propagate to all the interfaces. Or, if you don't want to
bounce the system you can set the interface specific ones by hand and
just put the default one into the sysctl.conf file.
The other option which could deal with this issue is to use VLAN's -
this would need to propagate through your entire broadcast domain
(sets of switches and hosts on the same (logical) side of a router).
You would then have in effect more than one LAN - in the context of
the OP's diagram it would be as if eth0 and eth1 were connected to
separate switches which were not bridged at layer two. That deals
with the problem by avoiding eth0 seeing ARPs for the IP of eth1 and
vice versa.
rick jones
--
portable adj, code that compiles under more than one compiler
these opinions are mine, all mine; HP might not want them anyway...

feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...