Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried to open port 8605 on my server (used for socket connections) using:

iptables -I INPUT 2 -s 0/0 -p tcp --dport 8605 -j ACCEPT

However the change is not persisting, the port closes itself once a day (I assume something is being regularly reloaded).

How can I make my change persist?


Despite saving it, the change does not persist, each day it needs to be corrected.

Crontab does not seem to have any obvious changes, and the server is not restarting. Any ideas?


I found out that iptables was running under apf - advanced policy firewall so I needed to updated the rules in there.

share|improve this question
Kind thanks to all the answers, I have performed a save and will update if this doesn't resolve the problem. – Nick Oct 13 '09 at 14:23
up vote 8 down vote accepted

If your system is fedora-derived add the rule in /etc/sysconfig/iptables.

If you have already added your rule you should simply do a service iptables save.

You can always do
- service iptables save
- edit /etc/sysconfig/iptables as you need
- service iptables restart

share|improve this answer

You should mention if you are using RedHat or a Debian based system. With redhat / Centos, the service iptables save command should work.

share|improve this answer

When you call iptables, you're changing the rules that are running, but that information isn't stored anywhere to be re-applied. To do that, you want to execute iptables statements on load. If you're not rebooting your server every day, I don't know what's resetting iptables, but there are lots of packages to help you by being useful front-ends. Ubuntu has ufw, RH/Fedora-based distros have system-config-securitylevel, and there are dozens of others. These typically apply the change and persist it to a script for when things are next reloaded.

share|improve this answer

Your Answer


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.