Question

Cannot open port via iptables nor ufw

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

Show comments

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

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!

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!

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.