We all know that PCs on a LAN use private IP addresses such as, etc.

Now my question is, how can a PC say mine having a private address of communicate with other LAN PC having a private address of say because not every PCs have public addresses.

To make it more clear let's say I want to ping to your PC having an IP address

So how will my PC or the router know to which PC it must send the message to as there can be many PCs with that same private IP address of

  • 4
    "We all know that PCs on a LAN use private IP addresses such as etc." That is not completely accurate. Many LANs use private addressing, but many use public addressing, and with IPv6 most will use public addressing to restore IP end-to-end connectivity that NAT breaks, which is the crux of the problem you raise.
    – Ron Maupin
    Aug 2, 2017 at 14:15
  • 1
    There is a situation where multiple devices on the Internet do have the same public IP address. This is Anycast and the most well known implementation is in the geographic distribution of the root nameservers for the Domain Name System. Anycast (in IPv4) takes advantage of internet routing protocols to provide clients access to the best (usually fastest or nearest) node of the group. Aug 2, 2017 at 19:14

4 Answers 4


A PC in a private IP range can't be acccesed from the public internet.

Devices in private range connecting to internet use a proxy or router/NAT device that replaces the local source IP for a single public IP address that redides in your router/NAT.

However, you can make an exception to that, opening a port in the router and allowing that traffic directed to your public IP adddress and that specific port (for example, 80) get through the router and finally to your PC.

Now your PC is public at least on port 80. Internet knows how to get to your PC using the public address and the router translate that public Ip to the private that your device uses.

An example:

Your PC has the private IP address and is connected to an internet router that has the public IP

Now, if you open the port 80 in the router then anyone in the public internet could connect to your PC using the URL

The public internet doesn't know your private IP, they know your public IP address.

  • 1
    Of course, ping (the protocol in question) uses ICMP, which doesn't have ports.
    – Ron Maupin
    Aug 2, 2017 at 14:16
  • Thanks buddy.. I appreciate for ur time.. I sometimes get some crazy doubts don't mind
    – RRHS
    Aug 9, 2017 at 17:36

If you really want to fully communicate using private IP addresses with a remote PC/network, ping etc., across public Internet you'll need a tunnel, usually a VPN connection.

The Internet doesn't route private IP addresses the reasons you've pointed out. So, you need to hide = encapsulate the private IP packets inside public IP packets. On the sender's side packets are encapsulated, and on the receiver's side the original packets are extracted and routed to the destination.

  • I didn't know you can do that.. I'll look into that.. Thanks for the time
    – RRHS
    Aug 9, 2017 at 17:36

I think the best way to do this, is creating a VPN as Zac67 says, but your question is a bit generic so it is difficult to answer without a topology with the devices involved. Basically you would need to configure a public peer for each host, so you will have a private ip and a public peer wich would be the face on the internet. Besides it would be a more safe way because all the trafic would be encrypted. Opening ports like http/80 on a router and acces it over inet is not recommended.

  • I can understand.. My bad.. I didn't frame the question properly.. Anyways thanks for your time.. I appreciate it
    – RRHS
    Aug 9, 2017 at 17:37

It's called static routing. Here is an example of how it works:

"mine having a private address of"

"other LAN PC having a private address of say"

  1. Add the following configuration to your router

protocols [ static [ route [ next-hop [ ] ] ] ]

  1. From your computer's command line ping it as you normally would: ping
  • 2
    Sorry Leon, but traffic in the same subnet will never reach the router, so static routes have no effect. In actuality, these are disjointed networks separated by the Internet. so you can't route between them unless you use NAT.
    – Ron Trunk
    Nov 1, 2019 at 15:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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