Talk:WPA supplicant

From ArchWiki
Revision as of 05:06, 1 June 2014 by Kynikos (talk | contribs) (Revision as of 19:21, 13 May 2013 by Earnest removed essential information: re)
Jump to: navigation, search

Input from file

Can someone verify this? I don't use this kind of passphrase, but trying this with a random text file gave me an error:

Some unusually complex passphrases may require input from a file:
$ wpa_passphrase essid < passphrase.txt

Idomeneo1 (talk) 00:46, 1 March 2014 (UTC)

You can't use a random text file:
$ wpa_passphrase foo < UTF-8-demo.txt
# reading passphrase from stdin
Passphrase must be 8..63 characters
It works for any valid passphrase.
-- Lahwaacz (talk) 07:31, 1 March 2014 (UTC)
Closing, Lahwaacz gave an exhaustive answer. -- Kynikos (talk) 10:31, 19 May 2014 (UTC)

Revision as of 19:21, 13 May 2013 by Earnest removed essential information

The revision as of 19:21, 13 May 2013 by Earnest removed essential information especially the one about the wpa_supplicant.conf:

Without the lines in wpa_supplicant.conf:

ctrl_interface=DIR=/run/wpa_supplicant GROUP=wheel

before the network block I'll get an endless loop of

ath9k 0000:02:00.0 wlan0: disabling HT as WMM/QoS is not supported by the AP
ath9k 0000:02:00.0 wlan0: disabling VHT as WMM/QoS is not supported by the AP
wlan0: associate with XX:XX:XX:XX:XX:XX (try 1/3)
wlan0: RX AssocResp from XX:XX:XX:XX:XX:XX (capab=0x431 status=0 aid=3)
wlan0: associated
wlan0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (reason=3)

MAC replaced by XX:XX:XX:XX:XX:XX

which is not caused by the wlan's power management setting which is off.

Even if the wiki is not a beginners guide and you could also read wpa_supplicant.conf manpages the wiki article is not really helpful anymore.

Renegat (talk) 17:50, 21 March 2014 (UTC)

I agree. The information that the network blocks should be appended >> to wpa_supplicant.conf is too sublime now. You apparently have overwritten the default conf file ("fast_reauth=1" and "ap_scan=1" are defaults in it). No blame, it should be clearer again that the conf itself may stay. The ctrl interface is explained later in the wpa_cli section, unsure about that one right now.
--Indigo (talk) 00:29, 22 March 2014 (UTC)
The edit in question is [1], which has been superseded by several later restructurings. The "gutted" [sic] revision is [2]: is there anything that's worth restoring from there, also considering the existing upstream documentation, or can we close this discussion? -- Kynikos (talk) 10:43, 19 May 2014 (UTC)
Great work with the re-write of the interim version, but yes imo the OP is right. The version still misses out a few things the [3] revision had. It foregoes that wpa_supplicant.conf is the tools _configuration_ file for global options (see above for examples) _plus_ all the networks the user manages with wpa_supplicant and not merely an example and doc file. Maybe that would be something to edit into WPA_supplicant#Configuration, employing it instead of "example.conf" there. I don't have much time now. I would try to add it into that subsection when I do. Please leave this open so we can return to it. Thanks. --Indigo (talk) 05:38, 20 May 2014 (UTC)
The way I see it, /etc/wpa_supplicant/wpa_supplicant.conf is not a "default config" in the usual sense since it has multiple network blocks uncommented. In conjunction with the recently introduced dhcpcd hook, this may lead to some unintended behaviour, e.g. wpa_supplicant being started without user's intervention and not failing due to the network blocks uncommented in wpa_supplicant.conf. I think there are some threads in the forums that could be connected to this, but I'm not going to search for them at least until my exam period is over.
Now here is the thing: the config path is set in wpa_supplicant's PKGBUILD [4] to be /etc/wpa_supplicant/wpa_supplicant.conf, while the man page (is this an up-to-date version?) suggests that it should be in /usr/share/doc/wpa_supplicant/, which makes much more sense for the "example config for documentation purposes". Could this be a packaging bug? How do other distros handle this, and is the "default config" under /etc/ really necessary (considering The Arch Way#User-centric)?
-- Lahwaacz (talk) 12:36, 20 May 2014 (UTC)
@Indigo: Well I don't know if it's more conventional to use /etc/wpa_supplicant/wpa_supplicant.conf directly, but I wouldn't recommend doing it, right because even if theoretically working (but see Lahwaacz's comments), it's the best source of documentation for configuration, and I wouldn't edit it, maintaining instead a short and much clearer separate config file.
@Lahwaacz: Good catch, I would support installing the file to /usr/share/doc/wpa_supplicant/ like the man page says (yes, it's up to date). I see you've already mentioned that in FS#39527, maybe you want to post it to the arch-dev-public ML (I guess it's the correct one)?
-- Kynikos (talk) 02:31, 25 May 2014 (UTC)
Thanks for your points, all valid in my view too. But I am a bit stumped that you both don't address the specific issue the OP had above, which I pointed to in my first reply to Kynikos. I tried to do it now and merged it into WPA_supplicant#Advanced_usage in one edit: [5]
I think it is just a pragmatic way to include the wpa_supplicant.conf how it is packaged. Sure, someone wanting to setup a honeypot might decide SSID "home" and PSK "very secret passphrase" (one of the examples) is a good choice, but that's about the only adverse effect of using it I can think of (other than the default being extensively long - for a reason). Given the wide choice of 'free' networks we all use here and there anyway when roaming, it is a small one too. Further, the previous [sic] version we discuss here, described how to assemble a custom config just like Kynikos proposes (see "Complete example" at the end of: [6]).
edit: To explain my reasoning a little more: Keep in mind as well, that most the examples in the file are advanced ones requiring certificates to be installed in a place non-existant by default. Only the few first ones will work OOTB. debian indeed ships the file in /usr/share/doc/wpa_supplicant/examples/ (or similar) even compressed. I remember mild swearing, when I had to use find and tar just to look at it during an install ;)
Anyhow, please review, rollback, edit it or address points you disagree with from it. Thanks :)
--Indigo (talk) 08:23, 26 May 2014 (UTC)
Sorry for going too off-topic, just couldn't help it - seemed like the right moment to get some opinions from a specialist :P
Back on topic: I don't really understand how adding fast_reauth=1 (which I assume means enabling fast re-authentication) to the config could help to solve the problem (unless 1 is for disabling, which does not make sense). Yeah, I know, this contradicts the OP's experience, plus I have never had to use any of these options (could also be hardware/driver specific?), so I will leave the update to your discretion.
Edit: the off-topic thread shall continue here.
-- Lahwaacz (talk) 16:34, 27 May 2014 (UTC)
The option only applies for EAP methods, maybe that's why. The deauthentication "reason=3" does not make sense in combination with it to my understanding though. Anyhow, it did make sense to me to address the OP's issue in the rewrite, since it is concerned with the vanilla package's 'proposed default' config parameters. That's what I wanted to add, though we all know likely the talk next month will show fast_reauth=1 is FUD with driver xyz. Anyhow, thanks for letting me add an implicit warning too that there is no backup yet, if one messes the original (like me:). With that I'm fine to close this now (and promise to contemplate before sneaking more option clutter in) --Indigo (talk) 21:37, 27 May 2014 (UTC)
Slightly OT, but related: Is there a rule in this Wiki how to refence a man page? E.g. should it be written as "see WPA_supplicant.conf(5)" or "see man 5 WPA_supplicant.conf" or by an external link like "see WPA_supplicant.conf man page"?
--Frank (talk) 06:28, 26 May 2014 (UTC)
I'm not aware of a rule either. I would usually use WPA_supplicant.conf(5) or something like "see WPA_supplicant.conf(5) man page" from the examples you give. External links I tend to avoid, except in the "See also" sections or individual cases. Such special cases are all man pages related to basic networking connectivity (like this one) or installation in general, for the simple reason that users reading those for help frequently might not have Linux available. So the external links on this page are just right imho and their format shows a linux user it is a regular man page. Going further along that route, you could also argue that it may be reader-friendly to use external links at the beginning of an article (close to the install section), because readers might want to decide whether to install first (thereby won't have the man page already). But then again I'd argue Arch users don't need such hand holding in general, so that I personally find both (internal and external) are acceptable in other cases.
If you feel you require further clarification, you should open an item in Help_talk:Style.
Closing this one. (@Kynikos: Thanks for all the gist edit work, and the tidying up today!)
--Indigo (talk) 14:50, 31 May 2014 (UTC)
Sorry for not replying further to this discussion (both branches): I saw Indigo and Lahwaacz were handling it well by themselves, so I focused on the other discussions around, but I forgot Frank's post here; Indigo is right, we don't have a style rule for that, if you want to discuss one, Help_talk:Style is indeed the right place. -- Kynikos (talk) 05:06, 1 June 2014 (UTC)

Reverting to earlier, more lucid edit

There is too much on this page that is redundant or belongs on other sections of the wiki. I am proposing to replace the current version of the page with this gist saved two months ago that contains the essential information without all of the unecessary filler. If you have any comments, please provide them in the next seven days. jasonwryan (talk) 02:22, 12 May 2014 (UTC)

I don't like switching revisions for no factual reason, IMO the change should be gradual and based on proper arguments (stated in the edit summary or discussed here). For completeness, as stated in the above discussion, there may be more information lost in this edit.
To comment on the gist version, are there reasons to keep "Connecting with wpa_cli" before "Configuration" and "Maintaining a custom configuration" separate from "Configuration"? Using wpa_supplicant depends on the ctrl_interface in the config, so it makes sense to describe it after "Configuration" and just link back.
Also note that #Enabling with systemd section is deprecated, wpa_supplicant@.service now looks for /etc/wpa_supplicant/wpa_supplicant-interface.conf [7].
Finally, which parts had better be moved into other sections of the wiki? Generally I would like to keep the specific info here and just link to it from Wireless network configuration.
-- Lahwaacz (talk) 13:02, 16 May 2014 (UTC)
wpa_supplicant does not depend on ctrl_interface being set. It does not even depend on a configuration file to function. The point of that section is mostly pedagogy. The information about systemd is accurate and still relevant but it does lack information about the default configuration. Earnest (talk) 16:08, 16 May 2014 (UTC)
The ctrl_interface para Lahwaacz was referring to was the one dealing with wpa_cli. I'm +1 with him. The current TOC is a more regular wiki structure imo. The gist is a clear page, but it is geared towards end-user usability to make a connection (wpa_cli). Most users arriving here will look for other info than how to get wpa_cli running (most who do will have diverted to the other tool discussed in Wireless_network_configuration already) in my view. Nonetheless, if parts are more appropriately covered in another page, those could be marked first and moved then? (should be done def. before rolling it over) Maybe make a short list here what should be moved?
--Indigo (talk) 17:38, 16 May 2014 (UTC)
The wiki should not be a substitute for a manual or upstream documentation. Earnest (talk) 20:18, 16 May 2014 (UTC)
I've prepared a draft at User:Kynikos/WPA supplicant which is an attempt of a compromise merge.
The base structure is more similar to the gist, i.e. starting from particular scenarios to give an idea of the generic way to work with the various tools, however all the additional content of the current article is preserved, and the "Advanced usage" section is instead aimed to those seeking for the more theoretical approach, still avoiding to duplicate the content of the two "practical" sections ("Connecting with wpa_{cli,passphrase}"), and linking there where appropriate.
There's also a very short, yet IMO very useful, "Overview" section, that illustrates the general operating principles, thus preparing the user to better appreciate the similarities and the differences among the various scenarios.
With respect to the gist, the sections have been given more proper names (e.g. the "Configuration" section wasn't only about configuration, and it wasn't the only one dealing with configuration either), a lot of content has been de-duplicated, and all the example file names, variables etc. have been made consistent throughout the article.
The only doubt I still have is how to mention the dhcpcd hook for both the manual connection and the systemd method without duplicating too much info.
Coming to the main points of the previous posts:
  • I too would like to know which parts should be moved to other articles, as I can't see any ^^
  • I think keeping "Connecting with wpa_cli" before explaining the configuration in details is possible, since the pre-configuration needed by wpa_cli is really minimal and doesn't involve the networking part, and wpa_cli is a configuration tool itself, so theoretically one may safely ignore how to set a network block in order to use it successfully. Also connecting with wpa_passphrase doesn't require knowing how the config file works (no file needs to be created ad all).
-- Kynikos (talk) 10:06, 17 May 2014 (UTC)
Maybe the dhcpcd hook should be described in dhcpcd#Hooks? It is part of dhcpcd after all... -- Lahwaacz (talk) 13:46, 17 May 2014 (UTC)
Good idea, although we should link there from this article anyway. I think also Dhcpcd#dhcpcd.2C_systemd_.26_wpa_supplicant should be given more visibility (maybe directly linked from dhcpcd#Hooks). -- Kynikos (talk) 04:15, 18 May 2014 (UTC)
Thanks for going to the trouble to write the draft page. I am happy with that. jasonwryan (talk) 23:02, 18 May 2014 (UTC)
Great, I'll do the merge in a few hours, I don't think it's worth to delay this longer. -- Kynikos (talk) 03:09, 19 May 2014 (UTC)
I think it's all fixed now, I'm closing this discussion :) -- Kynikos (talk) 10:29, 19 May 2014 (UTC)