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

My computer has 2 IP Addresses, one is and the other is 78.x.x.x.

If connecting to a socket, what IP address would a program outside of my network use, and how would it differentiate between two computers on my network?

Isn't the "real" IP address, that of my router, and since two computers on my network share the same router, how can a socket program beyond my router properly form an IP Address to reference say my desktop computer, vs my laptop computer, in the same intranet?

share|improve this question

migrated from Feb 12 '10 at 19:07

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

this is a question about home networking and how NAT works. it may be a duplicate but it should not be migrated to ServerFault. – quack quixote Feb 12 '10 at 20:46
I think this question needs to stay on Super User because it deals within home networking as it is currently written. – Troggy Feb 14 '10 at 4:42

Port forwarding is the answer.

Network Address Translation (NAT) is what allows you to have one public (WAN) IP address and many private (LAN) ip addresses. As your computers initiate network connections to the internet, something like port forwarding is done on the fly. Ports are opened and closed, redirected and reused. Some applications like bittorrent clients, will use Universal Plug and Play (UPnP) to set up a semi-permanent port forwarding that allows external hosts to connect directly to your computer inside your LAN.

Specific services that need permanent open ports need to be manually specified in your router.

The 78... address is public. The idea is that in your router's configuration, you set up port forwarding. There will be a section where you enter the external port, the internal IP address and internal port.

Here is a fuller description of what port forwarding is.

So assuming the socket you want to use opperates on port 3389 (which is microsoft RDP), you set up in the router so that all connections to get directed internally to

share|improve this answer

You need to setup port forwarding on your router.

  1. Login to your router's web interface (it would be on your router)
  2. Go to 'Advanced Routing' or 'Port forwarding'
  3. Set the range of ports you want to use forwarding on (ie. 10,000 to 10,100)
  4. Set the target address to forward the traffic to (it would be your internal ip addr,
  5. Save & thats it.
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .