Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

After installing Centos 5.8 I could not pick up any open ports using nmap. So I ran the command #iptables --flush and all started working. However, after about 2 days I could not connect again and had to run the command.

1)How can I permanently ensure that my ports are open

2)What could be causing them to be shut in the first place since I did not touch the iptables?

share|improve this question

3 Answers 3

up vote 4 down vote accepted

Configure the firewall to open only the ports that you need to have open. Disabling the firewall entirely is very dangerous. You can use the system-config-firewall-tui command to configure it from a terminal.

share|improve this answer
    
This is definitely a smart answer. Never disable the firewall if you value the internet at large. Even if you have no assets on your machine you will still open the door for attackers to use your box in a botnet or as a spam agent. –  gillytech Jun 23 at 4:41

I think you're running into the default firewall. Try these:

service iptables stop
chkconfig iptables off
share|improve this answer

The easiest way is to disable iptables:

service iptables save
service iptables stop
chkconfig iptables off

and for IPv6

service ip6tables save
service ip6tables stop
chkconfig ip6tables off
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.