Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
i have been away for a decade, what is wpa_supplicant?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Sat Feb 20, 2016 11:24 pm    Post subject: i have been away for a decade, what is wpa_supplicant? Reply with quote

hi guys...

i'm getting my old laptop getto-ified, and in the time i've been away from the glory that is gentoo, wifi has become ubiquitous and for whatever ungodly reason it seems that the gentoo community is using some thing called wpa_supplicant to set up the wireless.

i have seen a million different mentions of wpa_supplicant (that's a hideous thing to call it, btw) but i have not found a simple primer for idiots like me. i'm coming at this without even having my hardware setup yet.

i've got a broadcom DW1501 wireless half-mini in a dell e6410. when i finally get the kernel to see it, and get it to start on bootup, i'm going to want to get an ip address via dhcp from my home router using a simple passphrase.

is there a walkthrough for a guy like me?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sat Feb 20, 2016 11:27 pm    Post subject: Reply with quote

pwhitt,

Its in the wireless section of the Gentoo Handbook.
First, you need the kernel driver for your DW1501.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Sat Feb 20, 2016 11:35 pm    Post subject: Reply with quote

neddyseagoon! i recognize your login from so many past posts that helped me out. wow! thanks for sticking with it :)

i thought i'd throw this question out too even without the driver. i'm really looking for more of a "what is wpa_supplicant?" and an explanation of what it all does now.

i walked through that doc while running the latest minimal install image booted from USB. it didn't quite work for me, but let's get to that when i'm ready. hopefully in the near future i'll be posting these questions from linux, not having to boot back to windows, use my phone, or tablet.

you have no idea what a welcome sight your username is!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sun Feb 21, 2016 12:33 am    Post subject: Reply with quote

pwhitt,

wpa_supplicant deals with finding a suitable wireless access point, associating and authenticating with it.
It does all the extra things that wifi needs over wired ethernet, so the standard wired tools just work.

wpa_supplicant supports lots of different crypto and authentication schemes. Its predecessor, wireless-tools will only support WEP encryption.
WEP is as bad an no encryption.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Mon Feb 22, 2016 12:07 am    Post subject: Reply with quote

hello neddy!

i'm actually posting this from within links, and with no cable dangling from the back of my machine. so i did something right - thanks for help getting this far!

now, help me understand this - i have followed the linked guide above, several times... but i have to do something stupid to get online via wireless. what's that, you wonder?

i run wpa_supplicant, and it barfs into my terminal, then just sits there. it seemd like it was waiting for something - i don't know what. i called wpa_supplicant with the arguments pointing to the conf file i made per the guide... which calls for dhcp on my wan, so all should be OK... right?

if i suspend wpa_supplicant, then bg it, then run dhcpcd wlp3s0b1 (or whatever my card is) guess what?

i get an address and everything is great.

so - what part of the guide am i not seeing? i swear i've gone through this a few times, i'm obviously missing something.

on a previous install, i went through some network setup that was supposed to start my wireless on bootup, but that didn't work either... i know i still need to add networking to my default runlevel, but what do i need to do so that when wpa_supplicant starts, it runs dhcpcd on my interface?

i've checked the conf file - it's spelled out, dhcp, and i'm using the name from ifconfig -a, not wlan0 - and afterall, wpa_supplicant is able to connect when i start dhcp.

anyway - thanks for the help - this is great!

now i just need to get gpm working - or better yet, xorg and fluxbox... all in time.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Mon Feb 22, 2016 6:43 am    Post subject: Reply with quote

pwhitt wrote:
so - what part of the guide am i not seeing? i swear i've gone through this a few times, i'm obviously missing something.

See https://wiki.gentoo.org/wiki/Wpa_supplicant and https://wiki.archlinux.org/index.php/WPA_supplicant#Connecting_with_wpa_cli
Back to top
View user's profile Send private message
toralf
Developer
Developer


Joined: 01 Feb 2004
Posts: 3919
Location: Hamburg

PostPosted: Mon Feb 22, 2016 8:49 am    Post subject: Reply with quote

Quote:
i have been away for a decade, what is wpa_supplicant?
What let me wonder since when we do have WLAN :-D
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Mon Feb 22, 2016 6:39 pm    Post subject: Reply with quote

pwhitt,

You don't need to run wpa_supplicant yourself. The startup scripts will do that for you.

The order of events for WiFi is wpa_supplicant is called by the startup script, because you have net.<WiFi> in the default runlevel.
This deals with association and authentication. The normal wired routines take over and set up the IP address, routing table, namserver and so on.

From my netbook.

/etc/conf.d/net:
modules="wpa_supplicant iproute2"
wpa_supplicant_wlan0="-Dnl80211"


No interfaces are named as I get dhcpcd for free, whenever an unnamed interface is brought up.
/etc/wpa_supplicant/wpa_supplicant.conf:
ctrl_interface_group=0
ctrl_interface=/var/run/wpa_supplicant
ap_scan=1
# 2.4GHz band
network={
        priority=50
        key_mgmt=WPA-PSK
        mode=0
        psk="Very_Sekrit_Pass_Phrase24 "
        ssid="RadioNet24"
}
# 5.0 GHz band
network={
        priority=50
        key_mgmt=WPA-PSK
        mode=0
        psk="Very_Sekrit_Pass_Phrase5"
        ssid="RadioNet5"
}


/etc/init.d:
...
lrwxrwxrwx 1 root root     6 Jan  3 11:53 net.eth0 -> net.lo
-rwxr-xr-x 1 root root 17824 Oct 25 18:51 net.lo
lrwxrwxrwx 1 root root     6 Jan  3 11:54 net.usb0 -> net.lo
lrwxrwxrwx 1 root root     6 Jul  4  2015 net.wlan0 -> net.lo
...


When I do
Code:
/etc/init.d/net.wlan0 start
the system runs wpa_supplicant, then dhcpcd and gets me a wireless link.
Neither dhcpcd, nor wpa_supplicant are in any runlevel.

Code:
$ ls -R /etc/runlevels/
/etc/runlevels/:
battery  boot  default  nonetwork  shutdown  single  sysinit

/etc/runlevels/battery:
acpid  alsasound  dbus  gpm  local  metalog  ntp-client  ntpd  sshd  udev-postmount  xdm

/etc/runlevels/boot:
binfmt       fsck               hwclock     loopback  net.lo  swap       termencoding    urandom
bootmisc     hibernate-cleanup  keymaps     modules   procfs  swapfiles  tmpfiles.setup
consolefont  hostname           localmount  mtab      root    sysctl     tmpfilesd.boot

/etc/runlevels/default:
acpid  alsasound  dbus  gpm  local  metalog  ntp-client  ntpd  sshd

/etc/runlevels/nonetwork:
local

/etc/runlevels/shutdown:
killprocs  mount-ro  savecache

/etc/runlevels/single:

/etc/runlevels/sysinit:
devfs  dmesg  sysfs  tmpfiles.dev  tmpfilesd.sysinit  udev  udev-mount  udev-trigger

_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6835
Location: Blighty

PostPosted: Tue Feb 23, 2016 9:17 am    Post subject: Reply with quote

NeddySeagoon wrote:
/etc/conf.d/net:
modules="wpa_supplicant iproute2"
wpa_supplicant_wlan0="-Dnl80211"



Do you even need that?
I'm pretty sure I made wpa_supplicant a default module for wireless interfaces and iproute2 the default on Linux (but this may I have changed as I've not used netifrc for a really long time ...)

For sure you don't need to tell wpa_supplicant which driver to use as it's defaulted to nl80211 on Linux for years now ....

BTW, work is in progress to get wpa_supplicant to auto start as well (by itself now that the dhcpcd hook is gone)
Here is the patch I submitted upstream a while ago:
http://lists.infradead.org/pipermail/hostap/2016-February/034923.html
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Tue Feb 23, 2016 5:38 pm    Post subject: Reply with quote

UberLord,

That's been there a long time now. Since early 2009 at least.
I may have tweaked the -D entry more recently though.

I think you are right about iproute2 being the default but over the years I've learned that defaults get changed and I don't always notice until its too late.
Then something breaks.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Tue Feb 23, 2016 11:32 pm    Post subject: Reply with quote

so for the record, i'm getting on my network on boot now, but not in a manner that compares nicely with anything i've seen here.

i actually had to comment out every line in my /etc/conf.d/net. if i did not, i got a message about Dn180211 being an unknown driver. odd, considering that the commandline that worked for me included the -Dn180211 argument.

in either case, i'm happily online w/ my laptop, but am not certain how. i'd like to add that following the many guides google led me to did not solve my problem, i just happened to luck into some set of configs and happenstance that did... i'd still love to see a comprehensive set of documentation that explains how a novice would deal with this. all things considered, i am certainly not a novice, and i found nothing that led me through the steps to get me wirelessly online - it was luck.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 3664

PostPosted: Wed Feb 24, 2016 8:02 am    Post subject: Reply with quote

pwhitt wrote:
so for the record, i'm getting on my network on boot now, but not in a manner that compares nicely with anything i've seen here.

i actually had to comment out every line in my /etc/conf.d/net. if i did not, i got a message about Dn180211 being an unknown driver. odd, considering that the commandline that worked for me included the -Dn180211 argument.
-Dnl80211 (lower case L)
Back to top
View user's profile Send private message
pwhitt
Tux's lil' helper
Tux's lil' helper


Joined: 25 Nov 2003
Posts: 85

PostPosted: Wed Feb 24, 2016 12:58 pm    Post subject: Reply with quote

i can't believe i did that...

i know no one will believe it, but it's an L in my configs. i was jumping through hoops trying to transcribe things to and from my tablet - which is bad enough because it autocorrects everything. so screwing it up in this post isn't surprising.

anyway - on my laptop i actually copied the driver argument from some help text or a man page - can't remember what, but it looked ambiguous enough that even changed it back and forth to see.

in the end, my conf.d/net file is literally, completely commented out. it may as well be blank.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum