How does Google know my Public IP if my packets are modified by ISP’s NAT?


So if my router’s packets are sent through the ISPs routers, then isn’t the source IP of that packet changed when it gets modified by ISP’s NAT? Shouldn’t that mean Google sees the source IP of that packet as the same as the last router’s IP? How does it know my personal router’s public IP?

In: 1

Because your ISP doesnt run NAT. Your routers public IP is directly exposed to the internet. Your router runs NAT for your internal network.

Routing and NAT is not the same.

NAT changes the IP addresses from one internal to one external, the device that does that needs to remember how it do that. It is usually only done by the router you have at home.

Router out on the internet do just forward the packet toward the destination. The part that requires some work it to know in what direction it should forward the packet. If it is connected to five other routers need to forward it in the right direction. The packet is not changed. The router does not need to remember what packets have forward at all.

If your router has a public IP then by definition it will be the one that is in a packet that all computers you connect to receive. If the IP is changed with NAT it is a private IP. All IP packets contain both the source and destination IP and the source and destination port. The computer on the other end knows to what program in the computer should get the data by looking at that.

What does say? That should show the IP on the outside of any NAT you’re behind. Compare this with what your router says its IP is; it should be somewhere on its web interface, often at