Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 and Besides I disabled firewall, so it can't be the cause of the failure...

Any help?

share|improve this question

migrated from Apr 9 '11 at 6:50

This question came from our site for professional and enthusiast programmers.

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 '11 at 20:27
You didn't show any of your server's code. Are you binding to all the right interfaces when you listen? – Lightness Races in Orbit Apr 5 '11 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 '11 at 20:36
do you get connection refused? or does it simply wait and then fail? – IanNorton Apr 5 '11 at 21:06
Connection refused – al fred Apr 6 '11 at 7:13

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 for detailed guides for most hardware options.

Questions about that details of configuration would be more suitable for

share|improve this answer

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

share|improve this answer is behind the router. I already forwarded port 20600 to – al fred Apr 5 '11 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.

share|improve this answer

You must log in to answer this question.