Routing – How Can Multiple Devices Share an IP Across the Internet?

iplannat;routingwan

I do realize that most LANs sit behind a device running NAT, which translates the users private IP address to a public IP address. My question is still if you are trying to connect to a private device, how does the internet know which private IP you are connecting to, since many LANs have the possibility of using that IP address? Is it that you can only connect using the public IP address?

Best Answer

In order for some device on the internet to connect inbound to a device on your private network you must use a NAT configuration. On residential equipment like a cable modem/router this is often referred to as port-forwarding. Think of it this way. If you are using a single public IP address and sharing it between several private addresses, you must tell the cable modem/router that if I receive a connection on the public IP address on TCP port 80, then that should go to the private address of x.x.x.x on port 80 (or any port you want really). This gives the modem/router enough information to successfully deliver the packets to the internal device from a device out on the internet.

Related Topic