Configuring Wireless with wpa_supplicant
I'm having trouble getting dhcp working with my wireless setup and I think the issue may be in the sequence of commands needed to bring things up properly. After googling and reading tons of stuff on using ndiswrapper and wpa_supplicant, I'm still foggy on how it all works together, especially with regard to the many configuration files in /etc/sysconfig/network. My laptop is a HP zv5320, I have eth0 working fine and with ndiswrapper, I can get wlan0 working with WEP. Adding wpa_supplicant to the mix and I can connect to the AP fine, but dhcp doesn't seem to work properly. No route and no dns ever gets set up. I'm hoping someone can answer these for me... 1) Do I have to bring eth0 down in order for dhcp to work on wlan0? 2) What is the exact sequence for starting up wlan0 with wpa_supplicant? I've tried various combinations with confusing results... 3) Assuming someone knows the answer to #2 above, in which of the many files/scripts under /etc/sysconfig/network would one put those commands so things can startup appropriately at boot time? Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.111-default x86_64
On Tuesday 26 October 2004 05:52, Scott Leighton wrote:
I'm having trouble getting dhcp working with my wireless setup and I think the issue may be in the sequence of commands needed to bring things up properly. After googling and reading tons of stuff on using ndiswrapper and wpa_supplicant, I'm still foggy on how it all works together, especially with regard to the many configuration files in /etc/sysconfig/network.
My laptop is a HP zv5320, I have eth0 working fine and with ndiswrapper, I can get wlan0 working with WEP. Adding wpa_supplicant to the mix and I can connect to the AP fine, but dhcp doesn't seem to work properly. No route and no dns ever gets set up.
I'm hoping someone can answer these for me...
1) Do I have to bring eth0 down in order for dhcp to work on wlan0? No !
2) What is the exact sequence for starting up wlan0 with wpa_supplicant? I've tried various combinations with confusing results... Which card do you have? is it pcmcia or mini pci? what is the model!
3) Assuming someone knows the answer to #2 above, in which of the many files/scripts under /etc/sysconfig/network would one put those commands so things can startup appropriately at boot time? /etc/rc.d.README says this:
Hi! Some people expect the system startup scripts in /etc/rc.d/. We use a slightly different structure for better LSB compliance. You can find the equivalent files in /etc/init.d/. The behaviour of the scripts can be configured in the files below the directory /etc/sysconfig/. For detailed information please have a look into the SuSE Linux manual. If you don't have a printed manual, you can find the electronic version in /docu on the first CDROM or in the package 'books.rpm'. You may also want to read /etc/init.d/README for more information. Have a lot of fun Your SuSE Team
Scott
-- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.111-default x86_64
-- Chadley Wilson Redhat Certified Technician Cert Number: 603004708291270 Pinnacle Micro Manufacturers of Proline Computers ==================================== Exercise freedom, Use LINUX =====================================
On Monday 25 October 2004 9:52 pm, Chadley Wilson wrote:
On Tuesday 26 October 2004 05:52, Scott Leighton wrote:
2) What is the exact sequence for starting up wlan0 with wpa_supplicant? I've tried various combinations with confusing results...
Which card do you have? is it pcmcia or mini pci? what is the model
Built-in, Broadcom BCM94306. Works fine WEP but I have to connect to an AP that uses WPA-PSK so wpa_supplicant comes into the picture. That's where my problems start.
3) Assuming someone knows the answer to #2 above, in which of the many files/scripts under /etc/sysconfig/network would one put those commands so things can startup appropriately at boot time?
/etc/rc.d.README says this:
Thanks, I know about init.d and the startup scripts there. It's the scripts in /etc/sysconfig/network that have me confused. I'll check the manuals again but I don't recall them addressing this particular setup. Another poster actually gave me some excellent pointers so I may have my questions answered. Thanks, Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.111-default x86_64
Scott Leighton writes:
My laptop is a HP zv5320, I have eth0 working fine and with ndiswrapper, I can get wlan0 working with WEP. Adding wpa_supplicant to the mix and I can connect to the AP fine, but dhcp doesn't seem to work properly. No route and no dns ever gets set up.
I'm hoping someone can answer these for me...
1) Do I have to bring eth0 down in order for dhcp to work on wlan0?
Yes, you can't have two live interfaces both updating your default route and DNS at the same time. The first one will take precedence. I ran into this same situation on my Toshiba laptop (which has built-in ethernet and wireless). The solution is to create two SCPM profiles, one with ethernet enabled but no wireless, and the other with wireless enabled but no ethernet. Then, create two grub boot entries so that I could choose to boot with either profile. If you don't have any SCPM profiles yet, this is how you would set it up on SuSE 9.1. (Assuming your ethernet interface is eth0 and wireless interface is wlan0): 0. Log in as root. 1. Make sure your MODIFY_RESOLV_CONF_DYNAMICALLY parameter is set to "yes" in your /etc/sysconfig/network/config file. 2. Save a backup copy of your /etc/sysconfig/network/ifcfg-eth* and /etc/sysconfig/network/ifcfg-wlan* files in your /tmp or in your home directory. 3. Delete the /etc/sysconfig/ifcfg-wlan* file 4. Connect the ethernet cable 5. Run "rcnetwork restart", and let DHCP set up your IP, DNS and default route. 6. scpm enable (This will create a "default" profile, which is ethernet-only, answer 'y' if asked any questions) 7. scpm copy default eth (This makes an explicit profile called "eth" for ethernet-only) 8. Disconnect your ethernet cable, make sure your wireless AP is working 9. Delete the /etc/sysconfig/ifcfg-eth* file 10. Restore the /etc/sysconfig/ifcfg-wlan* file, make sure this file has all the correct wireless ESSID and WEP configuration in it (i.e., WIRELESS_ESSID, WIRELESS_KEY*, WIRELESS_KEY_LENGTH, WIRELESS_MODE). 11. Run "rcnetwork restart", and let DHCP set up your IP, DNS and default route. 12. scpm reload (This will change the "default" profile to wireless- only, answer 'y' if asked any questions) 13. scpm copy default wlan (This makes an explicit profile called "wlan" for wireless-only) 14. scpm switch wlan (This switches your current profile to wlan) 15. Edit the /boot/grub/menu.lst file, and change the "Linux" entry so that the "Linux" name is "Linux ethernet", and append the boot parameter "PROFILE=eth". Also, add a new item in this file similar to the above, except that it's "Linux wireless" with "PROFILE=wlan". 16. You're now done. At boot time you can select which profile to use. 17. At run time, you can also switch profiles with the following command: scpm switch eth (Switch to ethernet-only profile. SCPM will automatically restart the network for you) or scpm switch wlan (Switch to wireless-only profile. SCPM will automatically restart the network for you) The "default" profile is not normally used, but only as a placeholder to create new profiles if needed. See scpm(8) man page for more info about SCPM and profile management. The SuSE 9.1 Admin Manual also has a good section on SCPM. Hope this helps. P.S. I didn't have to use wpa_supplicant so no info to share there. -Ti -- Ti Kan http://www.amb.org/ti Vorsprung durch Technik
On Monday 25 October 2004 9:56 pm, Ti Kan wrote:
Scott Leighton writes:
My laptop is a HP zv5320, I have eth0 working fine and with ndiswrapper, I can get wlan0 working with WEP. Adding wpa_supplicant to the mix and I can connect to the AP fine, but dhcp doesn't seem to work properly. No route and no dns ever gets set up.
I'm hoping someone can answer these for me...
1) Do I have to bring eth0 down in order for dhcp to work on wlan0?
Yes, you can't have two live interfaces both updating your default route and DNS at the same time. The first one will take precedence. I ran into this same situation on my Toshiba laptop (which has built-in ethernet and wireless). The solution is to create two SCPM profiles, one with ethernet enabled but no wireless, and the other with wireless enabled but no ethernet. Then, create two grub boot entries so that I could choose to boot with either profile.
Thanks Ti! That's very informative... I'm going to give it a shot. I appreciate the detailed info and pointers! Scott -- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.111-default x86_64
On Tuesday 26 October 2004 07:07, Scott Leighton wrote:
On Monday 25 October 2004 9:56 pm, Ti Kan wrote:
Scott Leighton writes:
My laptop is a HP zv5320, I have eth0 working fine and with ndiswrapper, I can get wlan0 working with WEP. Adding wpa_supplicant to the mix and I can connect to the AP fine, but dhcp doesn't seem to work properly. No route and no dns ever gets set up.
I'm hoping someone can answer these for me...
1) Do I have to bring eth0 down in order for dhcp to work on wlan0?
Yes, you can't have two live interfaces both updating your default route and DNS at the same time. The first one will take precedence. I ran into this same situation on my Toshiba laptop (which has built-in ethernet and wireless). The solution is to create two SCPM profiles, one with ethernet enabled but no wireless, and the other with wireless enabled but no ethernet. Then, create two grub boot entries so that I could choose to boot with either profile.
Thanks Ti! That's very informative... I'm going to give it a shot. I appreciate the detailed info and pointers!
Scott That is a very good idea, but it would not work for me (I think) I need both interfaces up at work, to access two networks.
-- POPFile, the OpenSource EMail Classifier http://popfile.sourceforge.net/ Linux 2.6.5-7.111-default x86_64
-- Chadley Wilson Redhat Certified Technician Cert Number: 603004708291270 Pinnacle Micro Manufacturers of Proline Computers ==================================== Exercise freedom, Use LINUX =====================================
Chadley Wilson writes:
... That is a very good idea, but it would not work for me (I think) I need both interfaces up at work, to access two networks.
Well in that case you wouldn't want both interfaces to set up your default route and DNS. You only want one of them to do that, and have a specialized route for the other. For that, you should create a /etc/sysconfig/network/ifroute-wlan* file (assuming that you want to hard wire a non-default route to the wireless side, and let DHCP set up the default route and DNS on the ethernet side). See routes(5) for details on the file format. -Ti -- Ti Kan http://www.amb.org/ti Vorsprung durch Technik
On Tuesday 26 October 2004 01:11 am, Ti Kan wrote:
Well in that case you wouldn't want both interfaces to set up your default route and DNS. You only want one of them to do that, and have a specialized route for the other. For that, you should create a /etc/sysconfig/network/ifroute-wlan* file (assuming that you want to hard wire a non-default route to the wireless side, and let DHCP set up the default route and DNS on the ethernet side). See routes(5) for details on the file format.
I may have another solution to this problem. I use Knemo which like in the 'other' OS, monitors the interfaces and does a manual connection to the one that has a connection. If the wire is not connected the wireless card is fired up and it looks for a connection. Makes life a lot nicer and is much more reliable than XP on the same laptop. Richard -- Old age ain't for Sissies!
participants (4)
-
Chadley Wilson
-
Richard
-
Scott Leighton
-
ti@amb.org