Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Nov 2002 10:03:25 -0800
From:      Rich Morin <rdm@cfcl.com>
To:        hackers@FreeBSD.ORG
Subject:   Re: auto-definition of a single network interface
Message-ID:  <p05200f30ba0029798069@[192.168.254.205]>
In-Reply-To: <200211191517.17242.l.s.r@web.de>
References:  <p05200f20b9fd8c66ad17@[192.168.254.205]> <200211191517.17242.l.s.r@web.de>

next in thread | previous in thread | raw e-mail | index | archive | help
At 3:17 PM +0100 11/19/02, Ren=E9 Scharfe wrote:
>OK, perhaps this can be made even simpler. Put this into your /etc/rc.conf
>and be done:
>
>    # a hack to ease the configuration of machines with only one NIC
>   _single=3D`ifconfig -l link`
>   eval ifconfig_${_single}=3D"inet 192.168.254.193 netmask 255.255.255.0"
>   eval ifconfig_${_single}_alias0=3D"inet 192.168.254.199 netmask 255.255.=
255.0"

One of the nice things about FreeBSD's rc.conf approach is that it moves a
large number of declarations out of assorted scripts, putting them into a
set of "declarative" files.  While these files technically contain code,
I've never seen them contain anything other than "var=3Dval" statements.

I am therefore loathe to suggest any hack that starts putting executable
code in these files.  I am also concerned about making the system too
"brittle"; it should handle error conditions as cleanly as possible.  So,
while this is definitely a cute hack, I would not recommend it for general
use.

-r
-- 
email: rdm@cfcl.com; phone: +1 650-873-7841
http://www.cfcl.com/rdm    - my home page, resume, etc.
http://www.cfcl.com/Meta   - The FreeBSD Browser, Meta Project, etc.
http://www.ptf.com/dossier - Prime Time Freeware's DOSSIER series
http://www.ptf.com/tdc     - Prime Time Freeware's Darwin Collection

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?p05200f30ba0029798069>