You are not logged in.

#1 2007-06-14 10:15:37

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Wireless Network with WPA-PSK Problems

Hey guys,

I'd greatly appreciate help with this, because at this rate it'll take me weeks to get wireless working.

I'm trying to get my USB wireless dongle (on a desktop PC) working with the wireless network in a house I just moved into. The wireless network name is 'SevenBelRoad', and uses WPA-PSK encryption. For the sake of privacy, I'll refer to the network password as 'MyPassword' from here onwards.

I've read around in the Arch wiki, and read through wireless help posts in the forums, and have got these file entries thus far:

/etc/rc.conf:

lo="lo 127.0.0.1"
eth0="dhcp"
eth1="dhcp" # This is my working, wired connection
eth2="dhcp" # This is my not-so-working, wireless connection
wlan_eth2="eth2 essid SevenBelRoad"
INTERFACES=(lo)
WLAN_INTERFACES=(eth2 essid SevenBelRoad)
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)
NET_PROFILES=(eth2)  # I tried 'menu' here, but despite having package 'dialog' installed, no menu appeared during boot-up. I start with runlevel 5, and use SLIM as my login manager

/etc/wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
eapol_version=1
ap_scan=1
fast_reauth=1

network={
    ssid="SevenBelRoad"
        psk=[omitted for privacy]   # I generated this using 'wpa_passphrase SevenBelRoad MyPassword'
        key_mgmt=WPA-PSK
        proto=WPA
}

/etc/network-profiles/eth2:

#(I don't really know what to put for some of the lines below, so I optimistically commented them out in the file; is there some way to auto-detect any of these settings that are necessary?)

DESCRIPTION="Wireless Profile"
INTERFACE=eth2
HOSTNAME=localhost
#DOMAINNAME=mydomainname
#IFOPTS="10.1.1.4 netmask 255.255.255.0 broadcast 10.1.1.255"
#GATEWAY=10.1.1.1
#DOMAIN=mydomainname
#DNS1=10.1.1.1
ESSID=SevenBelRoad
IWOPTS="mode managed essid $ESSID"
WIFI_INTERFACE=eth2
WIFI_WAIT=5
USEWPA="yes"
WPAOPTS="-D wext"

The network connection fails to start at boot-up; I get an error message along the lines of 'SET failed on eth2; operation not permitted'.

My wireless dongle is a Safecom one (doh...). The model is SWLU-5400. I get a warning (which I think I know how to resolve) when installing the windows drivers for it via ndiswrapper, but I would really like to know whether my settings in the above files are OK, so that any remaining problems I can pretty much guarantee are solely ndiswrapper-related.

Thanks a lot.

- Dave

Last edited by KomodoDave (2007-06-14 10:19:32)

Offline

#2 2007-06-14 11:05:28

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Wireless Network with WPA-PSK Problems

try using network profiles instead of that setup:

#
# Network Profile
#

DESCRIPTION="Default Network Profile"

# Network Settings
INTERFACE=eth2
IFOPTS="dhcp"

# Wireless Settings (optional)
ESSID=SevenBelRoad
USEWPA="yes"           # start wpa_supplicant with the profile
AUTOWPA="yes"          # automatically configure WPA
PASSKEY="<PASSKEY HERE>"             # wpa passkey/phrase. for use with AUTOWPA

Do 'netcfg profilename' where profilename is the filename in /etc/network-profiles to connect immediately.

If you want this to connect on boot, just add the profilename to the net profiles line in rc.conf.

The other stuff like the WLAN_INTERFACES and the eth2=dhcp lines in rc.conf isnt needed, the only configuration you need is what i have above.

After my exams, I'll complete the new network scripts, so we can transition to them over time. The new ones are much tidier, and far better documented already (see the git repo, docs/). These will replace the above wireless configuration methods we already have.

http://wiki.archlinux.org/index.php/Network_Scripts

James

Last edited by iphitus (2007-06-14 11:06:01)

Offline

#3 2007-06-14 11:52:15

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

iphitus wrote:

try using network profiles instead of that setup:
<snip>

Thanks a lot for telling me that, James smile

I followed your advice, and have restored the default /etc/wpa_supplicant.conf and /etc/conf.d/wireless scripts.

I've also removed all traces of eth2 from /etc/rc.conf, and my rc.conf now looks identical to how it did before attempting all this.

My wireless profile, in /etc/network-profiles/eth2, now looks like this:

DESCRIPTION="Wireless Profile"
INTERFACE=eth2
IFOPTS="dhcp"
ESSID=SevenBelRoad
USEWPA="yes"
AUTOWPA="yes"
PASSKEY="[64 character alphanumeric sequence, omitted for security]"

I tried 'netcfg eth2', and get this in response:

root@lair:conf.d # netcfg eth2
:: Starting network profile: eth2                                                                                                    [BUSY] ctrl_interface=/var/run/wpa_supplicant
Passphrase must be 8..63 characters
                                                                                                                                     [FAIL]

I generated my passphrase using 'wpa_passphrase SevenBelRoad [MyPassword]', as mentioned before. It appears to be 64 characters though, hence the informative error. Am I doing something incorrectly? Unsurprisingly, putting the literal password into the file works a-ok, but obviously I don't want to keep that in there...

Good luck with your exams mate.

- Dave

Last edited by KomodoDave (2007-06-14 15:28:23)

Offline

#4 2007-06-15 01:30:09

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Wireless Network with WPA-PSK Problems

Put the actual plain text passphrase into the config file, not the generated one. netcfg does the wpa_passphrase step internally.

James

Offline

#5 2007-06-15 05:58:08

brain0
Developer
From: Aachen - Germany
Registered: 2005-01-03
Posts: 1,382

Re: Wireless Network with WPA-PSK Problems

iphitus wrote:

Put the actual plain text passphrase into the config file, not the generated one. netcfg does the wpa_passphrase step internally.

Just a remark here: netcfg should also allow a 64 character hex passphrase. For my home network, I generated a 32 byte random passphrase which I then put into a config file. It is not based on any ascii prassphrase. All wireless clients and access points allow specifying it in that way.

Offline

#6 2007-06-15 08:21:25

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

Ok, thanks a lot both of you, I really appreciate your help smile

- Dave

Offline

#7 2007-06-15 17:15:39

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

Hey again guys,

Right, I've *almost* got it working, but not quite.

I found out I didn't actually need ndiswrapper, since my dongle (Safecom SWLU-5400) uses the ZD1211 Driver, a community-written version of which has been in the kernel since 2.6.18 (yay!).

I downloaded the firmware, put it in the right place (/lib/firmware/zd1211), and now 'netcfg eth2' works!

I installed wifi-radar, and can see the surrounding wireless networks. However, I get the following warnings/errors when I try to connect to a nearby unsecure connection that my housemate can get on fine with her laptop:

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

eth2      Interface doesn't support scanning : No such device

Error for wireless request "Set Nickname" (8B1C) :
    SET failed on device eth2 ; Operation not supported.
Error, eth2: timed out

I searched around the forums, and found this thread which seemed to provide a solution. I created the following udev rules file:

#/etc/udev/rules.d/netdevices.rules
KERNEL=="eth*", SYSFS{address}=="00:17:31:9c:57:b7", NAME="eth0"
KERNEL=="eth*", SYSFS{address}=="00:17:31:9c:50:1d", NAME="eth1"
KERNEL=="eth*", SYSFS{address}=="00:e0:98:bf:12:a1", NAME="eth2"
KERNEL=="eth*", SYSFS{address}=="00:11:d8:00:00:ab:2d:16", NAME="fw"

However, it doesn't seem to have resolved the problem.

Here's my ifconfig output:

eth1      Link encap:Ethernet  HWaddr 00:17:31:9C:50:1D  
          inet addr:192.168.0.2  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::217:31ff:fe9c:501d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1512 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1503 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1028275 (1004.1 Kb)  TX bytes:209580 (204.6 Kb)
          Interrupt:21 

eth2      Link encap:Ethernet  HWaddr 00:E0:98:BF:12:A1  
          inet6 addr: fe80::2e0:98ff:febf:12a1/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:8 dropped:6 overruns:0 frame:8
          TX packets:2011 errors:15 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:3489 (3.4 Kb)  TX bytes:95391 (93.1 Kb)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:37 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4036 (3.9 Kb)  TX bytes:4036 (3.9 Kb)

Oddly enough, 'iwlist [interface] scanning' seems to work fine...

root@lair:rules.d # iwlist eth2 scanning
eth2      Scan completed :
          Cell 01 - Address: 00:18:4D:0E:1F:00
                    ESSID:"SevenBelRoad"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:6
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=100/100  Signal level=100/100  
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (1) : TKIP
                        Authentication Suites (1) : PSK
                    Extra: Last beacon: 64ms ago
          Cell 02 - Address: 00:14:BF:3D:25:22
                    ESSID:"linksys"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:11
                    Encryption key:off
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=100/100  Signal level=17/100  
                    Extra: Last beacon: 580ms ago
          Cell 03 - Address: 00:14:7F:B8:D2:B0
                    ESSID:"BTHomeHub-DFF2"
                    Protocol:IEEE 802.11bg
                    Mode:Master
                    Channel:1
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                              11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Quality=100/100  Signal level=11/100  
                    Extra: Last beacon: 440ms ago

Any advice or suggestions? I'm so close! *cries*

- Dave

Last edited by KomodoDave (2007-06-15 18:05:37)

Offline

#8 2007-06-15 22:07:34

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

Right, I *finally* have it working, thank Christ. I'm not joking, this was the most arduous linux experience I've ever had; it's taken about 10 hours to get it working.

Here are the steps, for others with a ZD1211 firmware dongle/card :

(1) Create a /etc/network-profiles/interface_name

I have:

DESCRIPTION="Wireless Profile"
INTERFACE=eth2 # Interface name
IFOPTS="dhcp"
ESSID=SevenBelRoad # Network name, without quotes
USEWPA="yes"
AUTOWPA="yes"
PASSKEY="MyPassword" # Password, in double quotes

(2) If you have firewire, make sure it doesn't get interpreted as an ethX interface - to do this, create some custom udev rules:

#/etc/udev/rules.d/netdevices.rules
KERNEL=="eth*", SYSFS{address}=="00:17:31:9c:57:b7", NAME="eth0"
KERNEL=="eth*", SYSFS{address}=="00:17:31:9c:50:1d", NAME="eth1"
KERNEL=="eth*", SYSFS{address}=="00:e0:98:bf:12:a1", NAME="eth2"
KERNEL=="eth*", SYSFS{address}=="00:11:d8:00:00:ab:2d:16", NAME="fw"

You can set the NAME to be whatever you want; the actual identifier is the ?bus? address you put in - to obtain these one-by-one, do:

udevinfo -a -p /sys/class/net/interface_name

An easy way of doing this is creating the udev rules file, then doing 'udevinfo -a -p /sys/class/net/eth0 | grep address >> /etc/udev/rules.d/netdevices.rules' for each network interface (tab complete the /sys/.../ bit to test which ones exist, if you're not sure).

(3) Build this PKBUILD in /var/abs/local/directory_you_make (thanks to pjmattal, J_Zar)

pkgname=zd1211-firmware
pkgver=1.3
pkgrel=1
pkgdesc="Firmware for use with the in-kernel26 zd1211rw wireless driver"
arch=('i686')
url=""
license=('GPL')
depends=()
makedepends=()
provides=()
conflicts=()
replaces=()
backup=()
install=
source=(http://heanet.dl.sourceforge.net/sourceforge/zd1211/zd1211-firmware$pkgver.tar.bz2)

build() {
  mkdir -p $startdir/pkg/lib/firmware || return 1
  cp -a $startdir/src/$pkgname $startdir/pkg/lib/firmware/zd1211 || return 1
}
md5sums=('cfff76ea35f4f93c37f6c99aa2058140')

(For newbies: you need to cd to the directory, paste that text into a file called PKGBUILD, run 'makepkg' as root from that dir, then 'pacman -A _____.pkg.tar.gz')

(4) Edit /etc/rc.conf, put 'zd1211rw' in the MODULES array. Also, remove unwanted interfaces from the INTERFACES array (or just shriek (!) them out, eg !eth0 ), and finally uncomment the NET_PROFILES line and insert the profile you made earlier, eg 'NET_PROFILES=(eth2)'

(5) Either reboot, or:

$ ifconfig interface_i_don't_want down  # eg. ifconfig eth0 down
$ modprobe zd1211rw
$ ifconfig my_wireless_interface up # eg. ifconfig eth2 up
$ netcfg my_wireless interface # this loads the profile you made, eg. netcfg eth2

(6) Job's a good 'un!

- Dave

Offline

#9 2007-06-16 08:47:37

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Wireless Network with WPA-PSK Problems

In the future, this setup ought to be a lot easier:

I added zd1211-firmware to [extra] two days ago :)

to deal with the firewire, you can blacklist eth1394. in the new netscripts, there's also  facilities for you to be able to choose a name for your wireless/network cards, without resorting to udev, based on mac address, module and other options.

for the profile in /etc/network-profiles/profilename, the profilename doesnt have to be the interface, it can be anything. For example, you could have network-profiles/work and network-profiles/home. Put em both in the array in rc.conf, and it'll connect to the correct one on boot. Currently it's a bit slow, and literally trial and error, but there's detection support in the new scripts.

James

Last edited by iphitus (2007-06-16 08:49:44)

Offline

#10 2007-06-16 11:28:22

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

iphitus wrote:

In the future, this setup ought to be a lot easier:

I added zd1211-firmware to [extra] two days ago smile

Sweet, cheers James.

to deal with the firewire, you can blacklist eth1394.

...but surely this disables firewire, and so is a worse solution than custom udev rules?

in the new netscripts, there's also  facilities for you to be able to choose a name for your wireless/network cards, without resorting to udev, based on mac address, module and other options.

Awesome man! That sounds great. by 'new' do you mean they're in Duke right now? I don't like being bleeding edge, so wouldn't have those already...

for the profile in /etc/network-profiles/profilename, the profilename doesnt have to be the interface, it can be anything. For example, you could have network-profiles/work and network-profiles/home. Put em both in the array in rc.conf, and it'll connect to the correct one on boot. Currently it's a bit slow, and literally trial and error, but there's detection support in the new scripts.

Okey-doke, thanks for the heads-up mate.

- Dave

Offline

#11 2007-06-16 13:31:17

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: Wireless Network with WPA-PSK Problems

KomodoDave wrote:

to deal with the firewire, you can blacklist eth1394.

...but surely this disables firewire, and so is a worse solution than custom udev rules?

this only disables ethernet-over-firewire which is what is creating the interface. Firewire itself is provided by a range of other modules.

in the new netscripts, there's also  facilities for you to be able to choose a name for your wireless/network cards, without resorting to udev, based on mac address, module and other options.

Awesome man! That sounds great. by 'new' do you mean they're in Duke right now? I don't like being bleeding edge, so wouldn't have those already...

they're in a git repository, and i've got a custom repo for them. details are on the link above. After my exams, i'll stabilise them and get them into [testing], following a similar merge path to pacman3.

James

Offline

#12 2007-06-16 18:41:18

KomodoDave
Member
From: Oxford, UK
Registered: 2007-04-22
Posts: 162
Website

Re: Wireless Network with WPA-PSK Problems

OK, great stuff James.

- Dave

Offline

Board footer

Powered by FluxBB