Search code examples
network-programmingblockiptables

iptables rules work only for me


I need to block this ip 188.43.64.80.

iptables -A OUTPUT -p ALL -d 188.43.64.80 -j DROP

This rule work for my local computer - i can't ping this ip.

But it's not working for computers which connected to me - they can ping this ip.

How can I make this rule to work in my network?

My network preferences - Internet from eth0.
Network from wlan0.


Solution

  • It's in the OUTPUT chain, which only affects packets that this machine is outputting. You want to add a similar rule to the FORWARD chain which affects packets this machine is forwarding.