Private IP Addresses, NAT and CGNAT Explained
Your laptop says its address is 192.168.1.23. GotInfo says your address is something completely different. Both are correct. The gap between them is network address translation, and knowing where it happens explains why port forwarding works for some people and silently fails for others.
Public and private addresses
A public address is routable on the internet: packets sent to it from anywhere can arrive. A private address is only meaningful inside one network. The private IPv4 ranges are set aside in RFC 1918, and any organization or household may reuse them, which is exactly why they cannot be routed on the public internet: millions of networks use the same numbers.
| Range | CIDR | Addresses | Where you usually see it |
|---|---|---|---|
| 10.0.0.0 to 10.255.255.255 | 10.0.0.0/8 | 16,777,216 | Company networks, cloud VPCs, some home routers |
| 172.16.0.0 to 172.31.255.255 | 172.16.0.0/12 | 1,048,576 | Docker and other container networks, some corporate networks |
| 192.168.0.0 to 192.168.255.255 | 192.168.0.0/16 | 65,536 | Most home routers (192.168.0.x or 192.168.1.x) |
| 100.64.0.0 to 100.127.255.255 | 100.64.0.0/10 | 4,194,304 | Shared address space for carrier-grade NAT (RFC 6598) |
| 169.254.0.0 to 169.254.255.255 | 169.254.0.0/16 | 65,536 | Link-local: a device gives itself one when it cannot reach a DHCP server |
A common trap is the 172 range. Only 172.16 through 172.31 are private. An address like 172.32.0.5 or 172.15.0.5 is public and belongs to someone. The subnet calculator shows the exact boundaries of any range if you are unsure.
If your computer shows a 169.254 address, it is not a strange provider address. It means the device asked for an address, got no answer, and assigned itself one. Check the cable or Wi-Fi connection and the router's DHCP service.
How NAT works, step by step
Here is what happens when a laptop at 192.168.1.23 loads a web page, with the router's public address shown as 203.0.113.7.
- The laptop sends a packet from
192.168.1.23, source port 52144, to the web server on port 443. - The router replaces the source with its own public address and picks a free port, say
203.0.113.7:40001. It records the mapping in its translation table. - The server replies to
203.0.113.7:40001. It never sees the private address. - The router looks up port 40001 in its table, rewrites the destination back to
192.168.1.23:52144, and passes the reply to the laptop.
This is why websites, and the GotInfo home page, see the router's public address and not your device's. It is also why NAT acts as a rough barrier against inbound connections: a packet arriving at the router without a matching table entry has nowhere to go, so it is dropped. That is a side effect rather than a security feature, and it does not replace a firewall.
Port forwarding
To run a game server, a camera or a home server that people can reach from outside, you add a permanent entry to the router's table, called a port forward: "send anything arriving on port 25565 to 192.168.1.50". Many routers can also create forwards automatically through UPnP when an application asks. Both only work if the router's outside address is actually the public address the rest of the internet uses. That is where carrier-grade NAT gets in the way.
Carrier-grade NAT
Because IPv4 addresses are scarce, many mobile carriers and a growing number of fixed-line providers put a second layer of NAT inside their own network. Your router gets an address from the provider's private pool, often in 100.64.0.0/10, and the provider's equipment translates thousands of customers onto a smaller set of public addresses. This is carrier-grade NAT, or CGNAT.
For browsing, streaming and video calls, CGNAT is usually invisible. The problems appear when something needs to accept connections:
- Port forwards on your router have no effect, because inbound traffic stops at the provider's NAT, which you do not control.
- Self-hosted servers, some security cameras and some games that host lobbies cannot be reached from outside.
- You share a public address with other customers, so an IP-based block or a CAPTCHA triggered by someone else can affect you too.
How to tell if you are behind CGNAT
- Log in to your router and find the WAN or internet address on its status page.
- Open the GotInfo home page and note your public IPv4 address.
- Compare them.
- They match: your router holds a public address. Port forwarding should work.
- The router shows 100.64.x.x to 100.127.x.x: almost certainly CGNAT.
- The router shows a 10.x, 172.16-31.x or 192.168.x address: there is another router or NAT device between yours and the internet. It might be the provider's modem in router mode, or CGNAT using a private range.
- A traceroute to any public host (
tracert 1.1.1.1on Windows,traceroute 1.1.1.1elsewhere) that shows several private-range hops after your own router is another sign of NAT inside the provider network.
Ways around CGNAT
- Ask the provider. Some offer a public IPv4 address on request, sometimes for a fee, or a static address on business plans.
- Use IPv6. If your connection has IPv6, each device has a globally routable address and there is no NAT in the way. You open access with an IPv6 firewall rule instead of a port forward. The visitor also needs IPv6. See IPv4 vs IPv6.
- Use an outbound tunnel. Overlay networks and tunnel services work by having your device connect out to a relay, which CGNAT allows, so visitors reach you through that relay.
- Rent a small server. A cheap virtual server with a public address can act as the entry point and forward traffic over a VPN to your home.
Private addresses and privacy
Your private address is not secret in any meaningful sense, since thousands of homes use the same one, but browsers have historically exposed it through WebRTC. Modern browsers usually replace it with a random .local name. The Information for Nerds section on the GotInfo home page shows what your browser reports, and the VPN leak test guide explains when that matters.
Compare your router's WAN address with the address the internet sees: open GotInfo.