See how your router keeps shared IPv4 connections separate
Contents
Network address translation (NAT) changes IP addresses as traffic crosses a router. Most home routers use a form called network address and port translation, or NAPT, so several devices can share one outward-facing IPv4 address. The port mapping tells the router which device should receive each reply.
Follow a connection out of your home
Suppose your laptop and phone each open an HTTPS connection to the same site. Each device has its own private IPv4 address. The router rewrites the source of each connection as it sends traffic out. It can also replace the source port so the two connections remain distinguishable.
| Connection | Source inside the home | Example source the website sees |
|---|---|---|
| Laptop | 192.168.1.20:51500 | 203.0.113.42:61001 |
| Phone | 192.168.1.21:51500 | 203.0.113.42:61002 |
| Phone opens a separate connection | 192.168.1.21:51501 | 203.0.113.42:61003 |
The example uses made-up port numbers and an IPv4 address reserved for documentation. The point is that the router assigns and remembers distinct mappings. It can translate a reply addressed to port 61002 back to the phone's original socket. A real router may retain the old port when it can and add more fields to its table.
Read what the translation changes
Websites see the internet-visible connection address, which may be shared by devices at home. A device on the local network, such as a printer, normally keeps its private address. To reach it directly from the internet, a new incoming connection would need a route and a rule that accepts it and sends it to the right device. NAT and firewall filtering are separate functions. If you are diagnosing an incoming connection, find out who controls each layer first. How carrier-grade NAT affects inbound connections
Two routers can translate the same outgoing traffic in succession. That is common when a personal router sits behind an ISP gateway that is still routing. The outside address alone does not reveal the number of translation layers. How to recognize double NAT
Need the login details for your router? Look up the default IP address, username and password for your brand.
Find your router’s default loginCheck two devices without changing your router
- Connect two devices to the same home Wi-Fi. Pause any VPN or browser proxy you use for the test. Turn off mobile data if a phone can silently switch to it.
- Read the local IPv4 address on each device. The addresses should usually differ. Then check the public IPv4 from each device while they are still on the same connection.
- If the devices show different local addresses and the same public IPv4, they share an internet-visible address. Compare that with the router's WAN IPv4 if you need to know whether another router or the provider is also translating it.
This comparison is limited to IPv4. A working IPv6 connection can show a different public address on each device. A port or address difference is also possible when traffic takes different routes.
Frequently asked questions
Does NAT change the address saved on my device?
The device keeps its local address. The router changes address and, when needed, port fields on packets as they cross the translation boundary.