Koozali.org formerly Contribs.org

Legacy Forums => Experienced User Forum => Topic started by: wasserja on March 16, 2004, 11:50:10 PM

Title: iptables block ports
Post by: wasserja 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?

wasserja
Title: Try this.
Post by: Lars Kjeldsen on March 17, 2004, 12:36:23 AM
Hi

Go to this path and open the masq

/etc/init.d/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
Title: iptables block ports
Post by: wasserja on March 17, 2004, 01:07:12 AM
What if I want to block all ports, then allow 80, 443, etc?