Quickzi: How To Block Incoming Access to Port 80
Here is a quick Linux tip to block incoming access to port 80 using iptables.
iptables -A INPUT -j DROP -p tcp --destination-port 80 -i eth0
The code above will drop all tcp packets coming into your Linux computer on device eth0 on port 80. If your Internet connection runs through a device other than eth0, go ahead and make the adjustment.
To remove the iptables rule use the following code:
iptables -D INPUT -j DROP -p tcp --destination-port 80 -i eth0
For more information on using iptables visit the iptables man page.
Popularity: 6% [?]
Filed under: Linux
Like this post? Subscribe to my RSS feed and get loads more!