Desired behaviour of "ifconfig -alias"

Freddie Cash fcash at ocis.net
Mon Feb 12 19:47:29 UTC 2007


On Monday 12 February 2007 11:06 am, John Hay wrote:
> On Mon, Feb 12, 2007 at 11:59:40AM -0600, Brooks Davis wrote:
> > On Mon, Feb 12, 2007 at 06:39:35PM +0100, Oliver Fromme wrote:
> > > Brooks Davis wrote:
> > >  > Oliver Fromme wrote:
> > >  > > Jeremy Chadwick wrote:
> > >  > > > Oliver Fromme wrote:
> > >  > > > FWIW, I still use alias/-alias.  Mainly because that's what
> > >  > > > has existed historically, and the term "alias" is what is
> > >  > > > used in reference to rc.conf ifconfig_iface_aliasX entries.
> > >  > >
> > >  > > Maybe it would make sense to remove "alias" from the rc.conf
> > >  > > entries and simply number them.
> > >  >
> > >  > 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. 
> > What else 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.
>
> Some stuff cannot be done on a single line, so I have abused the
> _aliasX mechanism for that. With the bridge interface:
>
> ifconfig_bridge0="ether 00:00:24:c0:0e:40 addm sis0 stp sis0 addm sis1
> stp sis1 up" ifconfig_bridge0_alias0="inet 146.64.84.1/24"
>
> Also with the atheros driver I had problems in the past with some
> parameters that did not like to be on a single commandline.

At least with the ath(4) driver, it all comes down to the order the 
options are written on the commandline.  Some options reset the device, 
wiping out previous options, so you have to make sure those are set 
first.  Took me awhile to figure that out, but it is mentioned in the man 
page.

Note, however, that your example could be done using the 
ipv4_addrs_bridge0 variable, as you are not setting anything other than 
the IP:

ifconfig_bridge0="ether 00:00:24:c0:0e:40 addm sis0 stp sis0 addm sis1 stp 
sis1 up"
ipv4_addrs_bridge0="146.64.84.1/24"

-- 
Freddie Cash
fcash at ocis.net


More information about the freebsd-stable mailing list