This article describes the setup of a WiFi (wireless) network device.
- 1 WiFi during installation
- 2 Hardware detection
- 3 Kernel
- 4 Firmware
- 5 Network device names
- 6 Wireless supplicant
- 7 Testing
- 8 Troubleshooting
- 9 See also
- 10 External resources
WiFi during installation
If a WiFi connection is needed while installing Gentoo, note that the Gentoo minimal install CD has a limited number of drivers available, and provides only wpa_cli (and not wpa_gui) for configuring for WPA/WPA2/Enterprise connections.
If the minimal install CD does not contain the required drivers or the graphical frontend to wpa_supplicant is preferred, choose a different live CD such as the System Rescue CD. Be aware that some special steps may be required when using a non-Gentoo live CD.
If a Linux (LiveCD/USB) is booted that makes a WiFi connection:
The driver will be identified on one of the lines starting with
Kernel driver in use:.
If the booted system does not make a WiFi connection, then obtain a full list of hardware identifiers from the current system. This list can be used to identify the proper driver later:
Copy the list of PCIID's that the command produces and paste it at https://kmuto.jp/debian/hcl/.
For USB devices, a similar approach can be taken. First obtain the list of detected USB devices on the system:
This command produces the PCI ID, manufacturer, make, model, and/or chipset of every USB device attached to the system. Of these, the chipset may be the most useful information. Searching the web for linuxwireless.org <chipset> is often the shortest way to find a USB NIC driver and firmware name.
Alternatively, lshw can be used to obtain the necessary information:
lshw | grep -i driver | perl -pe 's/^.*driver=(\S+).*$/$1/g;' | sort -u
This command produces a list of all drivers, regardless of the device being PCI or USB based.
With the drivers identified, it is time to configure the Linux kernel.
[*] Networking support ---> [*] Wireless ---> <*> cfg80211 - wireless configuration API [ ] nl80211 testmode command [ ] enable developer warnings [ ] cfg80211 regulatory debugging [ ] cfg80211 certification onus [*] enable powersave by default [ ] cfg80211 DebugFS entries [ ] use statically compiled regulatory rules database [ ] cfg80211 wireless extensions compatibility <*> Generic IEEE 802.11 Networking Stack (mac80211) [*] Minstrel [*] Minstrel 802.11n support [ ] Minstrel 802.11ac support Default rate control algorithm (Minstrel) ---> [ ] Enable mac80211 mesh networking (pre-802.11s) support -*- Enable LED triggers [ ] Export mac80211 internals in DebugFS [ ] Trace all mac80211 debug messages [ ] Select mac80211 debugging features ----
Minstrel and its 802.11n support is a rate control algorithm.
[*] Networking support ---> [*] Wireless ---> [*] cfg80211 wireless extensions compatibility
Next the right set of corresponding kernel options need to be enabled, based on the drivers and hardware detected previously. The recommendation is to build drivers as modules. Also be sure to enable AES cipher support in the kernel if the wireless network uses WPA or WPA2 encryption.
Device Drivers ---> [*] Network device support ---> [*] Wireless LAN ---> Select the driver for your Wifi network device, e.g.: <M> Broadcom 43xx wireless support (mac80211 stack) (b43) [M] Support for 802.11n (N-PHY) devices [M] Support for low-power (LP-PHY) devices [M] Support for HT-PHY (high throughput) devices <M> Intel Wireless WiFi Next Gen AGN - Wireless-N/Advanced-N/Ultimate-N (iwlwifi) <M> Intel Wireless WiFi DVM Firmware support <M> Intel Wireless WiFi MVM Firmware support <M> Intel Wireless WiFi 4965AGN (iwl4965) <M> Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945) <M> Ralink driver support ---> <M> Ralink rt27xx/rt28xx/rt30xx (USB) support (rt2800usb) -*- Cryptographic API ---> -*- AES cipher algorithms -*- AES cipher algorithms (x86_64) <*> AES cipher algorithms (AES-NI)
In case the driver is built into the kernel (
<*>) instead of as a module (
<M>), then the firmware needs to be built into the kernel as well.
Do not forget to rebuild the kernel after changing its configuration.
To enable LED triggers for different packet receive/transmit events, compile the kernel with the following options:
Device Drivers ---> [*] LED Support ---> <*> LED Class Support [*] Networking support ---> [*] Wireless ---> [*] Enable LED triggers
In addition to the kernel driver, some chipsets also require firmware. If required, locate it on the following list and install it:
emerge --ask sys-kernel/linux-firmware
|Atheros AR9271 & AR7010||ath9k_htc||sys-kernel/linux-firmware|
|Broadcom 43xx wireless support||b43 / b43legacy||sys-firmware/b43-firmware||Aircrack-ng ready, most probably the best choice if your bcm43xx device is supported|
|Broadcom PCIe and SDIO/USB devices||brcmsmac / brcmfmac||sys-kernel/linux-firmware||Lacks powersaving, LED support and other features|
|Broadcom 43xx wireless support||wl||net-wireless/broadcom-sta||Proprietary, no AP or Monitor modes, Comparison of bcm43xx drivers|
|Intel PRO/Wireless 2200BG||ipw2200||sys-firmware/ipw2200-firmware|
|Intel PRO/Wireless 3945ABG/BG||iwlegacy||sys-kernel/linux-firmware|
|Intel Wireless WiFi 4965AGN||iwl4965||sys-kernel/linux-firmware|
|All other Intel Wireless devices||iwlwifi||sys-kernel/linux-firmware||See the iwlwifi article for detailed instructions.|
|Qualcomm Atheros QCA6174||ath10k_pci||ath10k-firmware||See Qualcomm_Atheros_QCA6174#Firmware|
|Ralink/MediaTek USB devices||e.g. rt2800usb||sys-kernel/linux-firmware|
|Realtek RTL8191SE & RTL8192SE||rtl8192se||sys-kernel/linux-firmware|
|Realtek 8723AU/8723BU/8191EU/8192EU/8188EU/8188RU||rtl8xxxu||sys-kernel/linux-firmware||May need the CONFIG_RTL8XXXU_UNTESTED kernel option to find all devices. Only those verified by kernel developers are enabled by default.|
If the driver requires firmware but does not appear on the list, it will be necessary to download it manually and place it in /lib/firmware.
Network device names
Network device names such as eth0 or wlan0 as provided by the kernel are normally changed on system boot (see dmesg) by the /lib/udev/rules.d/80-net-name-slot.rules udev rule.
To keep the classic naming this rule can be overwritten with an equally named empty file in the /etc/udev/rules.d directory:
If the wireless network is set up with WPA or WPA2, then a wireless supplicant like wpa_supplicant or iwd needs to be used. For more information on configuring wireless networking in Gentoo Linux, please read the Wireless networking chapter in the Gentoo Handbook.
After a reboot with the new kernel or after loading the modules, the device can be checked for availability by using following methods:
/sys file system
Get the device name by listing the /sys/class/net directory contents using ls -al or the tree command (provided by the app-text/tree package):
/sys/class/net/ ├── enp2s14 -> ../../devices/pci0000:00/0000:00:1e.0/0000:02:0e.0/net/enp2s14 ├── lo -> ../../devices/virtual/net/lo ├── sit0 -> ../../devices/virtual/net/sit0 └── wlp8s0 -> ../../devices/pci0000:00/0000:00:1c.0/0000:08:00.0/net/wlp8s0
To obtain the device name and verify that the wireless card is detected, execute the following ip command:
3: wlan0: ...
The ifconfig command is provided through the sys-apps/net-tools package. Use ifconfig -a to list all detected network cards, even those that are not enabled/active yet:
A network card can be activated as follows:
ifconfig -v wlan0 up
SIOCSIFFLAGS: Operation not possible due to RF-kill WARNING: at least one error occurred. (-1)
In this example, enabling the wireless card failed as a radio frequency kill state is set (usually to keep power consumption at bay and not connect by accident to a wireless network).
If the wireless network card driver supports the nl80211 stack, then the iw command as offered by the net-wireless/iw package can show the detected wireless cards:
phy#0 Interface wlan0 ifindex 4 type managed
Check the output of dmesg.
dmesg | grep -i -E 'xx:xx.x|wlan|iwl|80211'
Be sure to replace
xx:xx.xwith the identifier (PCIID) from lspci,
wlanwith the network interface name and
iwlwith the name of the
Kernel driver in use.
- Forum thread: wireless lan can't get ip from access point which explains about 169.254.x.x (link local address) being a wrong IP address
- Forum thread: iwlwifi fails to load after upgrade to 3.17.0
- Forum thread: Where is my network !?
- AC1200 Wireless Adapters
- Iproute2 — a tool developed to unify network interface configuration, routing, and tunneling.
- Iwlwifi — the wireless driver for Intel's current wireless chips.
- Qualcomm Atheros QCA6174 — a 802.11ac Wireless Network Adapter which is used in some laptops.
- Wireless network configuration at ArchLinux