DEV Community

Anh Trần Tuấn
Anh Trần Tuấn

Posted on • Originally published at tuanh.net on

Reasons Why Sometime Your Router Internet IP Address is Not a Public Address

1. Network Address Translation (NAT)

1.1 What is NAT?

NAT, or Network Address Translation, is a mechanism used by routers to modify network address information in IP packet headers. This allows multiple devices in a private network to access the internet using a single public IP address. While NAT is essential for conserving IP addresses, it also creates a scenario where the IP address assigned to your router’s WAN interface is a private address, while the actual public address is what websites and services see.

Image

1.2 How NAT Works

Let’s take an example where you have several devices connected to your router. Your router will assign private IPs (such as 192.168.1.2 or 10.0.0.5) to each device. When these devices communicate with the internet, the router translates these private IPs to its public IP—the one assigned by your ISP.

Device (192.168.1.2) ---> Router (WAN IP: 10.0.0.2) ---> Public IP: 203.0.113.15
Enter fullscreen mode Exit fullscreen mode

In this example, the router’s WAN IP is 10.0.0.2 (a private IP), and it translates that to 203.0.113.15 (a public IP). The website will only see 203.0.113.15 as the source of the traffic, not the private IP.

If you want to see this in action, follow these steps:

  • Set up your router with NAT enabled.
  • Connect a device to your network.
  • Use a tool like WhatIsMyIP to check the public IP that websites see.
  • Access your router’s dashboard to view the WAN IP. You’ll notice the difference.

You will see that your router’s WAN IP is a private IP like 10.0.0.2, while the public IP visible on WhatIsMyIP is completely different, such as 203.0.113.15.

2. Carrier Grade NAT (CGNAT)

2.1 What is CGNAT?

Carrier Grade NAT (CGNAT) is a technique used by Internet Service Providers (ISPs) when there aren’t enough public IP addresses available. Instead of assigning each customer a unique public IP, they share one public IP across multiple customers, similar to how traditional NAT works on a local network.

Image

2.2 Why CGNAT is Used

CGNAT is typically used to manage the growing number of internet users while conserving the pool of available public IP addresses. With CGNAT, your router may be assigned a private IP, while the actual public IP is shared across multiple users.

To check if you are behind CGNAT:

  • Log into your router’s admin panel.
  • Check the WAN IP address. If it is in the range of 100.64.0.0/10, you are likely behind CGNAT.
  • Use an external service to check your public IP. You’ll notice that the public IP is different from the WAN IP shown in your router.

You will find that your router has a private WAN IP like 100.72.15.6, but the public IP visible to websites is completely different, shared with many other users.

3. Static vs Dynamic IPs

3.1 Static IP Addresses

When your ISP assigns a static IP, that IP remains the same regardless of when or how you connect to the internet. If this static IP is directly assigned to your router, both the WAN and public IP will be identical.

3.2 Dynamic IP Addresses

In contrast, a dynamic IP is periodically assigned by your ISP, meaning it can change over time. In most home networks, the router's WAN IP is a private dynamic address, while the public IP assigned by the ISP changes.

To configure a static or dynamic IP:

  • Access your router’s settings.
  • Under the WAN configuration, check whether your router is assigned a static or dynamic IP.
  • Use WhatIsMyIP to see how your public IP compares.

If you have a static IP setup, your WAN IP will match your public IP. But in most cases with dynamic IPs, the WAN IP remains private while the public IP may change periodically.

4. IP Pass-through

4.1 What is IP Pass-through?

IP pass-through is a configuration where the public IP is assigned directly to a device, such as a PC or another router, bypassing the router's WAN interface. This means that the router's WAN IP remains private, but the public IP is visible directly on the device that receives it.

Image

To enable IP pass-through:

  • Go to your router’s admin panel.
  • Under advanced network settings, find the IP pass-through option.
  • Enable it for a specific device in your network.

Once enabled, the device configured for IP pass-through will receive the public IP, while the router continues to handle traffic with its private WAN IP.

5. Conclusion

There are multiple reasons why your router’s WAN IP might differ from your public IP, including the use of NAT, Carrier Grade NAT, the difference between static and dynamic IPs, and IP pass-through configurations. Each mechanism plays an essential role in how devices in your network communicate with the broader internet while maintaining efficiency and security.

If you have further questions or need clarification, feel free to leave a comment below, and I’ll be happy to help!

Read posts more at : Reasons Why Sometime Your Router Internet IP Address is Not a Public Address

Image of Quadratic

The native AI interface for your structured data

Simply type in your prompt and generate insights with the latest LLMs and built-in Python functionality.

Try Quadratic free

Top comments (0)

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay