公私有地址
How do I know if my IP address is public or private?¶
The easiest way to know if your IP address is a public IP or a private IP is by looking at the IP number. If it's within one of the following ranges, it's a private IP address:
- 10.0.0.0 — 10.255.255.255 (Class A)
- 172.16.0.0 — 172.31.255.255 (Class B)
- 192.168.0.0 — 192.168.255.255 (Class C)
If it's an IP address outside of those ranges, it's a public IP address.
Though this tells you whether an IP is public or private, note that all devices do have both a public IP and a private IP; it isn't an either-or situation. The ranges above can help you identify which is which. Your router or gateway generally holds the public IP, while your individual device receives a private IP from the router via DHCP.