I am not able to connect my raspberry pi to the internet from VNC. I am getting this error message: "The port on which the computer is listening for a connection could not be contacted".

There are a lot of tutorials available which tells how to do port forwarding. I have followed in below way: 1.Make static IP for Raspberry pi in my router. 2.Forwarded port number 5900 internal and external 3.created DDNS from my router

I have even enabled DMZ to allow all traffic to raspberry It is able to connect to raspberry pi when I am on the same network but couldn't connect via the internet. When checking whether any of ports are opened using http://www.portchecktool.com/ it is always showing as connection timed out.

My question is whether I am doing any mistake in the above procedure or am I missing something to understand in port forwarding. If my ISP is blocking how can I find it. I know that I may use weaver or remote3it to connect but just trying to understand what is wrong with this procedure. Any Help!

  • You've done some good basic checks. Have you confirmed whether any other ports besides 5900 are visible using portchecktool.com (it's not clear from your post)? This might help determine whether the problem is with VNC, or your RPi setup in general. (And of course, be sure to secure any that you do expose!) – bobstro Jan 25 '17 at 15:44
  • Thank you for the reply. yes I have checked and even ports apart from 5900 are not opened. – BhanuReddy Jan 27 '17 at 2:58
  • It would be great if Stack exchange asks for the reason of downvote, just to understand view point of downvoter. – BhanuReddy Jan 27 '17 at 3:03
  • Agreed, although nothing stops the downvoter from leaving a comment as courtesy. It's hard for the OP to know what to fix otherwise. – bobstro Jan 27 '17 at 15:00

Okay, whats going on here is probably that your ISP is using NAT, and the IP address your router has is in the private range. The only way to get it to work without a VPN or some other tunneling*, is to ask your ISP to assign you a public IP address. Some ISPs do this for an extra fee, some for free and some just don't.

*ngrok is one such provider, there are others, and may or may not suit your purposes.

  • Thank you for the answer. I have not contacted my ISP on this. Maybe I will try using ngrok and update here. – BhanuReddy Jan 27 '17 at 3:01
  • it has worked with ngrok. – BhanuReddy Jan 31 '17 at 12:44
  • try curl ifconfig.me and see if that's the IP you are trying to connect to – Hunter Akins May 8 '18 at 23:54

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