1

If the host part of a IPv4 address is all zero (e.g. 192.168.1.0 in a network with mask 255.255.255.0), does the address represent the network, or a network interface in the network?

Thanks.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
Tim
  • 1,545
  • 15
  • 27
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer. – Ron Maupin Dec 15 '19 at 01:12

2 Answers2

3

For IPv4, that is the network address, and it cannot be assigned to an interface*. The network, itself, does not have an interface; it is the collection of interfaces with addressing that masks to the same network address.

That is explained in this two-part answer to which I have previously referred you.

Unlike IPv4, IPv6 actually allows the use of the network address for a host interface, and it has no broadcast, so all network addresses can be used for host addressing.


*There are two exceptions to being unable to use the network address for an interface, and those are /31 and /32 networks.

Ron Maupin
  • 99,565
  • 26
  • 120
  • 195
3

The host part all zero is used as the network address or prefix, e.g. 192.168.1.0/24. Interfaces within the network usually cannot have all zeros in the host part and all ones is reserved for the directed broadcast address.

(There's no strict technical reason why the all-zero address cannot be used but only very few systems support it.)

Zac67
  • 84,333
  • 4
  • 69
  • 133
  • Do you mean that an IP address with host part all zero always refers to a network? If yes, is it necessary to indicate the prefix length for the network mask (e.g. 192.168.1.0/24), or there is no need to (e.g. 192.168.1.0) because all the trailing zero already indicate the network mask? e.g. or – Tim Mar 25 '19 at 22:44
  • @Tim Pretty much always, yes. For the network address, you always need to indicate the prefix length, there is no automatism (since 1993 when classful networking was obsoleted) - 10.0.0.0 can be /8, /24, or even /31 (or anything in between). – Zac67 Mar 25 '19 at 23:07
  • At least on Linux you can't use the all zeros and all ones addresses for hosts if you set up the network normally, but you can use them if you add the addresses with a /32 netmask and then explicitly add a route for on-link systems. – Peter Green Mar 25 '19 at 23:46
  • 1
    We've been over this several times... all-zero and all-one addresses are called out in early RFCs. They are effectively both broadcast addresses, but all-zero is a very old practice. – Ricky Mar 26 '19 at 00:07