Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Jan 2006 16:09:22 +0800
From:      Yuan Jue <yuanjue02@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Wireless NIC in FreeBSD 6.0 ?
Message-ID:  <200601011609.22846.yuanjue02@gmail.com>
In-Reply-To: <43B298FC.4030002@locolomo.org>
References:  <200512251530.21898.yuanjue02@gmail.com> <200512282132.13055.yuanjue02@gmail.com> <43B298FC.4030002@locolomo.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200601011609.22846.yuanjue02>