From owner-freebsd-questions@FreeBSD.ORG Wed Dec 28 13:29:49 2005 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 F313316A41F for ; Wed, 28 Dec 2005 13:29:48 +0000 (GMT) (envelope-from yuanjue02@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.201]) by mx1.FreeBSD.org (Postfix) with ESMTP id 4D2AE43D77 for ; Wed, 28 Dec 2005 13:29:30 +0000 (GMT) (envelope-from yuanjue02@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so1477468nzo for ; Wed, 28 Dec 2005 05:29:29 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:from:organization:to:subject:date:user-agent:cc:references:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:message-id; b=UubbXP68SS1FHwcIKCWq9W6ZUhUZ9w3BiLgTMRMxEGN/dbKaXxxdU3RBrDw3aifTK+RDyw3eR7VimsSCojHrcubG+PEDnWolmLkj371b1EWUfP7H3m9FqlrAbJLmncv41bLWfseus9OWGljOchTZdzJ2q0hE/QJWoZ38CQLStZE= Received: by 10.36.113.20 with SMTP id l20mr5293766nzc; Wed, 28 Dec 2005 05:29:29 -0800 (PST) Received: from ?166.111.123.176? ( [166.111.123.176]) by mx.gmail.com with ESMTP id 15sm588119nzo.2005.12.28.05.29.27; Wed, 28 Dec 2005 05:29:29 -0800 (PST) From: Yuan Jue Organization: Tsinghua UNIV. To: freebsd-questions@freebsd.org Date: Wed, 28 Dec 2005 21:32:12 +0800 User-Agent: KMail/1.8.3 References: <200512251530.21898.yuanjue02@gmail.com> <200512261107.45871.yuanjue02@gmail.com> <43AFB052.9070005@locolomo.org> In-Reply-To: <43AFB052.9070005@locolomo.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512282132.13055.yuanjue02@gmail.com> Cc: Subject: Re: Wireless NIC in FreeBSD 6.0 ? 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: Wed, 28 Dec 2005 13:29:49 -0000 On Monday 26 December 2005 16:56, Erik Norgaard wrote: > Yuan Jue wrote: > > On Sunday 25 December 2005 23:15, Erik N=F8rgaard wrote: > >>Yuan Jue wrote: > >>>one more question > >>>since I use a fixed IP address in my dormitory and a dynamic IP address > >>>in the classroom or library, i need to change my local NIC configure > >>> from time to time. In fact, I use the fixed IP address as my default > >>> setting, which is as follows: > >>> > >>>what is the right way to do it? or is there any better solution for my > >>>situation? > >> > >>Try to take a look at dhclient.conf(5) and dhclient(8) and set all > >>interfaces to be configured with dhcp. I think it should be posible to > >>configure default values so there is something to fall back on if a > >>lease is not obtained. > >> > >>Note that dhclient is new in FBSD 6, this is also why you had to take > >>down the other interface. The old dhclient would reset all dhcp > >>configured interfaces, the new doesn't, which is quite neat because > >>usually you would have the two interfaces connected to /different/ > >>networks. > > > > thanks for your explanations about DHCP in FreeBSD 6.0, although I > > still cannot find a way to config dhclient.conf to solve my problem :) > > Of course I guess you read the man-page, but maybe you didn't see this: > yes, i do > The dhclient.conf file can be used to configure the behaviour of the > client in a wide variety of ways: protocol timing, information > requested from the server, information required of the server, > defaults to use if the server does not provide certain information, > values with which to override information provided by the server, or > values to prepend or append to information provided by the server. > The configuration file can also be preinitialized with addresses to > use on networks that do not have DHCP servers. > > It appears you can set some default values: > > default { [option declaration] [, ... option declaration] } > If for some set of options the client should use the value sup- > plied by the server, but needs to use some default value if no > value was supplied by the server, these values can be defined > in the default statement. > > I would assume that if you set defaults this way, defaults will also > take place if no lease is obtained at all - at least that would be very > usefull. Something like this I guess: > > interface bge0 { > default { > fixed-address your-fixed-ip-here; > subnet-mask your-fixed-subnet-mask-here; > ... > } > } > sorry, I still don't quite get what you mean. it seems my default setting is this though it is not written in dhclient.conf. > You might want to toggle timeout so defaults take effect faster. > > If both interfaces are configured with dhcp then dhclient will > unconfigure the interface if there is no connection be it wired or > wireless and the configuration of the working interface should take effec= t. how can I configure the wireless interface to use DHCP in dhclient.conf? like as follows? interface ath0 { default { script "/etc/dhclient-script"; } } =20 looking forward more explanations thanks =2D-=20 Best Regards. Yuan Jue