This question already has an answer here:

I have created vm instance in gcloud. And setup firewall rule to allow connection from port 5000.I added network tag to my vm instance.

But if i test the connection by teneting to port 5000 I get

telnet: Unable to connect to remote host: Connection refused

Content of netstat -lnp


marked as duplicate by Michael Hampton Nov 17 '18 at 13:57

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


From your netstat output there is nothing listening on the port 5000 so connection is refused.

  • I am using ubuntu-server 16.04. I tried sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT With No luck – Navigator Nov 17 '18 at 9:26
  • I tried **sudo iptables -A INPUT -p tcp --dport 5000 -j ACCEPT ** with no luck. The content of netstat still not showing port 5000 listening. I am using ubuntu 16.04 – Navigator Nov 17 '18 at 9:29
  • Any Idea how to resolve this? – Navigator Nov 17 '18 at 9:30

Not the answer you're looking for? Browse other questions tagged or ask your own question.