3

The range of 0.0.0.0/7 is 0.0.0.0 - 1.255.255.255.
The range of 1.0.0.0/8 is 1.0.0.0 - 1.255.255.255.

AFAIK, 0.0.0.0/8 (0.0.0.0 - 0.255.255.255) is not usable. So, do these represent the same range practically?

ip route add 0.0.0.0/7 dev eth1 # 1
ip route add 1.0.0.0/8 dev eth1 # 2

Is the effect the same?

1 Answers1

7

Clearly these are not the same.

However, nothing in 0.0.0.0/8 is a valid destination address, so the effect of each route would be the same. Attempts to connect to anything in 0.0.0.0/8 would just fail as always with an Invalid argument error, while attempts to connect to 1.0.0.0/8 would be routed as specified.

Michael Hampton
  • 244,070
  • 43
  • 506
  • 972
  • Just to add to this, if you specify both routes, `1.0.0.0/8` would always be used for `1.*.*.*`, as it is more specific than `0.0.0.0/7`. Hence, `0.0.0.0/7` would be used (and fail as described) only for `0.0.0.0/8` range (`0.*.*.*` addresses). – Matija Nalis Nov 05 '18 at 20:36
  • @MatijaNalis Connections to 0.0.0.0/8 fail regardless of whether a static route is defined for them or not. – Michael Hampton Nov 05 '18 at 20:38