Wireless tools for Linux

Last updated
Wireless Tools
Developer(s) Jean Tourrilhes
Stable release
29 / September 17, 2007;16 years ago (2007-09-17)
Operating system Linux
Type Network utilities
License GNU GPL
Website Linux Tools

Wireless tools for Linux is a collection of user-space utilities written for Linux kernel-based operating systems to support and facilitate the configuration of device drivers of wireless network interface controllers and some related aspects of networking using the Linux Wireless Extension. The Wireless tools for Linux and Linux Wireless Extension are maintained by Jean Tourrilhes [1] and sponsored by Hewlett-Packard.

Contents

Adoption

It is included with most operating system distributions built on the Linux kernel. In many Linux distributions, this package is included by default, or based on whether a wireless card is present. If it is not automatically installed by the distribution, it is usually easy to find in binary form.

Frontends

Due to the relative complexity of requiring several separate commands for one task (e.g. iwlist and iwconfig to find and sync with a wireless access point), some [2] recommend using frontends provided by GNOME and KDE, or an application called NetGo, to manipulate these settings.

Alternatives

The Linux kernel authors consider wireless tools package deprecated; [3] the alternative being the more recent iw utility. [4] [5] Especially the iw dev wlan0 scan output provides many additional details over the iwlist scan output. [6]

Package tools

ifrename

ifrename allows to rename wireless network interfaces based on various static criteria to assign a consistent name to each interface.

By default, interface names are dynamic, and each network adapter is assigned the first available name (eth0, eth1...) while the order network interfaces are created may vary. Now ifrename allows the user to decide what name a network interface will have. It can use a variety of selectors to match interface names to the network interfaces on the system, the most common selector is the interface MAC address.

ifrename must be run before interfaces are brought up, which is why it's mostly useful in various scripts (init, hotplug) but is seldom used directly by the user. By default it renames all present system interfaces using mappings defined in /etc/iftab.

iwconfig

iwconfig is used to display and change the parameters of the network interface which are specific to the wireless operation (e.g. interface name, frequency, SSID). It may also be used to display the wireless statistics (extracted from /proc/net/wireless).

In the free Berkeley Software Distribution UNIX operating systems, the role of iwconfig is performed by an expanded ifconfig command.

Sample iwconfig output

The following command displays information about the currently associated wireless network.

 $ iwconfig eth1    eth1     IEEE 802.11g  ESSID:"OSU_PUB"            Mode:Managed  Frequency:2.427 GHz  Access Point: 00:0D:9D:C6:38:2D              Bit Rate=48 Mb/s   Tx-Power=20 dBm   Sensitivity=8/0             Retry limit:7   RTS thr:off   Fragment thr:off           Power Management:off           Link Quality=91/100  Signal level=-39 dBm  Noise level=-87 dBm           Rx invalid nwid:0  Rx invalid crypt:860  Rx invalid frag:0           Tx excessive retries:0  Invalid misc:39   Missed beacon:8 

iwevent

iwevent displays wireless events generated by drivers and setting changes that are received through the RTNetlink socket. Each line displays the specific wireless event which describes what has happened on the specified wireless interface. It doesn't take any arguments.

iwgetid

iwgetid reports the ESSID, NWID or access point/cell address of the wireless network that is currently used. By default it will print the ESSID of the device, and if it doesn't have any it will print its NWID instead. The information reported is the same as the one shown by iwconfig, but iwgetid is easier to integrate in various scripts.

iwlist

iwlist is used to scan for available wireless networks and display additional information about them that is not displayed by iwconfig. The main argument is used to select a category of information, iwlist displays in detailed form all information related to this category, including information already shown by iwconfig.

The command is primarily used to generate a list of nearby wireless access points and their MAC addresses and SSIDs.

Sample iwlist output

The following screen dialog shows the result of scanning for nearby wireless access points.

 $ iwlist eth1 scan    eth1     Scan completed :           Cell 01 - Address: 00:12:17:46:E6:AF                     ESSID:"prettyflyforawifi§"                     Protocol:IEEE 802.11bg                     Mode:Master                     Channel:1                     Encryption key:off                     Bit Rate:1 Mb/s                     Bit Rate:2 Mb/s                     Bit Rate:5.5 Mb/s                     Bit Rate:6 Mb/s                     Bit Rate:9 Mb/s                     Bit Rate:11 Mb/s                     Bit Rate:12 Mb/s                     Bit Rate:18 Mb/s                     Bit Rate:24 Mb/s                     Bit Rate:36 Mb/s                     Bit Rate:48 Mb/s                     Bit Rate:54 Mb/s                     Quality=82/100  Signal level=-48 dBm                       Extra: Last beacon: 36ms ago 

This scan yields only one nearby wireless access point. Helpful information in this scan includes ESSID, the type of network, and signal quality.

iwpriv

It is used to manipulate parameters and setting of the Wireless Extension specific to each driver (as opposed to iwconfig which deals with generic ones).

Without any argument, iwpriv lists the available private commands available on each interface, and the parameters that they require. Using this information, the user may apply those interface specific commands on the specified interface.

iwspy

iwspy is used to monitor a set list of nodes and record the link quality of each of them.

The information gathered is the same as that available in /proc/net/wireless: quality of the link, signal strength and noise level. This information is updated each time a new packet is received, so each address of the list adds some overhead in the driver. Note that this functionality works only for nodes part of the current wireless cell, you can not monitor access points you are not associated with (you can use Scanning for that) and nodes in other cells. In Managed mode, in most case packets are relayed by the access point, in this case you will get the signal strength of the access point. For those reasons this functionality is mostly useful in ad hoc and master mode.

wpa_supplicant/hostapd

wpa_supplicant and hostapd come as a pair of complementary client and host for wireless access points.

That is hostapd allows us to create access points from the command line, which allows one to share one's internet connection wirelessly, while wpa_supplicant allows us to scan and to connect to access points as a client in order to get onto the Internet.

See also

Related Research Articles

<span class="mw-page-title-main">Device driver</span> Software interface to attached devices

In computing, a device driver is a computer program that operates or controls a particular type of device that is attached to a computer or automaton. A driver provides a software interface to hardware devices, enabling operating systems and other computer programs to access hardware functions without needing to know precise details about the hardware being used.

<span class="mw-page-title-main">Security-Enhanced Linux</span> Linux kernel security module

Security-Enhanced Linux (SELinux) is a Linux kernel security module that provides a mechanism for supporting access control security policies, including mandatory access controls (MAC).

tcpdump Data-network packet analyzer

tcpdump is a data-network packet analyzer computer program that runs under a command line interface. It allows the user to display TCP/IP and other packets being transmitted or received over a network to which the computer is attached. Distributed under the BSD license, tcpdump is free software.

chroot is an operation on Unix and Unix-like operating systems that changes the apparent root directory for the current running process and its children. A program that is run in such a modified environment cannot name files outside the designated directory tree. The term "chroot" may refer to the chroot(2) system call or the chroot(8) wrapper program. The modified environment is called a chroot jail.

<span class="mw-page-title-main">/dev/random</span> Pseudorandom number generator file in Unix-like operating systems

In Unix-like operating systems, /dev/random and /dev/urandom are special files that serve as cryptographically secure pseudorandom number generators (CSPRNGs). They allow access to a CSPRNG that is seeded with entropy from environmental noise, collected from device drivers and other sources. /dev/random typically blocked if there was less entropy available than requested; more recently it usually blocks at startup until sufficient entropy has been gathered, then unblocks permanently. The /dev/urandom device typically was never a blocking device, even if the pseudorandom number generator seed was not fully initialized with entropy since boot. Not all operating systems implement the same methods for /dev/random and /dev/urandom.

netstat Command line network statistics tool

In computing, netstat is a command-line network utility that displays network connections for Transmission Control Protocol, routing tables, and a number of network interface and network protocol statistics. It is available on Unix, Plan 9, Inferno, and Unix-like operating systems including macOS, Linux, Solaris and BSD. It is also available on IBM OS/2 and on Microsoft Windows NT-based operating systems including Windows XP, Windows Vista, Windows 7, Windows 8 and Windows 10.

ifconfig Network administration utility

ifconfig is a system administration utility in Unix-like operating systems for network interface configuration.

udev is a device manager for the Linux kernel. As the successor of devfsd and hotplug, udev primarily manages device nodes in the /dev directory. At the same time, udev also handles all user space events raised when hardware devices are added into the system or removed from it, including firmware loading as required by certain devices.

Unix-like operating systems identify a user by a value called a user identifier, often abbreviated to user ID or UID. The UID, along with the group identifier (GID) and other access control criteria, is used to determine which system resources a user can access. The password file maps textual user names to UIDs. UIDs are stored in the inodes of the Unix file system, running processes, tar archives, and the now-obsolete Network Information Service. In POSIX-compliant environments, the shell command id gives the current user's UID, as well as more information such as the user name, primary user group and group identifier (GID).

The Direct Rendering Manager (DRM) is a subsystem of the Linux kernel responsible for interfacing with GPUs of modern video cards. DRM exposes an API that user-space programs can use to send commands and data to the GPU and perform operations such as configuring the mode setting of the display. DRM was first developed as the kernel-space component of the X Server Direct Rendering Infrastructure, but since then it has been used by other graphic stack alternatives such as Wayland and standalone applications and libraries such as SDL2 and Kodi.

<span class="mw-page-title-main">Wireless network interface controller</span> Hardware component that connects a computer to a wireless computer network

A wireless network interface controller (WNIC) is a network interface controller which connects to a wireless network, such as Wi-Fi, Bluetooth, or LTE (4G) or 5G rather than a wired network, such as an Ethernet network. A WNIC, just like other NICs, works on the layers 1 and 2 of the OSI model and uses an antenna to communicate via radio waves.

<span class="mw-page-title-main">NetworkManager</span> Software

NetworkManager is a daemon that sits on top of libudev and other Linux kernel interfaces and provides a high-level interface for the configuration of the network interfaces.

<span class="mw-page-title-main">NDISwrapper</span> Driver wrapper for Windows devices used on Linux

NDISwrapper is a free software driver wrapper that enables the use of Windows XP network device drivers on Linux operating systems. NDISwrapper works by implementing the Windows kernel and NDIS APIs and dynamically linking Windows network drivers to this implementation. As a result, it only works on systems based on the instruction set architectures supported by Windows, namely IA-32 and x86-64.

In Unix-like operating systems, a loop device, vnd, or lofi is a pseudo-device that makes a computer file accessible as a block device.

In computing, Microsoft's Windows Vista and Windows Server 2008 introduced in 2007/2008 a new networking stack named Next Generation TCP/IP stack, to improve on the previous stack in several ways. The stack includes native implementation of IPv6, as well as a complete overhaul of IPv4. The new TCP/IP stack uses a new method to store configuration settings that enables more dynamic control and does not require a computer restart after a change in settings. The new stack, implemented as a dual-stack model, depends on a strong host-model and features an infrastructure to enable more modular components that one can dynamically insert and remove.

The Berkeley Packet Filter is a network tap and packet filter which permits computer network packets to be captured and filtered at the operating system level. It provides a raw interface to data link layers, permitting raw link-layer packets to be sent and received, and allows a userspace process to supply a filter program that specifies which packets it wants to receive. For example, a tcpdump process may want to receive only packets that initiate a TCP connection. BPF returns only packets that pass the filter that the process supplies. This avoids copying unwanted packets from the operating system kernel to the process, greatly improving performance. The filter program is in the form of instructions for a virtual machine, which are interpreted, or compiled into machine code by a just-in-time (JIT) mechanism and executed, in the kernel.

In Unix-like operating systems, a device file, device node, or special file is an interface to a device driver that appears in a file system as if it were an ordinary file. There are also special files in DOS, OS/2, and Windows. These special files allow an application program to interact with a device by using its device driver via standard input/output system calls. Using standard system calls simplifies many programming tasks, and leads to consistent user-space I/O mechanisms regardless of device features and functions.

ethtool is the primary means in Linux kernel-based operating systems for displaying and modifying the parameters of network interface controllers (NICs) and their associated device driver software from application programs running in userspace.

route (command) Computer operating system command

In computing, route is a command used to view and manipulate the IP routing table in Unix-like and Microsoft Windows operating systems and also in IBM OS/2 and ReactOS. Manual manipulation of the routing table is characteristic of static routing.

netsniff-ng Linux networking toolkit

netsniff-ng is a free Linux network analyzer and networking toolkit originally written by Daniel Borkmann. Its gain of performance is reached by zero-copy mechanisms for network packets, so that the Linux kernel does not need to copy packets from kernel space to user space via system calls such as recvmsg . libpcap, starting with release 1.0.0, also supports the zero-copy mechanism on Linux for capturing (RX_RING), so programs using libpcap also use that mechanism on Linux.

References

  1. Wireless Tools for Linux
  2. Linux Journal Marcel Gagne's Cooking With Linux 2005-07-28 edition, http://www.linuxjournal.com/node/8355/print
  3. Arch Linux wiki, https://wiki.archlinux.org/index.php/Wireless_network_configuration#Manual_setup
  4. iw utility homepage, https://wireless.wiki.kernel.org/en/users/documentation/iw
  5. Replacing iwconfig with iw, https://wireless.wiki.kernel.org/en/users/documentation/iw/replace-iwconfig
  6. Xmodulo tutorial, http://xmodulo.com/manage-wifi-connection-command-line.html