36

Are IP addresses with all zeroes in the first octet valid?

For example, can 0.1.2.0/24 be a valid subnet, with network address 0.1.2.0, broadcast address 0.1.2.255 and an usable address range from 0.1.2.1 to 0.1.2.254?

It looks like it should be valid, but it doesn't work, at least on Windows systems.

If it's not valid, then why?

Massimo
  • 72,827

7 Answers7

36

RFC1122, Requirements for Internet Hosts -- Communication Layers, says:

     { <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.

wfaulk
  • 6,986
19

Looks like 0.0.0.0/8 is in the list of IANA Reserved subnets.

sysadmin1138
  • 135,853
13

Per RFC 5735, 0.0.0.0/8 is a reserved IP address range, as follows:

0.0.0.0/8 - Addresses in this block refer to source hosts on "this" network. Address 0.0.0.0/32 may be used as a source address for this host on this network; other addresses within 0.0.0.0/8 may be used to refer to specified hosts on this network [RFC1700, page 4].

Skyhawk
  • 14,230
11

According to RFC 1700 - "Assigned Numbers", "Special Addresses" section, a network number of 0 can only be used as a source address, and represents a host on the same network. Therefore it is invalid to assign an address of this type to an interface.

0

"0." networks are used for SNM ( SYSTEM NETWORK MANAGEMENT) and can't be used for something else

-1

For anyone wondering why the Network-number is 0 in this case, 0.1.2.0/24 breaks down as follows:

Network = (8 bits) 0
Subnetwork (16 bits) = 1.2
Host part = remaining 8 bits

Given that the MSB of the first octet is 0, it must be class A, with an implied network portion of 8 bits. It is subnetted a further 16 bits (the next two octets).

Given things like CIDR and the death of classful addressing, 0.1.2.0/24 should be a valid subnet (there are bits set in the network portion if you consider the first 24 bits).

HBruijn
  • 84,206
  • 24
  • 145
  • 224
Scotia
  • 1
-1

The IP 0.0.0.0 is used just for request a valid IP Address from DHCP Server, and DHCP server is replying a dynamic valid IP for request computer.