This works: # ifconfig re0 alias 192.168.1.12/24 The inverse does not work: # ifconfig re0 -alias 192.168.1.12/24 ifconfig: 192.168.1.12/24: bad value It only works without the netmask: # ifconfig re0 -alias 192.168.1.12 - it should probably work if a netmask is given - the netmask could be ignored - or the alias would only be removed if the proper netmask is given
alias and -alias belong to the end of the command line. The fact that they mostly work on the front (and only for net imho) is a historic behaviour. Could you please try your tests again with alias and -alias at the end just to be sure that this is actually the issue you are thinking of (bad outclass being constructed/bad matching logic) and not interference with -alias? I would assume the behaviour not to change but want to rule it out.
Thanks for the hint, this works: # ifconfig re0 192.168.1.12/24 alias # ifconfig re0 192.168.1.12/24 -alias # So, it's just not working if the alias is given before the IP. Still looks a bit inkonsistent 8-}