From owner-freebsd-mobile@FreeBSD.ORG Tue Mar 23 09:27:36 2004 Return-Path: Delivered-To: freebsd-mobile@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DEECE16A4CE for ; Tue, 23 Mar 2004 09:27:36 -0800 (PST) Received: from harmony.village.org (rover.bsdimp.com [204.144.255.66]) by mx1.FreeBSD.org (Postfix) with ESMTP id 859DE43D2D for ; Tue, 23 Mar 2004 09:27:36 -0800 (PST) (envelope-from imp@bsdimp.com) Received: from localhost (warner@rover2.village.org [10.0.0.1]) by harmony.village.org (8.12.10/8.12.9) with ESMTP id i2NHRakj097766; Tue, 23 Mar 2004 10:27:36 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Tue, 23 Mar 2004 10:27:39 -0700 (MST) Message-Id: <20040323.102739.95902247.imp@bsdimp.com> To: dan@langille.org From: "M. Warner Losh" In-Reply-To: <20040322182954.S90677@xeon.unixathome.org> References: <20040322182954.S90677@xeon.unixathome.org> X-Mailer: Mew version 3.3 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit cc: mobile@freebsd.org Subject: Re: two NICs, one dhclient X-BeenThere: freebsd-mobile@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Mobile computing with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Mar 2004 17:27:37 -0000 In message: <20040322182954.S90677@xeon.unixathome.org> Dan Langille writes: : My IBM ThinkPad T22 is running FreeBSD 5.2.1 and has a built-in NIC (fxp0) : and a PCMCIA wi0. : : I have 'ifconfig_fxp0="DHCP"' in /etc/rc.conf. What I'd like to do is : have dhclient run in wi0 if it is present and then not on fxp0. But if no : wi0, then run dhclient on fxp0. : : devd.conf was mentioned to me as one way to acheive this. Does anyone have : a working configuration? You'd need a replacement script for the /etc/pccard_ether script that the default devd.conf runs. You could do something like: case $1 in fxp0) maybe_dhclient fxp0;; wi0) dhclient wi0;; esac maybe_dhclient() { if ifconfig wi0 > /dev/null 2&>1; then exit fi dhclient $1 } Warner