IPTABLES blocking traffic outbound to a specific IP | iptables block ip hosts outbound

I was in a situation today where an application was talking to hosts it shouldn’t have. A quick way to stop this from happening was with iptables. Make sure you ping the host first before the rule and after to ensure it has taken affect.

The rule to block a specific IP is

To check the rule is in,

To remove the rule, the ‘1’ means the first line in the table, in this case this was the only outbound rule.

 

 

One thought on “IPTABLES blocking traffic outbound to a specific IP | iptables block ip hosts outbound”

Leave a Reply

Your email address will not be published. Required fields are marked *