From owner-freebsd-hackers Tue Nov 19 6:16: 8 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 694BC37B401 for ; Tue, 19 Nov 2002 06:16:07 -0800 (PST) Received: from smtp.web.de (smtp01.web.de [217.72.192.180]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1BC7B43E6E for ; Tue, 19 Nov 2002 06:16:06 -0800 (PST) (envelope-from l.s.r@web.de) Received: from [217.82.216.117] (helo=golmepha) by smtp.web.de with esmtp (WEB.DE(Exim) 4.91 #2) id 18E9AV-0005fB-00 for hackers@FreeBSD.ORG; Tue, 19 Nov 2002 15:15:59 +0100 Content-Type: text/plain; charset="iso-8859-1" From: =?iso-8859-1?q?Ren=E9=20Scharfe?= To: hackers@FreeBSD.ORG Subject: Re: auto-definition of a single network interface Date: Tue, 19 Nov 2002 15:17:17 +0100 User-Agent: KMail/1.4.3 References: In-Reply-To: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Message-Id: <200211191517.17242.l.s.r@web.de> Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Tuesday 19 November 2002 05:20, Rich Morin wrote: > network_interfaces=3DSINGLE > ifconfig_single=3D" inet 192.168.254.193 netmask 255.255.255.0= " > ifconfig_single_alias0=3D"inet 192.168.254.199 netmask 255.255.255.2= 55" OK, perhaps this can be made even simpler. Put this into your /etc/rc.con= f 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= =2E255.0" Maybe a bit ugly, though. ;-) In case there's more than one interface you'll get "ifconfig_xxN not found", where xxN is your first link, so it should be "safe". Ren=E9 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message