Recently I came up with the need to assign almost every IP in a /24 subnet
to an interface. I wanted to avoid 250+ lines in /etc/rc.conf so I read
the rc.conf manpage and discovered the wonderful range feature where I
thought I could use:
I found out it only creates addresses up to around .34 and prints "Range
specification is too large", all as an anti foot-shooting protection due
to _IPEXPANDMAX=31 in /etc/network.subr. Could the code be changed to
allow for example a whole /24 to be created with a single range?
Looking at SVN, this appears to apply to 9 as well.
Workaround: define a bunch of smaller ranges:
ifconfig_lagg0_aliases="inet 10.0.30.2-31/24 inet 10.0.30.32-63/32 \
inet .... etc etc"
Raise _IPEXPANDMAX=31 in network.subr? Untested but seems logical since
the only apparent purpose is to prevent accidental misconfiguration.
It is easy to see if the range is defined too large then it might make
a poor choice regarding broadcast IPs, oversized netmasks or something.
I didn't check exactly how many IPs it assigned, it should be near 32.
I was in a rush and had to settle for a workaround that evening.
How-To-Repeat: Try to set a large range in /etc/rc.conf and reboot.
r271424 from head should directly address this issue. Could it be merged to 10-STABLE for 10.1-RELEASE? Another report 186841 was mentioned in the commit. Thanks.
The new implementation was committed to stable/10 as r272577 and stable/9 as r272581. I have no idea if it can or will be requested to be in 10.1-RELEASE. I will be using -stable, but others depend on releases.
This did make it into 10.1-RELEASE as r273039. I didn't check 9. Good enough for me, marking closed, fixed.