From owner-freebsd-questions@FreeBSD.ORG Mon Nov 7 01:24:52 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F2938106564A for ; Mon, 7 Nov 2011 01:24:52 +0000 (UTC) (envelope-from coco@executive-computing.de) Received: from mail.moehre.org (mail.moehre.org [195.96.35.7]) by mx1.freebsd.org (Postfix) with ESMTP id ABF148FC0A for ; Mon, 7 Nov 2011 01:24:52 +0000 (UTC) Received: from mail.moehre.org (unknown [195.96.35.7]) by mail.moehre.org (Postfix) with ESMTP id 06DB18B143B; Mon, 7 Nov 2011 02:24:52 +0100 (CET) X-Spam-Flag: NO X-Spam-Score: -100.963 X-Spam-Level: X-Spam-Status: No, score=-100.963 tagged_above=-999 required=5 tests=[ALL_TRUSTED=-1, AWL=0.037, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mail.moehre.org ([195.96.35.7]) by mail.moehre.org (mail.moehre.org [195.96.35.7]) (amavisd-new, port 10024) with ESMTP id IYKhHGtr0AuU; Mon, 7 Nov 2011 02:24:50 +0100 (CET) Received: from s560x.c0c0.intra (p54B0A4E0.dip.t-dialin.net [84.176.164.224]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: coco@executive-computing.de) by mail.moehre.org (Postfix) with ESMTPSA id 231CB8B141B; Mon, 7 Nov 2011 02:24:50 +0100 (CET) Date: Mon, 7 Nov 2011 02:24:49 +0100 (CET) From: Marco Steinbach X-X-Sender: coco@s560x.c0c0.intra To: Michael Ross In-Reply-To: Message-ID: References: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: "freebsd-questions@freebsd.org" Subject: Re: Get list of ethernet devices X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 07 Nov 2011 01:24:53 -0000 On Mon, 7 Nov 2011, Michael Ross wrote: > Moin, Morsche, > I'm setting up a system on an external USB drive, > serving as fallback in case of a server failure: > > Customer takes USB drive, plugs it into any of his PCs and boots of it. > > Now I am looking for a good method to configure the network: > > I could just start dhclient on any NIC which could possibly be there, > thus cramming rc.conf with > ifconfig_em0="DHCP" > ifconfig_em1="DHCP" > ifconfig_fxp0="DHCP" > and so on. > > Or I could grep ifconfig or dmesg output for ethernet interfaces and dhclient > these. > > Both sound like a very messy solution. > > So I would step beyond my current area of expertise, grep some source from > sysinstall, bsdinstall or somewhere and do it in C. > But I'm kind of hoping anybody can point me to a readymade solution yet > unknown to me. No readymade solution, just a hint for possibly keeping the mess down a bit: The l (lower case letter L) flag to ifconfig lists all available interfaces in a more scripting friendly fashion: % ifconfig -l em0 dc0 plip0 lo0 vboxnet0 % I'd be interested in testing the results (or possible steps thereto) of your efforts in creating a customized, bootable FreeBSD USB stick image, if that's feasible. MfG CoCo