IO之道 输入纯粹 · 输出价值

公网 IP 与内网 IP 的区别

每台联网设备都有一个 IP 地址,但你在路由器里看到的,往往和网站看到的并不一样。这就涉及公网 IP 与内网 IP 的区别。

公网 IP(Public IP)

公网 IP 由运营商分配,在整个互联网中唯一且可直接访问。网站、服务器看到的通常是你的公网 IP。由于 IPv4 资源稀缺,公网 IP 是稀缺资源。

内网 IP(Private IP)

内网 IP 仅在本地网络(家庭/公司)中使用,不会出现在公网。路由器通过 NAT(网络地址转换)让多台设备共用一个公网 IP 上网。这就是为什么你家里十几台设备,运营商却只给一个公网地址。

常见的内网地址段

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16(家用路由器最常见)

如何判断你用的是哪种

如果 IP Lookup 显示的地址形如 192.168.x.x10.x.x.x,那是内网 IP(说明站点检测到了代理后的地址);正常情况下显示的应是你的公网 IP。IPv6 时代每个设备都可拥有公网地址,NAT 的必要性大大降低。

Public vs Private IP

Every connected device has an IP address, but the one you see in your router is often not the one websites see. That difference comes down to public versus private IPs.

Public IP

A public IP is assigned by your ISP, is unique across the internet, and is directly reachable. Websites and servers typically see your public IP. Because IPv4 is scarce, public IPs are a limited resource.

Private IP

A private IP is used only within a local network (home or office) and never appears on the public internet. Your router uses NAT (Network Address Translation) to let many devices share a single public IP. That is why a household with a dozen devices may receive only one public address from the ISP.

Common Private Ranges

  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16 (most common on home routers)

How to Tell Which You Have

If IP Lookup shows an address like 192.168.x.x or 10.x.x.x, that is a private IP (meaning the site saw an address behind a proxy). Normally it shows your public IP. In the IPv6 era every device can have a public address, greatly reducing the need for NAT.