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 setup a proxy on my server, and allowed only my IP to connect to it via IP tables. The problem is some time at night, something happens and I cannot connect to it anymore.

The only way I can access it again is if I SSH into it and run this:

[root@host ~]# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: mangle filter             [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules:                          [  OK  ]
share|improve this question
Is it squid? Also, what does your ruleset look like? – Rilindo Jul 5 '11 at 2:36
Actually, post your ruleset. That may help us out. – Rilindo Jul 5 '11 at 3:22

Go through your crontab and find what's resetting your firewall.

share|improve this answer
cPanel is running on the system and there are so many cron tabs. Is there a way I can run a 'tracer' to see what program at what time it's being changed? – Nikki Jul 5 '11 at 12:00
There should be cron logs listing what ran when; with a bit of scripting you should be able to narrow down when the offending change occured. Correlate one with the other and the offender should drop out. I'm pretty sure CPanel does firewall management stuff, so yeah... – womble Jul 5 '11 at 14:12

Compare your established and correct rule set with the running rule set to determine if iptables is rejecting your proxy connections.

iptables -L > iptables.conf.orig
#Wait till fault
iptables -L > iptables.conf.error
diff iptables.conf.orig iptables.conf.error
share|improve this answer
The line that I added to accept the connection disappears. – Nikki Jul 5 '11 at 12:01

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.