NetBSD-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wpa_supplicant and dhcp

On Jan 23, 2010, at 9:56 AM, Sad Clouds wrote:

> On Saturday 23 January 2010 13:42:27 Steven Bellovin wrote:
>> On Jan 23, 2010, at 6:49 AM, Sad Clouds wrote:
>>> What is the recommended way to run wpa_supplicant with dhcp?
>>> I have a laptop, which needs to connect to a wireless home network. The
>>> problem I'm having is that dhcp client runs before wpa_supplicant, so it
>>> can't acquire a proper IP address. There is a thread about it on
>>> current-users list, but I can't see anything that resolves the issue...
>> Are you sure about that order?  When I look at /etc/rc.d/wpa_supplicant, it
>> says
>>      # PROVIDE: wpa_supplicant
>>      # REQUIRE: network mountcritlocal
>>      # BEFORE: NETWORKING dhclient
>> What does your machine say?
>>              --Steve Bellovin,
> It's difficult to see what happens on the screen, the messages scroll up very 
> fast and there is not much in /var/log. So maybe dhclient runs before 
> wpa_supplicant.

Right, that's not what I was asking.

First -- look at /etc/rc.d/wpa_supplicant.  Does yours have the same lines as 
mine?  (I do see what appears to be a bug: wpa_supplicant says it has to occurs 
before dhclient; I think it should also say that it has to occur before dhcpcd. 
 If you're using dhcpcd as your dhcp client, that might be the problem.)

Second: to see what order things are run in at boot time, try the following:

        cd /etc/rc.d
        rcorder -s start *

probably redirected to a file or piped to 'more' or some such.

Third: if you do use dhclient, do you have any interface {...} clauses in a 
dhclient.conf file?  In at least some cases, the presence of such clauses seems 
to cause dhclient (via its shell script) to issue ifconfigs and hence ioctls 
that reset the device.  If it's not locking in well to the RF signal -- and 
I've had a *lot* of trouble with that -- the reset is deadly, because it makes 
the scan start over.  (I have a wpi0 interface; it usually works at home, but 
rarely works well elsewhere.)

                --Steve Bellovin,

Home | Main Index | Thread Index | Old Index