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 ran all the following commands

iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT

And all ports are still closed, why? how? I can only telnet on localhost.

share|improve this question
Did you check if iptables rules are deleted afterwards? Check the output of iptables -nL and iptables -t nat -nL. It's also possible that iptables is not the reason, but there's just no service listening on the external interface. Check the output of netstat -ntpl . – etagenklo Apr 12 '13 at 19:01
How do you determine that they are closed? Did you actually install a relevant daemon that listens on a port? – Dennis Kaarsemaker Apr 12 '13 at 20:49
Now my port 25 is working, but do not answer the telnet. – Lucas Rodrigues Sena Apr 13 '13 at 18:09
up vote 0 down vote accepted

Try putting this in the /etc/iptables/rules.v4 file:


And running

# iptables-restore < /etc/iptables/rules.v4

Then run

# iptables -L -n -v

to check the result.

share|improve this answer
I will try but my server was down, sorry for delay. – Lucas Rodrigues Sena Apr 12 '13 at 21:43
I did that from SSH and now I cant connect, why? – Lucas Rodrigues Sena Apr 12 '13 at 22:23
Ok I got lucky, I dont know how but linux return response 1 hour later automatically, so thanks for answer, but check this link please… – Lucas Rodrigues Sena Apr 13 '13 at 14:02
is an IP associated to one of your interfaces or are you behind a FW? – dawud Apr 13 '13 at 14:06
This server was located, whit 3 static ips , I have this system working well on VirtualBox, but on virtual box I cant use telnet outside of this server because the virtual box dont give a valid staci debian directly ip. I made a good choice? I Realized a mistake? – Lucas Rodrigues Sena Apr 13 '13 at 14:18

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.