Drop all outgoing traffic with linux iptables to destination port 80 / http / www
Posted on December 26th, 2007 by linux
To block all outgoing traffic to the port 80 ( http, www, html ) use command:
iptables -A OUTPUT -p tcp –dport 80 -j DROP
To remove all iptables rules use command:
iptables -F
Sometimes you need to DROP all port 80 ( http, www, html ) traffic except certain IP address. In this case you ca run:
iptables -A OUTPUT -d <your ip address> -p tcp –dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp –dport 80 -j DROP
Filed under: Administration, Linux, Networks, Security