User Tools

Site Tools


doc:howto:wireless.utilities

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
doc:howto:wireless.utilities [2013/05/06 13:33]
robthebrew
doc:howto:wireless.utilities [2014/07/07 21:31] (current)
valentt
Line 1: Line 1:
 +====== Wireless Utilities ======
 +As already explained at [[wireless.overview]] the Linux IEEE 802.11 subsystem is fragmented. The available tools depend entirely on your [[http://​linuxwireless.org/​en/​users/​Drivers|driver]]. Wireless devices have an API different from that of Ethernet devices because the specifications of IEEE 802.11 regulate quite precisely the whole communications process, so it makes sense to NOT implement this requirements in each driver but only once for all drivers and also because there is the problem of the diverging frequency regulations world wide.
 +
 +===== mac80211-based drivers (ath9k, b43, brcmfmac, etc.) =====
 +
 +==== iwconfig ====
 +''​[[man>​iwconfig]]''​ (and ''/​proc/​net/​wireless''​) is the configuration utility for the now <color red>​obsolete</​color>​ [[http://​linuxwireless.org/​en/​developers/​Documentation/​Wireless-Extensions|WEXT]] API, which is scheduled for removal. Use ''​iw''​ or ''​iwinfo''​.
 +
 +
 +==== iwinfo ====
 +''​iwinfo''​ is a CLI frontend to the custom library, which assembles information from various places. It is also used by [[doc:​howto:​LuCI]]
 +  * When in AP-mode, obtain a list of connected clients in STA-mode:<​code bash>
 +iwinfo wlan0/​wl0/​ath0 assoclist</​code>​
 +
 +==== iw ====
 +''​[[man>​iw]]''​ is the configuration utility for the [[http://​linuxwireless.org/​en/​developers/​Documentation/​nl80211/​|nl80211]] API.
 +  * Add a new virtual interface with the given configuration:<​code>​
 +iw dev <​devname>​ interface add <​name>​ type <​type>​ [mesh_id <​meshid>​] [4addr on|off] [flags <​flag>​*]</​code>​ Valid interface types are: managed, ibss, monitor, mesh, wds. See ->​[[http://​www.linuxwireless.org/​en/​users/​Documentation/​modes|wireless modes]]\\ The flags are only used for monitor interfaces, valid flags are: none, fcsfail, control, otherbss, cook
 +  * Add a new virtual interface with the given configuration:<​code>​
 +iw phy <​phyname>​ interface add <​name>​ type <​type>​ [flags <​flag>​*]</​code>​
 +  * Getting the currently set regulatory domain:<​code>​
 +iw reg get
 +</​code>​
 +  * When in AP-mode, obtain a list of connected clients in STA-mode:<​code>​
 +iw dev wlan0 station dump
 +</​code>​
 +  * Setting regulatory domain. Set your country [[wp>ISO 3166-1 alpha-2]] in capital letters:<​code>​
 +iw reg set XX
 +</​code>​
 +**''​Note:''​** The ''​ath9k''​ driver (and all other softmac drivers?) sets its own regulatory restrictions based on its EEPROM, i.e. the [[doc:​techref:​flash.layout|ART (Atheros Radio Test) partition]] on flash. Setting the domain from userland can only further restrict the regulatory settings. So if EEPROM says Japan, you can use all 14 channels, if you then set it to US, you can use merely the 12. It does not work the other way around, i.e. if EEPROM says US, you only can use the allowed 12 channels, no matter what you set in userspace! The value ''​98''​ represents a synthesized regulatory domain, based on the intersection of the available source of regulatory information (which can include the EEPROM, the userland setting, and a country IE from your AP).
 +  * Question: Is there any way to get/set these raw settings (like, whatever it has in EEPROM)?
 +  * Answer: Your "​expectation"​ of having the freedom to modify the EEPROM is valid as I agree with it too but current (US) legislation does not allow for it. So to support upstream drivers we just cannot allow for those type of changes. You won't get any support if you try to mess with that stuff unless we get a change in legislation that says otherwise. Please refer to:
 +    * http://​wireless.kernel.org/​en/​vendors/​VendorSupport
 +    * http://​wireless.kernel.org/​en/​developers/​Regulatory/​statement
 +    * http://​wireless.kernel.org/​en/​developers/​Regulatory
 +    * [[https://​git.kernel.org/​cgit/​linux/​kernel/​git/​linville/​wireless-regdb.git/​tree/​db.txt|Regulations per country]]
 +
 +==== Hostapd ====
 +The mac80211 subsystem moves all aspects of //master mode// (a.k.a. AP mode) into user space, thus it depends on ''​[[man>​hostapd]]''​ (also read [[http://​www.linuxwireless.org/​en/​users/​Documentation/​hostapd|Hostapd]]) to
 +  * handle authenticating clients,
 +  * set encryption keys,
 +  * establishing key rotation policy,
 +  * handle other aspects of the wireless infrastructure.
 +Due to this, the old method of issuing ''​iwconfig <​wireless interface>​ mode master''​ no longer works. Userspace programs like hostapd now use [[wp>​netlink]] (the nl80211 driver) to create a master mode interface for your traffic and a monitor mode interface for receiving and transmitting management frames. ​
 +
 +
 +==== wpad ====
 +Is a hostapd + [[wireless.utilities\wpa-supplicant|wpa_supplicant]] multicall binary.
 +
 +==== hostapd-mini and wpad-mini ====
 +Are stripped down versions without OpenSSL dependency.
 +
 +^ Available Packages ​ ^^^
 +| hostapd ​            ​| ​  ​232.885 | This package contains a full featured IEEE 802.1x/​WPA/​EAP/​RADIUS Authenticator. \\ ''/​etc/​hostapd.conf''​ is generated by ''​hostapd.sh'' ​ |
 +| hostapd-utils ​      ​| ​   10.198 | This package contains a command line utility to control the IEEE 802.1x/​WPA/​EAP/​RADIUS Authenticator. ​ |
 +^ ^^^
 +| hostapd-mini ​       |   ​134.598 | This package contains a minimal IEEE 802.1x/WPA Authenticator (Alles Version: 20110527-2) |
 +^ ^^^
 +| wpad                |   ​355.463 | This package contains a full featured IEEE 802.1x/​WPA/​EAP/​RADIUS Authenticator and Supplicant ​ |
 +| [[wireless.utilities\wpa-supplicant|wpa-supplicant]] ​     |   ​220.602 | WPA Supplicant ​ |
 +| wpa-cli ​            ​| ​   19.887 | WPA Supplicant command line interface ​ |
 +^ ^^^
 +| wpad-mini ​          ​| ​  ​203.085 | This package contains a minimal IEEE 802.1x/WPA Authenticator and Supplicant (WPA-PSK only). ​ |
 +| wpa-supplicant-mini |   ​111.984 | WPA Supplicant (minimal version) ​ |
 +^ ^^^
 +| libnl-tiny ​         |    13.529 | This package contains a stripped down version of libnl; all packages in hostapd depend on it  |
 +| libnl               ​| ​  ​107.504 | This package contains a library for applications dealing with [[wp>​netlink]] sockets ​ |
 +| xsupplicant ​        ​| ​  ​122.996 | This software allows a host to authenticate with a RADIUS server using 802.1x and various EAP protocols. |
 +
 +|{{:​meta:​icons:​tango:​dialog-information.png?​nolink}}| **''​wpad''​** package is a full featured IEEE 802.1x authenticator/​supplicant ([[wp>​Wi-Fi Protected Access|WPA]]/​[[wp>​Extensible Authentication Protocol|EAP]]/​[[wp>​Remote Authentication Dial In User Service|RADIUS]]),​ while **''​wpad-mini''​** only supports WPA-PSK (Pre-shared key). **''​wpad''​** obsoletes **''​hostapd''​** and ''​[[wireless.utilities\wpa-supplicant|wpa_supplicant]]''​ as it offers both authentication service for the access point mode and supplicant services for the wireless client mode in one package. |
 +
 +Also see [[doc/​uci/​wireless/​encryption#​atheros.and.generic.mac80211.wifi]]
 +
 +FIXME:
 +  * As far as I understand, wpad is a wrapper around hostapd with multicall support and [[wireless.utilities\wpa-supplicant|wpa_supplicant]] built.
 +  * Both wpad and wpad-mini are just wrappers around '​hostapd'​ with support packages, see [[https://​dev.openwrt.org/​browser/​trunk/​package/​hostapd/​Makefile]]
 +    * ''​wpad-mini''​ is the base system with only WPA(2)-PSK authentication.
 +    * ''​wpad''​ supports IEEE 802.1x/​WPA/​EAP/​RADIUS (adds the 'WPA supplicant'​ package with OpenSSL library)
 +  * The ''​hostapd-utils''​ just adds a small hostapd_cli command line tool for messaging with the daemon.
 +
 +  * [[doc/​uci/​wireless/​encryption#​atheros.and.generic.mac80211.wifi]]
 +
 +  * Actually, it's the other way around: hostapd is symlink to wpad, cf. ''/​usr/​sbin/​hostapd -> wpad''​.
 +  * Turning off debugging for ''​[[wireless.utilities\wpa-supplicant|wpa_supplicant]]''​ decreased size of ''​wpad''​-package from ~365 KiB to ~286 KiB. Turning off debugging for hostapd did nothing. Because it's a different binary, not included in ''​wpad''​.
 +
 +===== drivers without cfg80211-support =====
 +==== Atheros proprietary (madwifi) ====
 +  * When in AP-mode, obtain a list of connected clients in STA-mode<​code>​
 +wlanconfig ath0 list sta
 +</​code>​
 +
 +==== Broadcom proprietary (wl)====
 +  * When in AP-mode, obtain a list of connected clients in STA-mode:<​code>​
 +wl assoclist
 +wl sta_info macaddr
 +</​code>​
 +