dhclient.conf for ath wireless

Sam Leffler sam at errno.com
Tue Jul 5 16:16:37 GMT 2005


Erik Nørgaard wrote:
> Hi,
> 
> This is posibly just missing documentation, but it may be a bug or 
> undesirable behaivour. I have read the ath, ifconfig, dhclient and 
> dhclient.conf man pages, searched the web and asked in questions@, but 
> not found an answer.
> 
> I am running -CURRENT with the new port of dhclient from OpenBSD. The 
> problem is that dhclient most often associante with my neighbours AP 
> instead of mine.
> 
> The man-pages mentions the "media" statement and according to the 
> examples I can find in google I should add an entry like this:
> 
> interface "ath0" {
>     media "ssid MYAP mode 11g";
> }
> 
> in dhclient.conf. But on boot, dhclient enters into an infinite loop 
> bringing up and down the interface, until I break it. I have to manually 
> run "ifconfig ath0 ssid MYAP mode 11g" and then start dhclient manually 
> to force it to associate correctly with MYAP.

The media support in dhclient is never going to work for wireless 
devices under 6.x.  That it worked before was mostly an accident (trust 
me).  I've had some discussions with other folks and we're pretty much 
in agreement that we should deprecate it's usage for wireless devices. 
My feeling is that dhclient should not be involved in stuff like this; 
that it even grew media support was unfortunate.  If you want to do 
things like setup per-ssid static wep keys then wpa_supplicant is the 
intended mechanism.

> 
> Can anyone point me to the correct documentation?
> 
> I recall seeing one example which mentions something like this entry in 
> rc.conf:
> 
> interface_ath0="ssid MYAP mode 11g DHCP"
> 
> Is this correct?

If you have only one ap then I believe this should work.

> 
> Also, according to the examples I have seen, I should be able to list 
> multiple wireless networks with the media option in dhclient.conf and 
> dhclient will try them in order.
> 
> This is cool since I can then configure my nic to associate depending on 
> where I am. This seems not to be posible if the configuration goes into 
> rc.conf.
> 
> I have a 3Com wireless NIC and a comtrend AP. My dhcp server is isc-dhcp 
> v.3 running on FBSD 5.4. I usually get associated with my neighbours 
> 3Com AP running with a default setup.

The way to do this is with wpa_supplicant.  You specify a network block 
for each potential ssid in the wpa_supplicant.conf file:

network={
         ssid="MYAP"
         key_mgmt=NONE
         wep_key1=0102030405"
         wep_tx_keyidx=1
}

Unfortunately the existing code in CVS does not handle this correctly. 
I've got commits pending re approval to make it work right.

	Sam


More information about the freebsd-current mailing list