Welcome to Linux Forums! With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > Wireless Internet > How to connect to my wireless WPA-PSK home network?

Forgot Password?
 Wireless Internet   Anything related to getting wireless set up in Linux. WLAN, WiFi, etc.

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds


Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 09-29-2007   #1 (permalink)
Linux User
 
Daan's Avatar
 
Join Date: Aug 2005
Location: The Netherlands
Posts: 291
Send a message via Skype™ to Daan
Question How to connect to my wireless WPA-PSK home network?

Hi. I have a WPA-PSK secured wireless home network. I can connect to it in Windows, but I did not get it working in Debian. I have wpasupplicant installed and I don't know what the problem is. Maybe you can help me with the information below.

Thanks!

Code:
schmauck:/home/daan# ping google.nl

schmauck:/home/daan# lsusb
Bus 005 Device 002: ID 0846:6a00 NetGear, Inc. WG111 WiFi (v2)
Bus 005 Device 001: ID 0000:0000
Bus 003 Device 002: ID 045e:0040 Microsoft Corp. Wheel Mouse Optical
Bus 003 Device 001: ID 0000:0000
Bus 004 Device 001: ID 0000:0000
Bus 002 Device 001: ID 0000:0000
Bus 001 Device 001: ID 0000:0000
schmauck:/home/daan# ndiswrapper -l
installed drivers:
net111v2                driver installed, hardware (0846:6A00) present
schmauck:/home/daan# iwconfig
lo        no wireless extensions.

eth1      no wireless extensions.

eth0      no wireless extensions.

wlan1     IEEE 802.11g  ESSID:off/any
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate:54 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3
          RTS thr:2432 B   Fragment thr:2432 B
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

vmnet1    no wireless extensions.

vmnet8    no wireless extensions.

schmauck:/home/daan# ifconfig wlan1
wlan1     Link encap:Ethernet  HWaddr XX:XX:XX:XX:XX:XX
          inet addr:192.168.1.66  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::218:4dff:fecf:373b/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

schmauck:/home/daan# iwconfig wlan1 key xxxxxxxxxx
schmauck:/home/daan# iwconfig wlan1 essid OurHome
schmauck:/home/daan# iwconfig wlan1
wlan1     IEEE 802.11g  ESSID:off/any
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate:54 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3
          RTS thr:2432 B   Fragment thr:2432 B
          Encryption key:1B0D-7F5D-AA   Security mode:restricted
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

schmauck:/home/daan# iwconfig wlan1 ap XX:XX:XX:XX:XX:XX
Invalid hardware address XX:XX:XX:XX:XX:XX
Error for wireless request "Set AP Address" (8B14) :
    invalid argument "XX:XX:XX:XX:XX:XX".

schmauck:/home/daan# iwconfig wlan1
wlan1     IEEE 802.11g  ESSID:off/any
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate:54 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3
          RTS thr:2432 B   Fragment thr:2432 B
          Encryption key:1B0D-7F5D-AA   Security mode:restricted
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Daan is offline  


Reply With Quote
Old 09-29-2007   #2 (permalink)
Linux Enthusiast
 
Join Date: Apr 2004
Location: UK
Posts: 597
Quote:
Originally Posted by Daan
schmauck:/home/daan# iwconfig wlan1 key xxxxxxxxxx
That line sets a WEP key, not a WPA key. To connect to a WPA secured network requires you to use something like wpa supplicant. You don't mention which distribution you use, but it's a fair bet that it would be included if it's something reasonably modern.

Some judicious web searching should give you everything you need, and if you run into problems you can always ask us here.

Let us know how you get on,

Chris...

P.S. Kudos for providing lots of info about what you have tried already, it makes for a great question.
__________________
DRM keeps an honest user loyal
kakariko81280 is offline   Reply With Quote
Old 09-29-2007   #3 (permalink)
Linux User
 
Daan's Avatar
 
Join Date: Aug 2005
Location: The Netherlands
Posts: 291
Send a message via Skype™ to Daan
Hi Chris,

Thanks for helping out. I'm using Debian Etch (as I've mentioned!).

I did some googling and this is as far as I got.

Below you can see I used wpa_cli. In the example below scan did not find any network, but a reboot or two before this, it actually did find some SpeedTouch network which is not mine. But my network is not found.

What am I doing wrong?

First, my interfaces file:
Code:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# This is a list of hotpluggable network interfaces.
# They will be activated automatically by the hotplug subsystem.
#mapping eth1
#	script grep
#	map eth1

# The primary network interface
#allow-hotplug eth1
#iface eth1 inet dhcp

#iface eth0 inet dhcp

iface wlan1 inet static
address 192.168.1.66
netmask 255.255.255.0
gateway 192.168.1.254
wpa-driver ndiswrapper
wpa-conf /etc/wpa_supplicant.conf

auto wlan1
And my wpa_supplicant.conf:
Code:
# allow frontend (e.g., wpa_cli) to be used by all users in 'users' group
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=users
#
# home network; allow all valid ciphers
network={
	ssid="CasaNova"
	scan_ssid=1
	key_mgmt=WPA-PSK
	psk="my_password"
}
Here's what I've tried:
Code:
schmauck:/home/daan# iwconfig
lo        no wireless extensions.

eth0      no wireless extensions.

eth1      no wireless extensions.

wlan1     IEEE 802.11g  ESSID:off/any
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          Bit Rate:54 Mb/s   Tx-Power:20 dBm   Sensitivity=0/3
          RTS thr:2432 B   Fragment thr:2432 B
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

sit0      no wireless extensions.

vmnet8    no wireless extensions.

vmnet1    no wireless extensions.

schmauck:/home/daan# ifconfig wlan1
wlan1     Link encap:Ethernet  HWaddr 00:18:4D:CF:37:3B
          inet addr:192.168.1.66  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::218:4dff:fecf:373b/64 Scope:Link
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

schmauck:/home/daan# wpa_cli wpa_cli v0.5.5
Copyright (c) 2004-2006, Jouni Malinen <jkmaline@cc.hut.fi> and contributors

This program is free software. You can distribute it and/or modify it
under the terms of the GNU General Public License version 2.

Alternatively, this software may be distributed under the terms of the
BSD license. See README and COPYING for more details.


Selected interface 'wlan1'

Interactive mode

> scan
OK
> scan_results
> list_networks
network id / ssid / bssid / flags
0       CasaNova        any
> enable_network 0
OK
> quit
schmauck:/home/daan# ping uva.nl

schmauck:/home/daan#
Daan is offline   Reply With Quote
Old 09-29-2007   #4 (permalink)
Linux Enthusiast
 
Join Date: Apr 2004
Location: UK
Posts: 597
Quote:
I'm using Debian Etch (as I've mentioned!).
Oops, -1 for reading comprehension.

Can I get you to try the following as root:

Code:
killall wpa_supplicant
wpa_supplicant -i wlan1 -c /etc/wpa_supplicant/wpa_supplicant.conf -D ndiswrapper -d
That should kill off any running instances of wpa_supplicant and then start a new one that prints out lots of debug messages. You'll hopefully get something like this

Quote:
EAPOL: SUPP_PAE entering state AUTHENTICATING
EAPOL: SUPP_BE entering state SUCCESS
EAP: EAP entering state DISABLED
EAPOL: SUPP_PAE entering state AUTHENTICATED
EAPOL: SUPP_BE entering state IDLE
If there are errors then post them here so we can take a look.

Also, can you run these commands so we can see the active network settings.

Code:
route -n
cat /etc/resolv.conf
iptables -L
This should let us see what the problem is.

Let us know how you get on,

Chris...
__________________
DRM keeps an honest user loyal
kakariko81280 is offline   Reply With Quote
Old 09-29-2007   #5 (permalink)
Linux User
 
Daan's Avatar
 
Join Date: Aug 2005
Location: The Netherlands
Posts: 291
Send a message via Skype™ to Daan
As you can see, I hit Ctrl-C after the wpa_supplicant command, because I thought it would not stop by itself.

Code:
schmauck:/home/daan# killall wpa_supplicant
schmauck:/home/daan# wpa_supplicant -i wlan1 -c /etc/wpa_supplicant/wpa_supplicant.conf -D ndiswrapper -d 
Initializing interface 'wlan1' conf '/etc/wpa_supplicant/wpa_supplicant.conf' driver 'ndiswrapper' ctrl_interface 'N/A' bridge 'N/A'
Configuration file '/etc/wpa_supplicant/wpa_supplicant.conf' -> '/etc/wpa_supplicant/wpa_supplicant.conf'
Reading configuration file '/etc/wpa_supplicant/wpa_supplicant.conf'
ctrl_interface='/var/run/wpa_supplicant'
ctrl_interface_group='users' (DEPRECATED)
Priority group 0
   id=0 ssid='CasaNova'
Initializing interface (2) 'wlan1'
EAPOL: SUPP_PAE entering state DISCONNECTED
EAPOL: KEY_RX entering state NO_KEY_RECEIVE
EAPOL: SUPP_BE entering state INITIALIZE
EAP: EAP entering state DISABLED
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
SIOCGIWRANGE: WE(compiled)=20 WE(source)=18 enc_capa=0xf
  capabilities: key_mgmt 0xf enc 0xf
WEXT: Operstate: linkmode=1, operstate=5
Own MAC address: 00:18:4d:cf:37:3b
Driver does not support WPA.
wpa_driver_wext_set_key: alg=0 key_idx=0 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=1 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=2 set_tx=0 seq_len=0 key_len=0
wpa_driver_wext_set_key: alg=0 key_idx=3 set_tx=0 seq_len=0 key_len=0
Setting scan request: 0 sec 100000 usec
ctrl_interface_group=100 (from group name 'users')
Added interface wlan1
RTM_NEWLINK: operstate=0 ifi_flags=0x1002 ()
Wireless event: cmd=0x8b06 len=8
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan1' added
RTM_NEWLINK: operstate=0 ifi_flags=0x1003 ([UP])
RTM_NEWLINK, IFLA_IFNAME: Interface 'wlan1' added
State: DISCONNECTED -> SCANNING
Starting AP scan (specific SSID)
Scan SSID - hexdump_ascii(len=8):
     43 61 73 61 4e 6f 76 61                           CasaNova
Trying to get current scan results first without requesting a new scan to speed up initial association
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 0 sec 0 usec
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (specific SSID)
Scan SSID - hexdump_ascii(len=8):
     43 61 73 61 4e 6f 76 61                           CasaNova
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (specific SSID)
Scan SSID - hexdump_ascii(len=8):
     43 61 73 61 4e 6f 76 61                           CasaNova
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (specific SSID)
Scan SSID - hexdump_ascii(len=8):
     43 61 73 61 4e 6f 76 61                           CasaNova
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (broadcast SSID)
Scan timeout - try to get results
Received 0 bytes of scan results (0 BSSes)
Scan results: 0
Selecting BSS from priority group 0
No suitable AP found.
Setting scan request: 5 sec 0 usec
Starting AP scan (specific SSID)
Scan SSID - hexdump_ascii(len=8):
     43 61 73 61 4e 6f 76 61                           CasaNova
CTRL-EVENT-TERMINATING - signal 2 received
Removing interface wlan1
State: SCANNING -> DISCONNECTED
wpa_driver_wext_set_operstate: operstate 0->0 (DORMANT)
WEXT: Operstate: linkmode=-1, operstate=5
No keys have been configured - skip key clearing
EAPOL: External notification - portEnabled=0
EAPOL: External notification - portValid=0
Failed to disable WPA in the driver.
No keys have been configured - skip key clearing
WEXT: Operstate: linkmode=0, operstate=6
Cancelling scan request
schmauck:/home/daan# cat /etc/resolv.conf
search lan
nameserver 192.168.1.254
schmauck:/home/daan# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
schmauck:/home/daan# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.88.0     0.0.0.0         255.255.255.0   U     0      0        0 vmnet1
172.16.188.0    0.0.0.0         255.255.255.0   U     0      0        0 vmnet8
schmauck:/home/daan#
Daan is offline   Reply With Quote
Old 09-30-2007   #6 (permalink)
Linux User
 
Daan's Avatar
 
Join Date: Aug 2005
Location: The Netherlands
Posts: 291
Send a message via Skype™ to Daan
It works now

I have a connection now.

I followed these instructions for my specific Wireless adapter (NETGEAR WG111v2) with Ndiswrapper. They are for Ubuntu Feisty Fawn, but they work on my Debian Etch. It involved using the WIN98 drivers. Also my interfaces file now has a line "wpa-driver wext" in stead of "wpa-driver ndiswrapper". I also have my key now in hex and not ascii and there are some other changes.

[SOLVED] problem with NETGEAR WG111v2 - Ubuntu Forums

I have not yet rebooted, but the guy who wrote the instructions says he has to manually

Code:
/etc/init.d/networking restart
after each boot. Should be fixable, right?

Anyways, thanks for your help, Chris!
Daan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 11:10 AM.






© 2000 - 2009 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.3.0 RC2