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

I want to add whitelist in my system using iptables. So I searched the web and find this:

iptables -I INPUT -s 10.0.0.0/8 -j ACCEPT
iptables -I INPUT -s 127.0.0.1/8 -j ACCEPT
iptables -I INPUT -s 192.168.0.0/16 -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

1 Answer 1

up vote 3 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

 
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.