LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Ubuntu (http://www.linuxquestions.org/questions/ubuntu-63/)
-   -   wpa_supplicant woes (http://www.linuxquestions.org/questions/ubuntu-63/wpa_supplicant-woes-667069/)

TotalLinuxNoob 09-02-2008 07:21 AM

wpa_supplicant woes
 
At the college I'm attending window users are required to install the SecureW2 EapSuite. Previously however I have been able to access the network using ubuntu and wpa_supplicant but I am unable to do so on my new laptop. One difference is the wireless interface name is now wlan0 instead of eth0 as it was on my old laptop.

wpa / dhclient output:
Code:

wpa_supplicant -Bw -Dwext -iwlan0 -c/etc/wpa_supplicant/wlan.conf
user@hostname:/home/user# dhclient wlan0
There is already a pid file /var/run/dhclient.pid with pid 8406
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/wlan0/00:1d:e0:b5:c9:49
Sending on  LPF/wlan0/00:1d:e0:b5:c9:49
Sending on  Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 1
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

wpa config file:
Code:

      ctrl_interface=/var/run/wpa_supplicant

      #ap_scan=2

      network={

              ssid="mywifinetworkname"

              scan_ssid=1

              proto=WPA RSN

              key_mgmt=IEEE8021X

              eap=TTLS

              identity="myusername"

              password="mypw"

              phase2="auth=PAP"

      }

When connecting to the wireless network using the old laptop I had to 'down' eth0 first. This does not remedy the problem this time though.

cgoetz 09-02-2008 03:16 PM

wpa_supplicant & dhclient
 
hi,

what I'm usually doing to troubleshoot wpa /dhcp is:

#killall dhclient
#killall dhcpcd
#killall wpa_supplicant

#iwconfig wlan0
#wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -w -B
#iwconfig wlan0

The last command should return ESSID="<my_wireless_network>"
Then verify your configuration is correct for <my_wireless_network>

#iwlist wlan0 scanning

This command should return the detected wireless networks & their settings. Make sure that ssid, proto ,key_mgmt, pairwise are set correctly in your /etc/wpa_supplicant.conf


I also noticed that running dhclient directly after wpa_supplicant startup i'snt good ! Make sure your computer joins the wireless network before starting dhclient ( waiting 5 seconds before running dhclient should do it).

Here a small script to start your wireless connection safely !
(just replace the kernel module iwll3945 with what you need)
----------------------------------------------------------

#!/bin/bash
#kill some daemons
killall dhclient 2>/dev/null
killall dhcpcd 2>/dev/null
killall wpa_supplicant 2>/dev/null
#reload kerneal module
ifconfig wlan0 down 2>/dev/null
rmmod iwll3945 2>/dev/null
sleep 1
modprobe iwl3945 2>/dev/null
ec="$?"
sleep1
if [ "$ec"="0" ]; then {
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -w -B &
echo -e "\nDetecting Wireless Network .... please wait\n"
sleep 5
iwconfig wlan0
sleep 1
echo "Sending dhcp request ..."
dhclient wlan0
if [ ! "$ec"="0" ]; then {
ec="$?"
echo "dhclient error retun code is $ec"
exit 1
}
fi
}
else
{
echo "the loading of your wireless kernel modules returned an error !"
exit 1
}
fi



-- goetz

cgoetz 09-02-2008 03:25 PM

Corrected script / missing line :-(
 
Here the corrected scipt:
(they was a missing ec="$?" after the 'dhclient wlan0' command)
---------------------------------------------------------------

#!/bin/bash
#kill some daemons
killall dhclient 2>/dev/null
killall dhcpcd 2>/dev/null
killall wpa_supplicant 2>/dev/null
#reload kerneal module
ifconfig wlan0 down 2>/dev/null
rmmod iwll3945 2>/dev/null
sleep 1
modprobe iwl3945 2>/dev/null
ec="$?"
sleep1
if [ "$ec"="0" ]; then {
wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -Dwext -w -B &
echo -e "\nDetecting Wireless Network .... please wait\n"
sleep 5
iwconfig wlan0
sleep 1
echo "Sending dhcp request ..."
dhclient wlan0
ec="$?"
if [ ! "$ec"="0" ]; then {
echo "dhclient error retun code is $ec"
exit 1
}
fi
}
else
{
echo "the loading of your wireless kernel modules returned an error !"
exit 1
}
fi


Hope this will help you :-)
-- cgoetz

TotalLinuxNoob 09-26-2008 09:33 AM

Thanks for your help and your script.

I followed your suggestions and it appeared connecting to the network worked but requesting an ip failed.

However, there is a currently a guide provided by my college on setting up ubuntu.

The guide uses networkmanager 0.6.5. When the applet is clicked (nm-applet) an option should be displayed 'connect to other wireless network'. This option on my machine is never displayed.

I'm running nm-applet 0.6.6 and the wireless card works (at least scanning local wireless networks, so I presume connecting does too). The only option available to me when clicking on the applet is edit wireless networks which is not the dialog I'm looking for.

Thanks for your help.

fragos 09-26-2008 04:21 PM

0.6.6 gives me "Connect to other wireless network" on my laptop with a running wireless connection. My desktop which doesn't have WiFi shows "Connect to 802.1X Protected Wired Network". The options apparently relate to whats available.


All times are GMT -5. The time now is 09:22 PM.