Koozali.org formerly Contribs.org

iptables block ports


iptables block ports
« on: March 16, 2004, 11:50:10 PM »
I am running SME 5.6.  I want to know how to block all ports, then enable just the basics like 80, 443, 21, etc.  

How can I make a custom iptables rule to accomplish this feat?


Lars Kjeldsen

Try this.
« Reply #1 on: March 17, 2004, 12:36:23 AM »

Go to this path and open the masq


Find this string:

# Adjust all inbound TCP connection rules

And add this string efter the line above.

adjust_tcp_in 23 denylog InboundTCP_$$

Do that with all ports you want to close.

after that enter this command in the shell:

service masq restart

 Regards Lars Kjeldsen


iptables block ports
« Reply #2 on: March 17, 2004, 01:07:12 AM »
What if I want to block all ports, then allow 80, 443, etc?