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

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
iptables -P OUTPUT ACCEPT
iptables -P FORWARD 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

1 Answer 1

up vote 0 down vote accepted

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


*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
COMMIT

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 mxtoolbox.com/… –  Lucas Rodrigues Sena Apr 13 '13 at 14:02
    
is 184.171.253.138 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

 
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.