disable local routing between eth0 and eth1 - iptables



I've a Linux PC with 2 NICs eth0 and eth1 configured with IP 10.0.0.1
and 20.0.0.1 respectively.

|-------------------|
eth0 (10.0.0.1) ------------| |
| L2 SWITCH |
| |
eth1 (20.0.0.1) ------------| |
|-------------------|

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.

Similarly, whenever I ping 10.0.0.1 from PC console, ICMP packets
should come out of interface eth1 and should reach eth0 through
connected switch.

How can I do it using iptables, if at all possible?

Thanks in advance.
.



Relevant Pages