I wrote a simple server application in C. I managed to establish a connection using telnet. The problem is that I cannot reach the server if I specify public instead of local ip in telnet. I mean this worked

telnet 20600

while this didn't

telnet 20600

I read around the web this is a NAT configuration problem, but port 20600 seems to be open (according to http://www.canyouseeme.org/ and http://www.yougetsignal.com/tools/open-ports/). Besides I disabled firewall, so it can't be the cause of the failure...

Any help?

  • What's your network topography like? Can you ping the box at Is it the same machine as the one at Are you using the same client for both requests?
    – nmichaels
    Apr 5, 2011 at 20:27
  • You didn't show any of your server's code. Are you binding to all the right interfaces when you listen? Apr 5, 2011 at 20:29
  • I have two notebook and a desktop connected to a router. No problem in pinging Yes, is the local ip. Yes, I'm using telnet for both.
    – al fred
    Apr 5, 2011 at 20:36
  • do you get connection refused? or does it simply wait and then fail?
    – IanNorton
    Apr 5, 2011 at 21:06
  • Connection refused
    – al fred
    Apr 6, 2011 at 7:13

3 Answers 3


A typical home NAT is designed to ensure that outbound connections can communicate with outside endpoints. By default, a home NAT does not forward ports on the external interface (e.g., from your cable modem provider) to your dev box.

You'll need to configure your NAT to forward inbound connections on port 20600 to This is often called "port forwarding". Check out http://portforward.com/ for detailed guides for most hardware options.

Questions about that details of configuration would be more suitable for http://superuser.com.


Is your machine behind a router? or is it THE router?.

You will usually need to setup a port forwarding rule to allow public traffic to port 20600 on your router to be redirected to

  • is behind the router. I already forwarded port 20600 to
    – al fred
    Apr 5, 2011 at 20:56

I'll put on my psychic hat and guess at what's happening here.

You have a client, say, and you can connect just fine from it to But when you try to connect from it to the external IP of your NAT router, you don't get anything. This is because you're on the inside of the NAT router and it is both cheap and not configured for this sort of thing. In order to verify that your server can be reached from outside your network, you have to try to reach it from outside your network.

Go to a friend's house and try to connect. If it doesn't work, make sure you've set up port forwarding properly on your NAT device. If it still doesn't work, ask a new question here and post some code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy