Desired behaviour of "ifconfig -alias"

Oliver Fromme olli at
Mon Feb 12 18:23:40 UTC 2007

Brooks Davis wrote:
 > Oliver Fromme wrote:
 > > Brooks Davis wrote:
 > > > ipv4_addrs_<interface> is a much better replacement IMO.  It's easy to
 > > > use and doesn't required the hackish pseudo array traversal used by
 > > > ifconfig_iface_aliasX.
 > > 
 > > That might work for simple cases, but how do you specify
 > > other parameters beside the IPs if you need to?
 > What do you need to set?  It's sets IP and netmask.  It doesn't handle
 > broadcast, but I'd be pretty suprised if that's needed often.

True, not often, but sometimes.  I had cases like that in
certain environments with bridged networks and arp proxies.

I'm fine with your proposed syntax, as long as all the
existing ifconfig possibilities continue to be possible,
i.e. no regression.

 > is needed?  Axing ifconfig_iface_aliasX is not needed, but reducing the
 > visiability of the interface in the documentation is probably in order
 > particularly since it's quite fragile since you have to renumber whenever
 > you remove an entry.

Yup, I agree, that's a PITA.  That could be solved in the
shell code, though, by not enumerating until a number
doesn't exist, but instead looking at the set of all
shell variables that have been set, similar to this:

set | grep "^ifconfig_${IFACE}_alias" | cut -f1 -d= | ...

Best regards

Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, USt-Id: DE204219783
Any opinions expressed in this message are personal to the author and may
not necessarily reflect the opinions of secnetix GmbH & Co KG in any way.
FreeBSD-Dienstleistungen, -Produkte und mehr:

"C is quirky, flawed, and an enormous success."
        -- Dennis M. Ritchie.

More information about the freebsd-stable mailing list