David R. Litwin,

Thank you for your reply.  It has lead me to some great resources and I think I've finally nailed my problem.

In poking around with some of the links you supplied, I stubled upon the option to run rc.d script using the pre-up option of /etc/network/interfaces file.

Everytime (well, so far anyways) that I've restarted the computer it's come up properly.  What I had to do was edit the configuration file just a bit.

/etc/network/interfaces

#start config
# Home wireless config
iface eth1-home inet dhcp
        test wireless essid my_home_ssid
        pre-up invoke-rc.d wpasupplicant restart

# School wireless config
iface eth1-school inet dhcp
        test wireless essid my_school_ssid
        pre-up invoke-rc.d wpasupplicant restart

#end config

Basically, what it appears to be doing is once it notices that the wireless card has been associated with a new access point it calls ifplugd.  What it was appearing to do was hang at this point, and I am guessing it's due to the fact that the WEP/WPA/Whatever hasn't been associated with that entry yet.

By adding these lines, ifplugd will call a restart of wpasupplicant (which will then reinitialize any settinging for all interfaces that are currnently available).

So now we have associated with a AP, called ifplugd, its called wpasupplicant before 'ifup'-ing the interface which sets the encryption up, and finally ifplugd will up the interface.  This seems to bring it up just perfect everytime.

Now, as a side note, it is a bit harsh to have to restart wpasupplicant everytime we associate with a new access point.  But in playing around with modules and bringing things up in order, I noticed that wpasupplicant would only initialize interfaces that existed at the point that it was started/restarted.

What that means?  Well, you have to have all interface modules loaded, then call wpasupplicant, then have ifplugd notice the association (noauto lines all your interfaces ifplugd is watching),  in turn to recall wpasupplicant to set the appropriate values, to ifup your interface.

One last side note:  this is only need for the wireless interfaces obviously.  However, if you leave the entry in to connect to unencrypted links, you DO NOT have to restart wpasupplicant.  I'm guessing this is because no wireless WEP/WPA key's have to be set.

Finally, I hope I've explained myself without being too verbose. I wanted to make sure I was clear and consice without sounding like a broken record.  I may type all of this up and put it on a webpage some where.  Hopefullly someone will find this helpful.

Feel free to ask questions or comment if there's something that's not quite clear.

Thanks everyone,

Doug Miller

Reply via email to