Cannot open port via iptables nor ufw

Posted December 9, 2015 9.9k views
Linux BasicsUbuntuNetworkingFirewall

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

1 comment

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.

Submit an Answer
3 answers

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!

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:


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.