From owner-freebsd-questions@FreeBSD.ORG Mon Nov 7 01:19:14 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 661F8106564A for ; Mon, 7 Nov 2011 01:19:14 +0000 (UTC) (envelope-from wblock@wonkity.com) Received: from wonkity.com (wonkity.com [67.158.26.137]) by mx1.freebsd.org (Postfix) with ESMTP id 278728FC17 for ; Mon, 7 Nov 2011 01:19:14 +0000 (UTC) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.14.5/8.14.5) with ESMTP id pA71JDL1035850; Sun, 6 Nov 2011 18:19:13 -0700 (MST) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.14.5/8.14.5/Submit) with ESMTP id pA71JCeJ035847; Sun, 6 Nov 2011 18:19:12 -0700 (MST) (envelope-from wblock@wonkity.com) Date: Sun, 6 Nov 2011 18:19:12 -0700 (MST) From: Warren Block 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 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (wonkity.com [127.0.0.1]); Sun, 06 Nov 2011 18:19:13 -0700 (MST) 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:19:14 -0000 On Mon, 7 Nov 2011, Michael Ross wrote: > 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. ifconfig_DEFAULT="DHCP" It's not well documented. I'd also suggest using SYNCDHCP as more likely to work predictably on unknown equipment.