SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2011-12-14 17:13:52

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

HowTo: Connect and roam wifi networks with wpasupplicant

sudo service network-manager stop
sudo service wicd stop
pkill nm-applet

Last edited by el_koraco (2012-10-24 23:42:29)

Offline

Help fund CrunchBang, donate to the project!

#2 2011-12-14 17:17:32

dubois
The Old Codger
From: Missoula, Montana
Registered: 2010-09-03
Posts: 2,238

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Nice HOW TO.  Gives us all another option.  Many thanks.

Offline

#3 2011-12-14 17:19:25

xaos52
The Good Doctor
From: Planet of the @s
Registered: 2011-06-24
Posts: 4,602

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Great howto, el_koraco.
Bookmarked, and I think I will be referencing this a lot.
Thanks.

Offline

#4 2011-12-14 17:24:16

rhowaldt
#!*$%:)
Registered: 2011-03-09
Posts: 4,396

Re: HowTo: Connect and roam wifi networks with wpasupplicant

great how-to el_koraco. i already have this set up through ceni (as i think you know because you helped me with it), but this is a very nice and detailed look at how all of this works.

noticed 1 noob-unfriendly line:

gksudo geany/gedit/leafpad /etc/network/interfaces

hoping people will read past post 1 if they don't get this: it means you should choose geany, gedit or leafpad, not type that command like that.

Offline

#5 2011-12-14 18:10:54

VastOne
#! Ranger
From: V-Ger
Registered: 2011-04-26
Posts: 10,165
Website

Re: HowTo: Connect and roam wifi networks with wpasupplicant

A well done How To el_koraco, clear and concise ... good job

Offline

#6 2011-12-14 19:36:47

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

gksudo geany/gedit/leafpad /etc/network/interfaces

Last edited by el_koraco (2011-12-14 19:37:02)

Offline

#7 2011-12-15 04:33:15

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 4,148
Website

Re: HowTo: Connect and roam wifi networks with wpasupplicant

sudo update-rc.d network-manager remove
sudo update-rc.d wicd remove

Offline

#8 2011-12-15 08:52:57

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

iface eth0 inet dhcp

Offline

#9 2011-12-16 04:54:59

BoredOOMM
#! Junkie
From: 36.0718,-119.03519
Registered: 2011-06-19
Posts: 353

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Excellent resource and I am tackling NM on the laptop net. This will be a great guide.

I suggest good enough for inclusion in the Wiki smile


Congratulations, you've figured out the sound of one hand clapping...

Offline

#10 2012-01-04 22:02:34

sigma
Member
Registered: 2011-12-25
Posts: 16

Re: HowTo: Connect and roam wifi networks with wpasupplicant

OK, I've tried this a few different ways. I've alternatively set my router to use both WEP and WPA and tried to connect using the STATIC config shown for e/n/i above. I can't seem to obtain a DHCP lease though my machine does find the network. But this is really a moot point as I will definitely need a ROAMING setup for my purposes.

Here's what I've done so far:

(1) Updated home router security to WPA2 Personal
    SSID = 2WIRE999
    PWD = 9979990099

(2) Network Manager stopped and applet killed

(3) Updated /etc/network/interfaces (going roaming route)

# The loopback network interface
auto lo
iface lo inet loopback

# ROAMING
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa-roam.conf

(4) Updated /etc/wpa_supplicant/wpa-roam.conf

update_config=1
ctrl_interface=DIR=/var/run/wpa_supplicant
GROUP=netdev

network={
    ssid=”2WIRE999“
    psk=”9979990099“
    id_str=”home”
    }

network=
    {
    key_mgmt=NONE
    }

(5) permissions for e/n/i and e/w/w.conf are 644

(6) run

 sudo ifdown wlan0 && sudo ifup wlan0 

I then get this ERROR:

 stephen@Isis:~$ sudo ifdown wlan0 && sudo ifup wlan0
wpa_supplicant: /sbin/wpa_supplicant daemon failed to start
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to connect to wpa_supplicant - wpa_ctrl_open: No such file or directory
wpa_supplicant: /sbin/wpa_cli daemon failed to start

Both wpa_cli and wpa_supplicant show up in /sbin, and permissions are 755 for each.


================

I'm sure I'll have a few more questions once I get this working (related to eth0 and WEP connections).

thanks in advance.

Last edited by sigma (2012-01-04 22:04:09)

Offline

#11 2012-01-04 23:13:37

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Ok, let us first see if you can connect to WPA without roaming. Run ifdown wlan0, edit e/n/i to

allow-hotplug wlan0
iface wlan0 inet dhcp
        wpa-ssid xxx
        wpa-key xxx

and bring up the interface (ifup wlan0). Post output.

Offline

#12 2012-01-04 23:32:55

sigma
Member
Registered: 2011-12-25
Posts: 16

Re: HowTo: Connect and roam wifi networks with wpasupplicant

OK, here's the output:

Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlan0/60:d8:19:c3:b0:77
Sending on   LPF/wlan0/60:d8:19:c3:b0:77
Sending on   Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 21
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
No DHCPOFFERS received.
No working leases in persistent database - sleeping.

I'm assuming the SSID and password can simply be entered 'as-is' (in other words, they do not need to be encapsulated in quotations or prepended with s:, right?)

Last edited by sigma (2012-01-04 23:33:55)

Offline

#13 2012-01-05 01:56:45

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

They don't if it's WPA. If it's WEP, it sometimes works better with the hex value. Which is it? Also, would you mind disabling network manager as stated above, then rebooting and trying again? Put

iface eth0 inet dhcp

in eni, and bring your ehternet up with

sudo ifup eth0

if you need to get online.

Offline

#14 2012-01-05 02:31:33

sigma
Member
Registered: 2011-12-25
Posts: 16

Re: HowTo: Connect and roam wifi networks with wpasupplicant

NetworkManager is configured to start on boot, but I stopped it, rebooted it, stopped it once more... It didin't find a network as I added the line to e/n/i for eth0. I connected per your instructions and received the following:

stephen@Isis:~$ sudo ifup eth0
Internet Systems Consortium DHCP Client 4.1.1-P1
Copyright 2004-2010 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/eth0/f0:de:f1:a9:b0:83
Sending on   LPF/eth0/f0:de:f1:a9:b0:83
Sending on   Socket/fallback
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.254
bound to 192.168.1.77 -- renewal in 43027 seconds.

So that clearly worked.


I'm currently using WPA2-Personal for router security.

Offline

#15 2012-01-05 09:17:24

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Try to disable network manager from starting up:

sudo update-rc.d network-manager disable

and then do the stuff in post 11.

Offline

#16 2012-01-05 21:02:31

sigma
Member
Registered: 2011-12-25
Posts: 16

Re: HowTo: Connect and roam wifi networks with wpasupplicant

I ended up removing network manager completely (as it was the obvious cause of the computer crashes), and I gave the above method a shot once more without luck - both via manually editing the config files and using Ceni to do it for me. I just couldn't get a DHCP lease.I suspect that password recognition may have been part of the problem. In the end I installed Wicd, and now everything is working perfectly. But if for some reason that breaks, I'll be back here again. Thanks el_koraco (!) for your help and patience.

Offline

#17 2012-01-06 03:24:56

capncrunch#bang!
#! Member
Registered: 2011-11-20
Posts: 54

Re: HowTo: Connect and roam wifi networks with wpasupplicant

This is relevant to my interests...
I've had system freezes with changing from one AP to another. I have two APs I use, one for streaming/gaming and another for data transfer. I thought it was transmission, but qbittorrent made no difference. I kept getting a "stalled" status on my downloads, too. Wicd has seemed to resolved the issue.

Offline

#18 2012-01-08 15:48:25

El_Belgicano
#! CrunchBanger
Registered: 2011-05-23
Posts: 147

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Hi, i tried yout howto, first the roaming method as it is what i'm looking to achieve but it didn't work so i tried just the static to check the basics:
the result is i can connect to the network, but i always get a "no dhcpoffers received"
It has worked before, and it is wpa encrypted.

Thanks for your help...

Offline

#19 2012-01-08 17:13:48

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Try to disable network manager first, reboot and then make the connection. You can reenable it with

sudo update-rc.d network-manager defaults

Last edited by el_koraco (2012-01-08 17:14:21)

Offline

#20 2012-01-08 18:47:10

El_Belgicano
#! CrunchBanger
Registered: 2011-05-23
Posts: 147

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Small update on this: I have the network back up...
The trick is: don't ask me how i managed, i tried lots of different configurations in /etc/network/interfaces and basically, i'm back where i was before trying the howto: able to connect, able to get an ip, with the problem that after a while although i'm still connected to the wpa-network, i'm not able to reach the internet anymore... If i was to have a guess: my ip needs to be refreshed but i'm nowhere near sure about this...

No NM/Wicd for a long time already, i was connecting with a script with multiple blocks like this one:

    sudo ifconfig wlan0 down
    sudo dhclient -rq wlan0
    sudo ifconfig wlan0 up
    sudo iwconfig wlan0 mode Managed essid "Network"
    sudo dhclient -q wlan0

Then i saw this howto and i thought it would be a "cleaner" (not to mention probably safer) way of doing things.
So i went on and tried... And now i have the static method working, with the glitch you know.

PS: i had the shortages before too...
PS2: it's the only WPA network i use (others being: unsecured of WEP)

Offline

#21 2012-01-08 19:07:05

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

can I see your /e/n/i?

Offline

#22 2012-01-08 19:12:49

El_Belgicano
#! CrunchBanger
Registered: 2011-05-23
Posts: 147

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Sure:

auto lo wlan0
iface lo inet loopback

iface wlan0 inet dhcp
    wpa-ssid XXXXXX
    wpa-psk YYYYYY

iface default inet dhcp

Last edited by El_Belgicano (2012-01-08 19:13:17)

Offline

#23 2012-01-08 19:18:39

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

I see. Everything seems OK. So you only have problems with WPA encryption?
a) try to remove wlan0 from the line auto lo wlan0
b) let's see your

apt-cache policy wpasupplicant

Offline

#24 2012-01-08 20:04:31

El_Belgicano
#! CrunchBanger
Registered: 2011-05-23
Posts: 147

Re: HowTo: Connect and roam wifi networks with wpasupplicant

a) done
b) there you go:

wpasupplicant:
  Installed: 0.6.9-3ubuntu3
  Candidate: 0.6.9-3ubuntu3
  Version table:
 *** 0.6.9-3ubuntu3 0
        500 http://ftp.belnet.be/mirror/ubuntu.com/ubuntu/ lucid/main Packages
        100 /var/lib/dpkg/status

EDIT: just noticed: it does not disconnect me in the middle of something, when the time between two requests gets too long then it disconnects...

Last edited by El_Belgicano (2012-01-08 20:52:38)

Offline

Be excellent to each other!

#25 2012-01-08 21:34:06

el_koraco
#!/loony/bun
From: inside Ed
Registered: 2011-07-25
Posts: 4,749

Re: HowTo: Connect and roam wifi networks with wpasupplicant

Ah, our old friend Ubuntu. I haven't had the best time configuring my network manually there, I don't think it has all the scripts Debian does. Dunno if I can be of help really, since I have no idea what the differences are. Can I see the output of sudo ifup wlan0?

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.
Server: bleh

Debian Logo