IP 地址校验
粘贴一个地址或前缀。我们会检查语法、进行规范化并分类。
此内容尚无中文版本。在发布译文之前以英语显示。
An address can look right and still be wrong: 192.168.1.256 has a number above 255, 2001:db8::1::2 uses :: twice, and 192.168.01.1 has a leading zero that some systems read as octal. The validator checks the syntax the same way this site’s own parser does and tells you exactly what is wrong.
A valid address is shown in its normalised form — for IPv6 the canonical compressed form from RFC 5952 — and classified against IANA’s special-purpose registries: private, loopback, link-local, shared CGNAT space (100.64.0.0/10), documentation ranges and so on. A CIDR block is reduced to its network address.
常见问题
Is 100.64.x.x a private address?
Not in the RFC 1918 sense, but it isn't public either: 100.64.0.0/10 is shared address space for carrier-grade NAT (RFC 6598). If your router's WAN address is in it, your provider uses CGNAT.
Why is a leading zero rejected?
Some software reads 010 as octal (8), other software as decimal (10). Because the same text can mean two different addresses, modern parsers refuse it.
Can I paste an address with a port?
The validator recognises forms like 192.0.2.1:443 and [2001:db8::1]:443 and tells you to remove the port, since a port is not part of an IP address.