Subnet prefix length 0 is not allowed
I have a test network where I want to set the subnet prefix length to zero (to pretend that all IP addresses are on the local network), and I was surprised to find that NetworkManager does not support that configuration. For example:
# nmcli conn modify 'Wired connection 1' ipv4.addresses 1.2.3.4/0
Error: failed to modify ipv4.addresses: invalid prefix '0'; <1-32> allowed.
# nmcli conn modify 'Wired connection 1' ipv6.addresses 1:2:3::4/0
Error: failed to modify ipv6.addresses: invalid prefix '0'; <1-128> allowed.
I realize that setting the subnet prefix length to zero is highly unusual. However, ifupdown and networkd, and of course the kernel itself, all allow it. Can we please allow it in NetworkManager too?