First alias in config ignored

Hi all, I am having an odd issue.

This is the network specific config in my rc.conf:
Code:
ifconfig_em0="up"
ifconfig_em1="up"
ifconfig_em2="up"
ifconfig_em3="up"
cloned_interfaces="lagg0 bridge0 tap0"
ifconfig_lagg0="laggproto loadbalance laggport em0 laggport em1 laggport em2 laggport em3 dhcp"

# Jails
ifconfig_lagg0_alias0="inet 192.168.42.150 netmask 255.255.255.0" 
ifconfig_lagg0_alias1="inet 192.168.42.151 netmask 255.255.255.0" 
ifconfig_lagg0_alias2="inet 192.168.42.152 netmask 255.255.255.0" 
ifconfig_lagg0_alias3="inet 192.168.42.153 netmask 255.255.255.0" 
ifconfig_lagg0_alias4="inet 192.168.42.154 netmask 255.255.255.0" 
ifconfig_lagg0_alias5="inet 192.168.42.155 netmask 255.255.255.0" 
ifconfig_lagg0_alias6="inet 192.168.42.156 netmask 255.255.255.0" 
ifconfig_lagg0_alias7="inet 192.168.42.157 netmask 255.255.255.0" 
ifconfig_lagg0_alias8="inet 192.168.42.158 netmask 255.255.255.0" 
ifconfig_lagg0_alias9="inet 192.168.42.159 netmask 255.255.255.0" 
ifconfig_lagg0_alias10="inet 192.168.42.160 netmask 255.255.255.0" 
ifconfig_lagg0_alias11="inet 192.168.42.161 netmask 255.255.255.0" 
ifconfig_lagg0_alias12="inet 192.168.42.167 netmask 255.255.255.0"

However when I start up networking, all the aliases are added except the first one. In the above case it is 192.168.42.150 that ends up missing. If I put another IP address as alias0 it vanishes instead.

I tried just starting from "alias1" thinking perhaps "alias0" isn't valid, however the same issue persists. Always the first entry in my list is missing.

If I try to add the following line at the end:
Code:
ifconfig_lagg0_alias13="inet 192.168.42.150 netmask 255.255.255.0"

Then 192.168.42.150 does appear in the list of aliases, but then the second in the list (alias1) vanishes. This is odd. It is as if I only have 11 fixed aliases available on an interface, and any additional aliases pop an alias off the other end.

However I can't think FreeBSD deliberately restricts aliases to 11 per interface, so I wanted to ask if I am doing something wrong with my config?
 
Are you aware you can use a different way to configure lots of IP addresses?

Code:
ipv4_addrs_lagg0="192.168.42.150-161/24 192.168.42.167/24"
 
Are you aware you can use a different way to configure lots of IP addresses?

Code:
ipv4_addrs_lagg0="192.168.42.150-161/24 192.168.42.167/24"
No I wasn't, the addresses are however handled by a script so I don't manually add each line. The config also contains information about each jail on each line, which I removed for clarity.

I could make changes to the system to define a range, but then I would have to change the system and handle the range manually (plus more logic to detect whether an IP address is already assigned, currently I just grep rc.conf to check). Is that the only way to have more than 11 aliases per interface?
 
The config also contains information about each jail on each line
You don't need to 'reserve' the IP addresses of a jail. The address will be automatically added to the interface when the jail starts and removed when it's stopped.
 
You don't need to 'reserve' the IP addresses of a jail. The address will be automatically added to the interface when the jail starts and removed when it's stopped.

I may not "need to" reserve the IP addresses as far as FreeBSD is concerned, however that is how this existing system of jail management works and re-writing it is not the current intention.

My question is simply about why the first alias vanishes. To all intents and purposes this looks like a bug to me, but perhaps it is a known limitation? Or I am doing something wrong with the configuration?
 
Back
Top