View Full Version : wpa and wirelss, i just dont seem to be able to "win" this battle.
shihan74
2008-01-22, 08:46 AM CST
I've switched between network manager and system-config-network a number of times now and tried combinations of the two, but there just doesn't seem to be a particularly workable solution so far.
The problem is that system-config-network and wpa just dont get along and NetworkManager doenst want to bring an interface up until i've logged in - and even though my psk's are hardcoded into wpa_supplicant.conf, it'll prompt for the keyring password on login (which is understandable in some ways).
The problem with system-config-network and wpa_supplicant is their startups. If i dont have a wired connection plugged in, i have to wait for two timeouts because dhclient times out for both (though eth's lack of network cable is picked up pretty quickly).
Now when f8 starts, ifup wlan0, eth0 get run (becuase they're onboot), but its too early because wpa_supplicant runs later in the boot and when dhclient doesnt get an ip address from either wlan0 or eth0 it exits (-wn would be nice). Not that it matter because even if wpa_supplicant started earlier ifup wlan0 would break it because ifup wlan0 runs iwconfig (mode, key and rate) and that kills wpa (i've tried this on several different wirless cards now, intel 3945 in-built, usb rt61, etc).
So, after all this i feel like in order to get my machine up i need to write a custom start script that does something like:
ifconfig wlan0 up
/etc/init.d/wpa_supplicant start
dhclient -wn wlan0
ifconfig eth0 up
dhclient -wn eht0
etc
etc.
From a software perspective it seems that most of the components are there but they're just not really able to work with wpa yet. (i mean even a little tick box that said "wpa" on the wireless link and a - "configure this in /etc/wpa... manually" to stop iwconfig from running and maybe tell dhclient -w) would work.
On a side note, why does iwconfig run for ethernet devices? for everything brung up with ifup it does a iwconfig <dev> key off
Or, have i missed something vital in the network config?
nyjetshead
2008-01-22, 09:13 AM CST
This might help you.
yum install wpa_supplicant-gui
You should disable NM if you are going to use this.
shihan74
2008-01-22, 09:21 AM CST
i know the wpa gui... that in itself isnt the problem, configuring wpa_supplicant is a relatively easy task.
What im more interested in is stopping iwconfig from running across the wlan interface and then making wpa_supplicant run earlier in the boot... or make dhclient persistent in the interface config, but background it so it doesnt introduce a 2 minute delay to startup.
Iron_Mike
2008-01-22, 09:29 AM CST
I've switched between network manager and system-config-network a number of times now and tried combinations of the two, but there just doesn't seem to be a particularly workable solution so far.
The problem is that system-config-network and wpa just dont get along and NetworkManager doenst want to bring an interface up until i've logged in - and even though my psk's are hardcoded into wpa_supplicant.conf, it'll prompt for the keyring password on login (which is understandable in some ways).
Yest, this is normal behavior as the keyring is the database/file where the keys are stored. There is a way to "automate the keyring" do a search here.
The problem with system-config-network and wpa_supplicant is their startups. If i dont have a wired connection plugged in, i have to wait for two timeouts because dhclient times out for both (though eth's lack of network cable is picked up pretty quickly).
Now when f8 starts, ifup wlan0, eth0 get run (becuase they're onboot), but its too early because wpa_supplicant runs later in the boot and when dhclient doesnt get an ip address from either wlan0 or eth0 it exits (-wn would be nice). Not that it matter because even if wpa_supplicant started earlier ifup wlan0 would break it because ifup wlan0 runs iwconfig (mode, key and rate) and that kills wpa (i've tried this on several different wirless cards now, intel 3945 in-built, usb rt61, etc).
So, after all this i feel like in order to get my machine up i need to write a custom start script that does something like:
ifconfig wlan0 up
/etc/init.d/wpa_supplicant start
dhclient -wn wlan0
ifconfig eth0 up
dhclient -wn eht0
etc
etc.
?
This will work, but the easy way is to use NetworkManager, IF you are using DHCP try this:
Enable the 2 NM services and disable the wpa_supplicant if it is enabled.
Next goto system ->administration ->network, highlight your devices and click edit. Remove the check mark for "activate on boot" on both devices and save it. Next add a check mark to "allow users to enable/disable device" save it and reboot. When the computer reboot, left click the NM icon (if your SSID is hidden) you will have to left click the icon and select "connect to other wireless network" and fill in the blanks. After that it will ask you for the "default keyring password" and then it will ask for your wpa passphrase again...
From a software perspective it seems that most of the components are there but they're just not really able to work with wpa yet. (i mean even a little tick box that said "wpa" on the wireless link and a - "configure this in /etc/wpa... manually" to stop iwconfig from running and maybe tell dhclient -w) would work.
On a side note, why does iwconfig run for ethernet devices? for everything brung up with ifup it does a iwconfig <dev> key off
Or, have i missed something vital in the network config?
BTW you forgot to mention what brand/type of wireless you're using..
nyjetshead
2008-01-22, 09:54 AM CST
Scripts are great but with wireless how will you handle disconnects so that they reconnect automatically?
NM has this functionality. The keyring can be automated, check out this link.
http://live.gnome.org/GnomeKeyring/Pam?highlight=%28keyring%29%7C%28pam%29
shihan74
2008-01-22, 10:51 AM CST
Yest, this is normal behavior as the keyring is the database/file where the keys are stored. There is a way to "automate the keyring" do a search here.
This will work, but the easy way is to use NetworkManager, IF you are using DHCP try this:
Enable the 2 NM services and disable the wpa_supplicant if it is enabled.
Next goto system ->administration ->network, highlight your devices and click edit. Remove the check mark for "activate on boot" on both devices and save it. Next add a check mark to "allow users to enable/disable device" save it and reboot. When the computer reboot, left click the NM icon (if your SSID is hidden) you will have to left click the icon and select "connect to other wireless network" and fill in the blanks. After that it will ask you for the "default keyring password" and then it will ask for your wpa passphrase again...
BTW you forgot to mention what brand/type of wireless you're using..
I did actually mention the chipsets, intel 3945 (as embedding on dell laptops), the d-llink rt61 based usb wireles - but i've tried quiet a few more than that. I understand network manager - its just very very buggy and wont bring up anything until you login. Like if im not paying attention to it and it asks me for a wpa password then i eventually just have to disable and re-enable wireless in nm so that it gets un-broken. And while its true to say that nm uses the keyring for wpa, its not the only way to do it either - that is just the way nm talks to wpa_supplicant via dbus (iirc).
As for automating the keyring, thats something i'd very-much prefer not to do. I never really said i was looking for easy either - just that i want a way of stopping iwconfig from being run at "ifup <interface>" without just blowing it away, persistent dhcp (easily configured - but introduces a 2 minute delay to startup) delayed initialization of interfaces (this used be possible, thought i cant find the configuration anymore). But, i'd prefer not to write my own start scripts because then you end up in a whole world of agony - the simple reason is hate putting anything on my machine that didnt come from an rpm (at least, not into places like /etc, /bin ...).
Actually, when i say 2 minute delay but its 1 minute per interface and when you have 5 interfaces plugged into various ports plus the wired ethernet that tends to get a little tedious.
shihan74
2008-01-22, 10:53 AM CST
Scripts are great but with wireless how will you handle disconnects so that they reconnect automatically?
NM has this functionality. The keyring can be automated, check out this link.
http://live.gnome.org/GnomeKeyring/Pam?highlight=%28keyring%29%7C%28pam%29
if you pre-configure wpa_supplicant.conf with your wireless networks and psk's it automatically goes out in search of them for you - reconnecting if necessary and persistent dhclient (i.e. not dhclient -1) will re-get addresses for you as well. Automating the keyring is something im really not very interested in doing.
Iron_Mike
2008-01-22, 11:42 AM CST
if you pre-configure wpa_supplicant.conf with your wireless networks and psk's it automatically goes out in search of them for you - reconnecting if necessary and persistent dhclient (i.e. not dhclient -1) will re-get addresses for you as well. Automating the keyring is something im really not very interested in doing.
Post your wpa_supplicant.conf.
I also just noticed that you are trying to bring wlan0 and eth0 up with IP addresses at the same time, why??? Are you trying to have a wireless connection and ethernet connection at the same time?
shihan74
2008-01-22, 09:56 PM CST
Post your wpa_supplicant.conf.
I also just noticed that you are trying to bring wlan0 and eth0 up with IP addresses at the same time, why??? Are you trying to have a wireless connection and ethernet connection at the same time?
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel
ap_scan=1
network={
ssid="level10"
psk="...."
}
network={
ssid="level11"
psk="....."
scan_ssid=1
}
etc...
Am i trying to have a wlan0 and an eth0 up at the same time? yes... though in reality i'd like to wlan not come up if eth0 does (something that nm does kind of do) when the machine boots (though it really doesnt matter too much), but often i need wlan0 while eth0 is up also (and not just wlan0, but wlan1,2,3)..
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.