From owner-freebsd-questions@FreeBSD.ORG Mon Dec 26 08:56:59 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 F258616A41F for ; Mon, 26 Dec 2005 08:56:58 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from strange.daemonsecurity.com (59.Red-81-33-11.staticIP.rima-tde.net [81.33.11.59]) by mx1.FreeBSD.org (Postfix) with ESMTP id 278E943D46 for ; Mon, 26 Dec 2005 08:56:57 +0000 (GMT) (envelope-from norgaard@locolomo.org) Received: from [172.24.8.84] (generic.ATOSORIGIN.ES [212.170.156.200]) by strange.daemonsecurity.com (Postfix) with ESMTP id D09C52E047; Mon, 26 Dec 2005 09:56:55 +0100 (CET) Message-ID: <43AFB052.9070005@locolomo.org> Date: Mon, 26 Dec 2005 09:56:50 +0100 From: Erik Norgaard User-Agent: Mozilla Thunderbird 1.0.7 (X11/20051214) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Yuan Jue References: <200512251530.21898.yuanjue02@gmail.com> <200512252205.33644.yuanjue02@gmail.com> <43AEB79D.9030200@locolomo.org> <200512261107.45871.yuanjue02@gmail.com> In-Reply-To: <200512261107.45871.yuanjue02@gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: freebsd-questions@freebsd.org 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: Mon, 26 Dec 2005 08:56:59 -0000 Yuan Jue wrote: > On Sunday 25 December 2005 23:15, Erik Nørgaard 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: 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; ... } } 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 effect. However, in any case you should expect wierd things if both interfaces are up, and in particular for the same network. I don't know how dhclient handles that. Let me know if the above works, it's always good to have this kind of examples in the archive. Cheers, Erik -- Ph: +34.666334818 web: www.locolomo.org S/MIME Certificate: www.daemonsecurity.com/ca/8D03551FFCE04F06.crt Subject ID: 9E:AA:18:E6:94:7A:91:44:0A:E4:DD:87:73:7F:4E:82:E7:08:9C:72 Fingerprint: 5B:D5:1E:3E:47:E7:EC:1C:4C:C8:3A:19:CC:AE:14:F5:DF:18:0F:B9