From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page Wifi and the translation is 24% complete.
Outdated translations are marked like this.
Other languages:
English • ‎español • ‎français • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어


Cet article décrit l'installation du WiFi (périphérique réseau sans fil).

Le WiFi pendant l'installation

Si une connexion WiFi est requise au cours de l'installation de Gentoo, garder à l'esprit que le CD d'installation minimal Gentoo comprend un nombre limité de pilotes et ne propose que wpa_cli (et pas wpa_gui) pour configurer les connexions WPA/WPA2/Enterprise.

Si le CD d'installation minimal ne contient pas les pilotes requis ou si vous préférez utiliser l'interface graphique de wpa_supplicant, mieux vaut alors choisir un CD d'installation différent, comme le CD System Rescue. Attention, en cas d'utilisation d'un CD d'installation autre que ceux proposés par Gentoo,il se peut que des précautions particulières doivent être prises.

Détection du matériel

Tout d'abord, il faut détecter les contrôleurs WiFi. lspci ou lsusb sont des outils en ligne de commande qui peuvent être utilisés à cette fin.

Si un (LiveCD/USB) Linux est crée une connexion WiFi au démarrage :

root #lspci -k

Le pilote sera identifié sur une des lignes qui commencent par Kernel driver in use:.

[ Traduction en cours ]

root #lspci -n

Copy the list of PCIID's that the command produces.

For USB devices, a similar approach can be taken. First obtain the list of detected USB devices on the system:

user $lsusb

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:

root #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.


Maintenant que les drivers sont identifiés, il faut configurer le kernel Linux.

IEEE 802.11

Activate at least cfg80211 (CONFIG_CFG80211) and mac80211 (CONFIG_MAC80211).

KERNEL linux-4.19 example
[*] Networking support  --->
    [*] Wireless  --->
        <M>   cfg80211 - wireless configuration API
        [ ]     nl80211 testmode command
        [ ]     enable developer warnings
        [ ]     cfg80211 certification onus
        [*]     enable powersave by default
        [ ]     cfg80211 DebugFS entries
        [ ]     support CRDA
        [ ]     cfg80211 wireless extensions compatibility
        <M>   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. Some wireless drivers might require it enabled.

In case the wireless configuration API (CONFIG_CFG80211) is built into the kernel (<*>) instead as a module (<M>), the driver won't be able to load regulatory.db from /lib/firmware resulting in broken regulatory domain support. Please set CONFIG_CFG80211=m or add regulatory.db and regulatory.db.p7s to CONFIG_EXTRA_FIRMWARE.


The "cfg80211 wireless extensions compatibility" option aka WEXT will support old wireless-tools and iwconfig.

[*] Networking support  --->
    [*] Wireless  --->
        [*]     cfg80211 wireless extensions compatibility

Device drivers

Après les options correspondantes du kernel doivent être activées, conformément aux informations sur les drivers et le matériel détecté précédemment. La recommendation est de compiler les drivers comme modules du kernel. Aussi soyez certains d'activer le support d'AES cipher dans le kernel si le réseau utilise WPA ou WPA2.

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.

LED support

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 (especially modern ones) also require firmware. If required, locate it on the following list and install it:

root #emerge --ask sys-kernel/linux-firmware
WiFi device Driver Firmware Note
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 when a 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:

root #touch /etc/udev/rules.d/80-net-name-slot.rules

Wireless supplicant

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):

user $tree /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

ip command

To obtain the device name and verify that the wireless card is detected, execute the following ip command:

user $ip addr
3: wlan0:   ...

ifconfig command

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:

user $ifconfig -a
wlan0     ...

A network card can be activated as follows:

root #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).

iw command

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:

root #iw dev
	Interface wlan0
		ifindex 4
		type managed


Check the output of dmesg.

user $dmesg | grep -i -E 'xx:xx.x|wlan|iwl|80211'

Be sure to replace


Finding missing firmware

At system boot, the kernel will attempt to probe firmware as appropriate for each card. This can be discovered by searching dmesg or journalctl's (systemd) output from the current boot.

user $journalctl -b 0 --dmesg | grep -i firmware
Oct 05 14:51:09 maffbook kernel: Spectre V2 : Enabling Restricted Speculation for firmware calls

Oct 05 14:51:09 maffbook kernel: ACPI: [Firmware Bug]: BIOS _OSI(Linux) query ignored Oct 05 14:51:09 maffbook kernel: sgx: [Firmware Bug]: Unable to map EPC section to online node. Fallback to the NUMA node 0. Oct 05 14:51:09 maffbook kernel: i915 0000:00:02.0: [drm] Finished loading DMC firmware i915/kbl_dmc_ver1_04.bin (v1.4) Oct 05 14:51:09 maffbook kernel: ACPI: video: [Firmware Bug]: ACPI(PEGP) defines _DOD but not _DOS Oct 05 14:51:09 maffbook kernel: iwlwifi 0000:00:14.3: loaded firmware version 46.6b541b68.0 9000-pu-b0-jf-b0-46.ucode op_mode iwlmvm Oct 05 14:51:09 maffbook kernel: psmouse serio1: elantech: assuming hardware version 4 (with firmware version 0x5f2001) Oct 05 14:51:09 maffbook kernel: Bluetooth: hci0: Firmware revision 0.1 build 6 week 12 2021 Oct 06 17:26:26 maffbook kernel: Bluetooth: hci0: Minimum firmware build 1 week 10 2014 Oct 06 17:26:26 maffbook kernel: Bluetooth: hci0: Found device firmware: intel/ibt-17-16-1.sfi Oct 06 17:26:28 maffbook kernel: Bluetooth: hci0: Waiting for firmware download to complete Oct 06 17:26:28 maffbook kernel: Bluetooth: hci0: Firmware loaded in 1484394 usecs

Oct 06 17:26:28 maffbook kernel: Bluetooth: hci0: Firmware revision 0.1 build 6 week 12 2021

Forum threads

See also

External resources