Ip

0.1.2.3 是有效的 IP 地址嗎?

  • April 7, 2019

第一個八位字節中全為零的 IP 地址是否有效?

例如,可以0.1.2.0/24是一個有效的子網,具有網路地址0.1.2.0、廣播地址0.1.2.255和可用地址範圍從0.1.2.10.1.2.254?

看起來它應該是有效的,但它不起作用,至少在 Windows 系統上是這樣。

如果它無效,那為什麼?

RFC1122Internet 主機要求——通信層,說:

    { <Network-number>, <Host-number> }

(a)  { 0, 0 }

    This host on this network.  MUST NOT be sent, except as
    a source address as part of an initialization procedure
    by which the host learns its own IP address.

    See also Section 3.3.6 for a non-standard use of {0,0}.

(b)  { 0, <Host-number> }

    Specified host on this network.  It MUST NOT be sent,
    except as a source address as part of an initialization
    procedure by which the host learns its full IP address.

引用自:https://serverfault.com/questions/300260