Linux – How to block all traffic between two interfaces

linux

Let's say I have two interfaces on one host, eth0 and eth1. The behavior I'm seeing currently is:

Receive traffic on eth0, it finds a suitable route on eth1 and tries to send it.

I'm already intercepting the packets coming in on eth0 so I would like to stop this forwarding and drop all packets coming in on eth0 instead of sending them on eth1.

In essence, I'd like to block all traffic between two interfaces on one host. Is this possible with iptables or routing?

Best Answer

iptables -A FORWARD -i eth0 -o eth1 -j DROP should do what you’re requesting.