Report this

What is the reason for this report?

Cannot open port via iptables nor ufw

Posted on December 9, 2015

Hi, I am trying to open port 53589 to start a taskwarrior server. I did this:

sudo iptables -I INPUT -p tcp -m tcp --dport 53589 -j ACCEPT

and this:

sudo ufw allow 53589/tcp

I start the server, but it does not seem to work. I tried to connect via telnet to test the port, but still nothing

telnet my.domain 53589

when I try to connect to port 80 or 22 it works

I am on Ubuntu 15.04



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I had a similar issue on a 14.04 droplet last week. The problem ended up being that the new ALLOW iptables rule was being run after the DROP input rule. I did the following:

iptables-save > iptables_rules.txt

Edit iptables_rules.txt and find this line:

-A INPUT -j DROP

Add your rule right above it:

-A INPUT -p tcp -m tcp --dport 53589 -j ACCEPT

Make sure that you remove it from later in the file. Save the file and reload your iptables rules:

iptables-restore < iptables_rules.txt

For good measure I like to do a service iptables restart

I hope that helps!

so, very sorry, but the “problem” was at our internal firewall at the office. I asked the system administrator, and he was like “of course it is it is closed”. thank you for the answers tho.

Doesn’t work is not a helpful statement. What did you do, what was the expected result, and what did you see instead? Was there an error? Be specific!

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.