Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

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 want to add whitelist in my system using iptables. So I searched the web and find this:

iptables -I INPUT -s -j ACCEPT
iptables -I INPUT -s -j ACCEPT
iptables -I INPUT -s -j ACCEPT
iptables -P INPUT DROP

and it really works. So I fire iptable -F to delete all rules, then I cannot connect to this server anymore.

What's wrong?

What is the correct way to delete all rules ?

share|improve this question
up vote 4 down vote accepted

the chain policy for INPUT is set to DROP.

In absence of any rules, everything gets discarded.

before nuking all the chains, ensure all chains have a policy of ACCEPT a la iptables -P INPUT ACCEPT

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.