From owner-freebsd-questions@FreeBSD.ORG Sun Jan 1 08:06:39 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 6F95416A41F for ; Sun, 1 Jan 2006 08:06:39 +0000 (GMT) (envelope-from yuanjue02@gmail.com) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.203]) by mx1.FreeBSD.org (Postfix) with ESMTP id 66BCA43D6A for ; Sun, 1 Jan 2006 08:06:30 +0000 (GMT) (envelope-from yuanjue02@gmail.com) Received: by zproxy.gmail.com with SMTP id 9so2141343nzo for ; Sun, 01 Jan 2006 00:06: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=KSld4bpRJ4usBT0hLTJHzRTxeXL+kifoNMW8hFwMVKdmascgasZPZmV16SceWtva2jdIVxeS11CgX34BXQnEPli+EhpoFUx6x9JUlHKM8IdLaogC7AlMxWVE0WP59Kfy7QoMpOzp2N3nVVNLKVBWpMHSZ0gYA/X7EolSWYz1mwk= Received: by 10.36.43.13 with SMTP id q13mr275010nzq; Sun, 01 Jan 2006 00:06:29 -0800 (PST) Received: from tu208143.ip.tsinghua.edu.cn ( [166.111.208.143]) by mx.gmail.com with ESMTP id 20sm3396805nzp.2006.01.01.00.06.25; Sun, 01 Jan 2006 00:06:28 -0800 (PST) From: Yuan Jue Organization: Tsinghua UNIV. To: freebsd-questions@freebsd.org Date: Sun, 1 Jan 2006 16:09:22 +0800 User-Agent: KMail/1.8.3 References: <200512251530.21898.yuanjue02@gmail.com> <200512282132.13055.yuanjue02@gmail.com> <43B298FC.4030002@locolomo.org> In-Reply-To: <43B298FC.4030002@locolomo.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200601011609.22846.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: Sun, 01 Jan 2006 08:06:39 -0000 On Wednesday 28 December 2005 21:54, Erik Norgaard wrote: > Yuan Jue wrote: > >>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. > > > > how can I configure the wireless interface to use DHCP in dhclient.conf? > > like as follows? > > The dhclient.conf does not contain any interface configuration values > unless you write it. dhcp automatically reads dhclient.conf on startup, > so you just need to enable dhcp for the interfaces you want configured. > > In rc.conf insert > > interface_ath0="DHCP" > interface_bge0="DHCP" > > Create dhclient.conf like this > > interface ath0 { > default { > ... the default configuration for your wireless nic ... > } > } > interface bge0 { > default { > ... the default configuration for your wired nic ... > } > } > > No need to mention any scripts in dhclient.conf. In the default > configuration you need to specify at least: ip address, netmask, router > and nameserver, see dhclient.conf(5) for the names of those variables. > > You only need to create an interface specific section if you need to > configure the nic with values other than those provided by the dhcp > server. If your ath0 is always configured with dhcp (as I understood) > and you are happy with that, no need to make that section in the > dhclient.conf - or keep it empty. > > Then run > > # /etc/rc.d/netif restart thanks for your kind suggestions :) it is very useful. but, in my situation, there are two things needed to mention: 1. normally the wireless NIC is not in the kernel when system boots, so no need to "if_ath0="DHCP" every time 2. usually I use my laptop in dormitory with a static IP address. so no need to "if_bge0="DHCP" every time finally, I figure out that "ifconfig bge0 delete" before I wanna use the wireless NIC would sound better for me :) -- Best Regards. Yuan Jue