LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking > Linux - Wireless Networking
User Name
Password
Linux - Wireless Networking This forum is for the discussion of wireless networking in Linux.

Notices

Reply
 
Search this Thread
Old 11-16-2007, 11:05 PM   #1
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Rep: Reputation: 0
WPA configuration for Ubuntu 7.10


Hi,

Ubuntu 7.10 found my wireless card great, and I can get it to connect to my Linksys AP using WEP but the next step is to use WPA. (When I configure the AP and Windows to use WPA personal with TKIP using the same wireless card I can connect OK.)

Here's what I've got:

root@milleniumfalcon:/etc/network# uname -a
Linux milleniumfalcon 2.6.22-14-generic #1 SMP Sun Oct 14 23:05:12 GMT 2007 i686 GNU/Linux

Dlink DWL-AG660 on ath0

wpa supplicant and all of it's fanfare...
Wireless Extensions 22

I have no /etc/network/wpa_supplicant.conf, but I do have....

root@milleniumfalcon:/etc/network# cat /etc/network/interfaces
auto lo
iface lo inet loopback


iface ath0 inet dhcp
wpa-driver wext
wpa-key-mgmt WPA-PSK
wpa-proto WPA2
wpa-ssid all_seeing_eye
psk = "mypassphrase"

Here's what happens when I try to connect...

root@milleniumfalcon:/etc/network# ifup ath0
There is already a pid file /var/run/dhclient.ath0.pid with pid 134519120
Internet Systems Consortium DHCP Client V3.0.5
Copyright 2004-2006 Internet Systems Consortium.
All rights reserved.
For info, please visit ******

wifi0: unknown hardware address type 801
wifi0: unknown hardware address type 801
Listening on LPF/ath0/00:0f:3d:34:e0:dd
Sending on LPF/ath0/00:0f:3d:34:e0:dd
Sending on Socket/fallback
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 3
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

....

I've spent the last several evenings on this, your advice is appreciated!
 
Old 11-17-2007, 12:34 AM   #2
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Quote:
wifi0: unknown hardware address type 801
wifi0: unknown hardware address type 801
Listening on LPF/ath0/00:0f:3d:34:e0:dd
Sending on LPF/ath0/00:0f:3d:34:e0:dd
I don't have an atheros chip and having both wifi0 and ath0 at first confused me until I remembered seeing something similar before. But the unknown hardware address message makes me wonder if the kernel module you needed is modprobed, or if necessary the firmware extracted. Can you use "sudo /usr/sbin/iwlist scan" and see if the AP is listed? If so then your device is probably working.

The wpa_supplicant package includes the wpa_cli program. You can use it to try to connect manually or to monitor what is happening, and list the status.

Code:
sudo /usr/sbin/wpa_cli -p /var/run/wpa_supplicant -i eth1
...
Interactive mode

> status
bssid=00:14:bf:13:0d:9d
ssid=xihprom
id=0
pairwise_cipher=TKIP
group_cipher=TKIP
key_mgmt=WPA-PSK
wpa_state=COMPLETED
ip_address=192.168.1.100

Last edited by jschiwal; 11-17-2007 at 09:08 PM.
 
Old 11-17-2007, 10:59 PM   #3
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks for the tip jschiwal!

iwlist ap and iwlist scan both give me results and my AP's essid shows up.

I played around with wpa_cli for awhile and this is what I came up with:

> status
wpa_state=SCANNING

> scan_results
bssid / frequency / signal level / flags / ssid
00:16:b6:23:69:94 2437 209 [WPA-PSK-TKIP] all_seeing_eye
.......................

When I ifdown ath0, wpa_cli takes notice...

> <2>CTRL-EVENT-TERMINATING - signal 15 received
'PING' command timed out.
Connection to wpa_supplicant lost - trying to reconnect


Then ifup ath0...

Connection to wpa_supplicant re-established



Playing with get_capability gives this...

> get_capability pairwise
CCMP TKIP>
> get_capability group
CCMP TKIP WEP104 WEP40>
> get_capability key_mgmt
NONE IEEE8021X WPA-EAP WPA-PSK>
> get_capability proto
RSN WPA>
> get_capability auth_alg
>

Not sure why the last get_capability didn't yield anything.

Tried setting a passphrase in wpa_cli in two ways, then running dhclient ath0...

> passphrase all_seeing_eye mypassphrase
OK
> password all_seeing_eye mypassphrase
OK

... but same results, I failed to get a DHCP lease.

Tried another way to set the passphrase...

> otp all_seeing_eye mypassphrase
OK

Then dhclient ath0... same results, can't get a lease.

It seems to want to try and connect to my AP, maybe getting it from /etc/network/interfaces...

> list_networks
network id / ssid / bssid / flags
0 all_seeing_eye any

> select_network GreensGrow
OK

> list_networks
network id / ssid / bssid / flags
0 all_seeing_eye any


Trying to figure out if wpa_supplicant is really trying to use the passphrase that I've told it to use in /etc/network/interfaces...

> mib
dot11RSNAOptionImplemented=TRUE
dot11RSNAPreauthenticationImplemented=TRUE
dot11RSNAEnabled=FALSE
dot11RSNAPreauthenticationEnabled=FALSE
dot11RSNAConfigVersion=1
dot11RSNAConfigPairwiseKeysSupported=5
dot11RSNAConfigGroupCipherSize=0
dot11RSNAConfigPMKLifetime=43200
dot11RSNAConfigPMKReauthThreshold=70
dot11RSNAConfigNumberOfPTKSAReplayCounters=1
dot11RSNAConfigSATimeout=60
dot11RSNAAuthenticationSuiteSelected=00-00-00-0
dot11RSNAPairwiseCipherSelected=00-00-00-0
dot11RSNAGroupCipherSelected=00-00-00-0
dot11RSNAPMKIDUsed=
dot11RSNAAuthenticationSuiteRequested=00-00-00-0
dot11RSNAPairwiseCipherRequested=00-00-00-0
dot11RSNAGroupCipherRequested=00-00-00-0
dot11RSNAConfigNumberOfGTKSAReplayCounters=0
dot11RSNA4WayHandshakeFailures=0
dot1xSuppPaeState=1
dot1xSuppHeldPeriod=60
dot1xSuppAuthPeriod=30
dot1xSuppStartPeriod=30
dot1xSuppMaxStart=3
dot1xSuppSuppControlledPortStatus=Unauthorized
dot1xSuppBackendPaeState=1
dot1xSuppEapolFramesRx=0
dot1xSuppEapolFramesTx=0
dot1xSuppEapolStartFramesTx=0
dot1xSuppEapolLogoffFramesTx=0
dot1xSuppEapolRespFramesTx=0
dot1xSuppEapolReqIdFramesRx=0
dot1xSuppEapolReqFramesRx=0
dot1xSuppInvalidEapolFramesRx=0
dot1xSuppEapLengthErrorFramesRx=0
dot1xSuppLastEapolFrameVersion=0
dot1xSuppLastEapolFrameSource=00:00:00:00:00:00

Does this mean it's not really using /etc/network/interfaces-->>

> interface ath0
Connected to interface 'ath0.
> reconfigure
FAIL

???

Not sure what this means either-->>

> preauthenticate all_seeing_eye
FAIL

So it looks like the card is talking with the kernel and software OK, but I don't see proof that wpa_supplicant is trying to use the passphrase I'm giving it through either /etc/network/interfaces or wpa_cli.
 
Old 11-18-2007, 12:45 PM   #4
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Could you list the output of /usr/sbin/ifconfig? Maybe refresh my memory on why both ath0 and wifi0 are used? Is the correct one used with wpa_supplicant? I think this is how your particular driver works but I'm not sure. Maybe with this driver you are supposed to use it's own version of wireless-tools; however since you do get an output from iwlist scan, it might be OK. On my system, I configure the wireless device with /etc/sysconfig/network/ifcfg-<interface>. Are you configuring the correct interface? Can you connect to the router directly and cut and past the pre-shared-key? I use a random 64 digit hex key and copying it to a pen-drive is the only way I can get it entered correctly.

Also, double check that you don't have an alternate driver available. If you do, black list it. This could come into play if you had a broadcom device. You would need to blacklist bcm43xx to use ndiswrapper. Also, make sure someone else isn't using your essid. I had that happen to me once. My laptop would authenticate but my desktop wouldn't. Changing the essid fixed the problem.

I am using bcm43xx for my laptop presently. In the past, I had to use an older version of ndiswrapper from source. I would re-compile a new version everytime I updated the kernel.

Also, read through the README file for your driver. For ndiswrapper and bcm43xx-fwcutter, there are version numbers to the drivers which work (the windows drivers where the firmware is cut from).

I'm sorry I can't be of more use. You are using a different driver than I use and your distro configures networking differently.

----

Try to explicitly set the frequency and the AP's mac address. That might help some. Remember that you have done this if you get it working and change either in the router.
 
Old 11-18-2007, 05:25 PM   #5
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Original Poster
Rep: Reputation: 0
OK, here's what ifconfig finds:

root@milleniumfalcon:/var/run/wpa_supplicant# ifconfig
ath0 Link encap:Ethernet HWaddr 00:0F:3D:34:E0D
inet6 addr: fe80::20f:3dff:fe34:e0dd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

eth0 Link encap:Ethernet HWaddr 00:14:22:EE:A8:51
inet addr:192.168.2.120 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::214:22ff:feee:a851/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3809 errors:0 dropped:0 overruns:0 frame:0
TX packets:2650 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2640120 (2.5 MB) TX bytes:427726 (417.7 KB)
Interrupt:19

eth1 Link encap:Ethernet HWaddr 00:16:6F:32:75:5A
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:110603 errors:0 dropped:0 overruns:0 frame:0
TX packets:9368 errors:0 dropped:0 overruns:0 carrier:1
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:18 Base address:0x2000 Memory:dfcfd000-dfcfdfff

wifi0 Link encap:UNSPEC HWaddr 00-0F-3D-34-E0-DD-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:78576 errors:0 dropped:0 overruns:0 frame:9375
TX packets:29941 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:199
RX bytes:8005429 (7.6 MB) TX bytes:1259260 (1.2 MB)
Interrupt:17

****************************

eth0 is a wired NIC, eth1 is the built-in ipw2200 that comes with my Dell, but I've had no luck with it either. The DWL is supposed to have more capability... =/
 
Old 11-19-2007, 08:18 AM   #6
rufius
Member
 
Registered: Oct 2002
Location: Miami, FL
Distribution: Ubuntu
Posts: 184

Rep: Reputation: 30
Have you tried just using NetworkManager? I use it with WPA without issue. Just a thought since its a very useful tool made to make this kind of thing a lot less painful.
 
Old 11-20-2007, 07:48 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
Quote:
eth1 is the built-in ipw2200 that comes with my Dell, but I've had no luck with it either.
So you have two wireless devices. Try shutting down eth1 if you are trying to get wifi0 working on another device.

Before that, to satisfy my curiosity, could you post the contents of /var/run/wpa_supplicant/.
sudo ls /var/run/wpa_supplicant

I wonder if it has /var/run/wpa_supplicant/eth1 instead of /var/run/wpa_supplicant/wifi0.

Also, I don't see an ath0 or ath1 device listed in your ifconfig list. Should you be using wifi0 instead. I'm afraid I'm not familiar with this device.

Let's back up a bit. Try "sudo /usr/sbin/iwlist scan wifi0" and "sudo /usr/sbin/iwlist scan ath0" and see what they spit out. Also look at "sudo /usr/sbin/iwconfig". That will list your wireless devices. As well, when wpa_supplicant is trying to connect, in another shell print out your "wpa_supplicant.conf" in /var/run/ or /var/run/wpa_supplicant. However if you use NetworkManager, you may not have one.

On second thought, if you can run wpa_cli, enter "interface". That will show the available wireless interfaces. The "/usr/sbin/iwconfig" will show that as well. I am wondering if you are configuring one device and wpa_supplicant is trying to use the other.

Last edited by jschiwal; 11-20-2007 at 08:03 PM.
 
Old 11-21-2007, 07:04 PM   #8
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by rufius View Post
Have you tried just using NetworkManager?

Tried it, it won't connect with WPA... just sits there.
 
Old 11-21-2007, 07:15 PM   #9
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by jschiwal View Post
Also, I don't see an ath0 or ath1 device listed in your ifconfig list. Should you be using wifi0 instead.
ifconfig finds ath0 in my previous post->

>root@milleniumfalcon:/var/run/wpa_supplicant# ifconfig
>ath0 Link encap:Ethernet HWaddr 00:0F:3D:34:E0D

Quote:
Originally Posted by jschiwal View Post
Let's back up a bit. Try "sudo /usr/sbin/iwlist scan wifi0" and "sudo /usr/sbin/iwlist scan ath0" and see what they spit out.
I should be configuring wifi0 instead of ath0?

I'll post your requested info after the holiday when I have access to my stuff again. Thanks for all of your help!
 
Old 11-22-2007, 03:56 AM   #10
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I downloaded the madwifi package to read it's readme file.

Code:
Using the driver
----------------

The driver should support any Atheros-based Cardbus or PCI device.  This
version of the driver is managed and controlled by the usual Linux tools
(ifconfig, iwconfig, iwpriv) plus the wlanconfig tool, which is included
with the driver in the tools directory and gets installed on your system
with make install.

First, run "modprobe ath_pci" or the equivalent using "insmod".  When
the driver is successfully loaded it creates two devices, named "wifi0"
and "ath0".  The output from iwconfig should look like this:

    lo      no wireless extensions.

    wifi0   no wireless extensions.

    ath0    IEEE 802.11b  ESSID:""
            Mode:Managed  Channel:0  Access Point: Not-Associated
            Bit Rate:0 kb/s   Tx-Power:50 dBm   Sensitivity=0/3
            Retry:off   RTS thr:off   Fragment thr:off
            Power Management:off
            Link Quality=0/94  Signal level=-95 dBm  Noise level=-95 dBm
            Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
            Tx excessive retries:0  Invalid misc:0   Missed beacon:0


This driver uses wifi%d only as a placeholder for the physical device,
and will create one wifi device for each wireless NIC in the system.
These wifi devices will reject ifconfig and iwconfig commands.  The wifi
interface indicates the existence of a physical MadWifi device, but it
is not of any functional interest other than as the starting point for
VAP creation via wlanconfig (see Virtual AP section below).

By default, an ath%d Managed mode interface is also created.  This
device is a "virtual ap" (VAP) of the wifi%d physical device, and is
configurable by the standard networking tools  - ifconfig, iwconfig,
iwpriv.
So the answer is to use ath0 and not wifi0.
I also learned that you can use wireless-tools with it. I remember that not always being the case.

Running "sudo /usr/sbin/iwlist ath0 scan" should tell you if the device is working. It should print out information on each AP in range.

Another thing you could try is monitoring /var/log/messages while trying to start the interface.
"sudo tail -f /var/log/messages". Maybe it will indicate something there.

Also try doing the same with wpa_cli:
"sudo /usr/sbin/wpa_cli -p /var/run/wpa_supplicant/ -i ath0"

I just restarted my interface:
Code:
 <2>CTRL-EVENT-TERMINATING - signal 15 received
'PING' command timed out.
Connection to wpa_supplicant lost - trying to reconnect
Connection to wpa_supplicant re-established
<2>WPA: Key negotiation completed with 00:14:bf:13:0d:9d [PTK=TKIP GTK=TKIP]
<2>CTRL-EVENT-CONNECTED - Connection to 00:14:bf:13:0d:9d completed (auth) [id=0 id_str=]
Be sure to read the madwifi README file. I think that the answer may be in there.

Last edited by jschiwal; 11-22-2007 at 03:57 AM.
 
Old 11-30-2007, 09:57 PM   #11
seanovision
LQ Newbie
 
Registered: Nov 2007
Posts: 11

Original Poster
Rep: Reputation: 0
OK, ready for this?? I'm ready to slap myself silly...

So the wireless router I've been using is a Linksys wrt54g v.5. I've been trying to figure why it's been giving me problems with nmap scans. See:

http://www.ethicalhacker.net/compone...8/topicseen,1/

Well, I set up the new Trendnet from Windows and couldn't get ANY form of encryption to work until I disabled Windows zero-config and used the software that came from the cards. Then encryption worked!

Encouraged, I rebooted into Ubuntu and both wireless cards pretty much connected right away!

To summarize, here's a handy dandy chart:

Linksys WRT54G v.5 | Windows = zero config = WEP and WPA | Ubuntu = WEP, no WPA
Trendnet TEW-452BRP | Windows = zero config = no encryption | Ubuntu = WEP and WPA


Thank you for all the help though, I learned a lot more about Linux wireless tools in just a couple of weeks through here than I have in a long time! :-)
 
Old 04-10-2010, 07:30 AM   #12
billkershner
LQ Newbie
 
Registered: Apr 2010
Posts: 1

Rep: Reputation: 0
kill avahi-autoipd on this older hardware

Working with some older hardware and found this thread that was helpful. While seano got a new router that dealt with zeroconf differently, my solution was to kill the avahi-autoipd daemon by running the commmand avahi-autoipd -k ath0

hope this helps someone else who may also be cobbling together some old hardware and running into same trouble.

Thanks for your posts, this was very helpful.
 
  


Reply


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 support in ubuntu 7.0.4 mkhan919 Ubuntu 2 04-12-2007 06:29 PM
Wireless configuration with WPA on FC6 without wpa_supplicant? Lead Expression Linux - Wireless Networking 2 02-19-2007 07:29 AM
How to use WPA in Ubuntu eletido Linux - Wireless Networking 1 01-16-2007 03:42 AM
Ubuntu and WPA aeuzent Linux - Wireless Networking 2 09-18-2006 01:38 PM


All times are GMT -5. The time now is 01:30 AM.

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