How can I know an IP is a public IP or not?
How can I know an IP is a public IP or not?
To determine whether an IP address is public or private, you can compare it to a list of private IP address ranges specified in RFC 1918. If the IP address falls within one of these ranges, it is a private IP address and not accessible from the internet:
- 10.0.0.0 - 10.255.255.255 (10/8 prefix)
- 172.16.0.0 - 172.31.255.255 (172.16/12 prefix)
- 192.168.0.0 - 192.168.255.255 (192.168/16 prefix)
If the IP address does not fall within one of these ranges, it is a public IP address and is accessible from the internet. Note that there are some special IP address ranges that are reserved for other purposes, such as loopback addresses (127.0.0.0/8) and link-local addresses (169.254.0.0/16), but these should not be used for public internet communication.
作者:Chuck Lu GitHub |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
2022-03-28 炉石传说 佣兵战纪 装备
2022-03-28 What can be the reasons of connection refused errors?
2022-03-28 Big Data & Cloud Computing: The Roles & Relationships
2020-03-28 Why can two different enum enumeration-constants have the same integer value?
2019-03-28 Singleton Pattern单例模式
2016-03-28 T4 Templates and the Entity Framework
2016-03-28 Entity Framework Utility .ttinclude File