From owner-freebsd-questions@FreeBSD.ORG Thu Sep 21 16:38:30 2006 Return-Path: X-Original-To: FreeBSD-Questions@FreeBSD.org Delivered-To: FreeBSD-Questions@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D2B8516A417 for ; Thu, 21 Sep 2006 16:38:30 +0000 (UTC) (envelope-from dkelly@Grumpy.DynDNS.org) Received: from smtp.knology.net (smtp.knology.net [24.214.63.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4BD3343D73 for ; Thu, 21 Sep 2006 16:38:30 +0000 (GMT) (envelope-from dkelly@Grumpy.DynDNS.org) Received: (qmail 21340 invoked by uid 0); 21 Sep 2006 16:38:28 -0000 Received: from unknown (HELO Grumpy.DynDNS.org) (216.186.148.249) by smtp1.knology.net with SMTP; 21 Sep 2006 16:38:28 -0000 Received: by Grumpy.DynDNS.org (Postfix, from userid 928) id C1C8328420; Thu, 21 Sep 2006 11:38:27 -0500 (CDT) Date: Thu, 21 Sep 2006 11:38:27 -0500 From: David Kelly To: Bill Schoolcraft Message-ID: <20060921163827.GB4809@Grumpy.DynDNS.org> References: <20060918174011.GB31815@Grumpy.DynDNS.org> <20060921142421.4966.qmail@web31914.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060921142421.4966.qmail@web31914.mail.mud.yahoo.com> User-Agent: Mutt/1.4.2.2i Cc: FreeBSD-Questions@FreeBSD.org Subject: Re: how to add flags to ifconfig at boot 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: Thu, 21 Sep 2006 16:38:30 -0000 On Thu, Sep 21, 2006 at 07:24:21AM -0700, Bill Schoolcraft wrote: > --- David Kelly wrote: > > > True only if your options for ifconfig in rc.conf would clear or > > override whatever it is you put in /etc/start_if_em0. As long as its > > something that can be done with multiple ifconfigs then all is fine. > > > > For example this works fine in /etc/start_if.xl0: > > > > #!/bin/sh > > ifconfig xl0 lladdr 00:01:23:45:67:89 > > > > with this in rc.conf: > > ifconfig_xl0="DHCP" > > Thank you very much for the above info David, I've always been > challenged with my (encrypted) wireless card though, and usually have > my own manual script that I run. Always wanted to have it start > "automagically" when/if it is the card I'm using. > > (question) > > Besides the single line you have in /etc/rc.conf above to instruct DHCP > to be used, can one place all the following somehow in rc.conf or will > I have to get this going in a script location? > > Currently I give my card a static ip but would like to have it grab > it's ipaddr by DHCP, here is the majority of the script, omitted are > my ping tests of the gateway at the end. The reason you do not put a script such as you describe within rc.conf is that rc.conf is widely sourced as part of other scripts. As such, its run many times, not just once at boot. I think you should be able to remove the ifconfig setting static IP address, and the "route add" from your script, name the script if_start.wi0, and add "ifconfig_wi0='DHCP'" to rc.conf and be in business (assuming your wireless access point serves DHCP). Thats the whole point of start_if., to do things such as change MAC addresses, set WEP keys, etc. Things which lack formal support in rc.conf. -- David Kelly N4HHE, dkelly@HiWAAY.net ======================================================================== Whom computers would destroy, they must first drive mad.