LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices

Reply
 
Search this Thread
Old 09-02-2008, 07:21 AM   #1
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Rep: Reputation: 15
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.
 
Old 09-02-2008, 03:16 PM   #2
cgoetz
LQ Newbie
 
Registered: Oct 2004
Location: Brussels
Posts: 6

Rep: Reputation: 0
Cool 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
 
Old 09-02-2008, 03:25 PM   #3
cgoetz
LQ Newbie
 
Registered: Oct 2004
Location: Brussels
Posts: 6

Rep: Reputation: 0
Smile 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
 
Old 09-26-2008, 09:33 AM   #4
TotalLinuxNoob
Member
 
Registered: Apr 2005
Distribution: Ubuntu
Posts: 109

Original Poster
Rep: Reputation: 15
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.
 
Old 09-26-2008, 04:21 PM   #5
fragos
Senior Member
 
Registered: May 2004
Location: Fresno CA USA
Distribution: Ubuntu 10.10
Posts: 1,466

Rep: Reputation: 51
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.
 
  


Reply

Tags
wireless, wpasupplicant


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
wpa-psk, wpa_supplicant/madwifi/atheros association woes stardotstar Linux - Wireless Networking 7 10-18-2006 10:22 PM
wpa_supplicant addisonzinser Slackware 0 02-04-2006 12:12 AM
need help with wpa_supplicant slinky2004 Linux - Software 7 12-30-2005 07:07 PM
wpa_supplicant (AGAIN) gbergeson Linux - Laptop and Netbook 10 08-03-2005 08:28 AM
WPA_Supplicant Fraudulent Linux - Wireless Networking 0 10-04-2004 07:07 AM


All times are GMT -5. The time now is 04:12 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration