Public vs Private IP Address: Difference Explained

04 Jan 2026 By Laura Zariņa

A private IP is the address of a device inside your local network (for example 192.168.1.5), while a public IP is the address the internet sees your network under. The difference comes from NAT: the router hides many internal addresses behind a single public one. Below is how that scheme works and how to check both addresses.

What a private IP is

Private addresses are used only inside a local network and are never routed on the internet. Three ranges are reserved for them (RFC 1918):

Range Prefix Typical use
10.0.0.0 – 10.255.255.255 /8 large networks, data centres
172.16.0.0 – 172.31.255.255 /12 medium networks
192.168.0.0 – 192.168.255.255 /16 home routers

The same private address can exist in millions of networks at once — it is unique only inside its own network.

What a public IP is

A public IP is unique across the entire internet and is assigned by your provider. It is the address inbound requests arrive at. A VPS gets a static public IP tied to the server.

How NAT works

NAT (Network Address Translation) replaces the private source address with the public one on the way out and remembers the mapping so the reply can be returned to the right device.

  1. Your laptop (192.168.1.5) sends a request to a website.
  2. The router rewrites the source address to its own public one (203.0.113.7) and records the pair in the translation table.
  3. The reply arrives at the router’s public IP, and NAT delivers the packet back to 192.168.1.5.

Because of NAT, inbound connections from outside do not reach the device by default — you need port forwarding on the router or a public address directly on the server.

How to check your private IP

Windows:

ipconfig

Linux:

ip addr show
hostname -I

How to check your public IP

curl ifconfig.me
curl https://api.ipify.org

PowerShell:

(Invoke-WebRequest -Uri "https://api.ipify.org").Content

If the public address matches the one on your interface, you are connected directly, without NAT — which is typical for a VPS with a routable IP.

Port forwarding: opening access from outside

If a service runs on a device behind NAT, it is unreachable from outside by default. To let an inbound connection through to the right machine, you configure port forwarding on the router:

  1. Open the router web interface at the gateway address (for example http://192.168.1.1).
  2. Find the Port Forwarding / “Virtual Servers” section.
  3. Specify the external port, the internal device IP and the internal port.
  4. Save and test reachability from an external host.

Important: forwarding only works with a routable public IP. If your provider put you behind CGNAT, inbound connections never arrive and no port can be opened. In that case you use a server with a public address.

Routable and CGNAT addresses

  • Routable (public) — a unique address reachable from outside. Every VPS has one.
  • CGNAT (shared) — an address behind the provider’s own NAT, shared by many customers. Port forwarding is impossible and inbound connections do not work.

To check which one you have, compare the address from curl ifconfig.me with the WAN address shown in your router’s web interface. If they differ, you are behind the provider’s CGNAT.

Frequently asked questions

Why can’t I reach my computer from the internet? Most likely you are behind NAT with no port forwarding. Configure forwarding on the router or use a server with a public IP.

Can I get a public IP at home? Usually yes, as a paid option from your ISP. The provider-independent alternative is a VPS with its own public address.

How many devices can share one public IP? Technically thousands — NAT tells them apart by port. The limit is the size of the router’s translation table.

Are the private and public IP the same on a VPS? Often yes: the public address is assigned directly to the network interface. Some providers also give a separate private network for server-to-server traffic.

How do I tell whether I am behind CGNAT? If the public IP from curl ifconfig.me starts with 100.64–100.127, or does not match the WAN address on your router, you are behind the provider’s CGNAT.

Need a permanent public IP with no NAT limitations? Take a Linux VPS with a dedicated public address in the VPS hosting section.

Laura Zariņa