Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Dec 2005 14:54:04 +0100
From:      Erik Norgaard <norgaard@locolomo.org>
To:        Yuan Jue <yuanjue02@gmail.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Wireless NIC in FreeBSD 6.0 ?
Message-ID:  <43B298FC.4030002@locolomo.org>
In-Reply-To: <200512282132.13055.yuanjue02@gmail.com>
References:  <200512251530.21898.yuanjue02@gmail.com> <200512261107.45871.yuanjue02@gmail.com> <43AFB052.9070005@locolomo.org> <200512282132.13055.yuanjue02@gmail.com>

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

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



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