Wireless network configuration (简体中文)
配置无线网络一般分两步:第一步是识别硬件、安装正确的驱动程序并进行配置,安装盘中已经包含驱动,但是通常需要额外安装;第二步是选择一种管理无线连接的方式。这篇文章涵盖了这两方面,并提供了无线管理工具的链接地址。
Contents
- 1 设备驱动
- 2 无线网络管理
- 3 Troubleshooting
- 4 Troubleshooting drivers and firmware
- 5 参见
- 6 其他资源
设备驱动
默认的 Arch Linux 内核是模块化的,,硬件的设备驱动作为内核模块保存在硬盘上。启动时 udev 会根据硬件加载不同的驱动模块,这就创建了需要的网络接口。
有些无线芯片需要额外的固件,默认安装的 linux-firmware 提供了很多固件。如果缺失需要的固件,请查看 #安装 driver/firmware.
Udev 不是完美的,有些内核模块需要手动安装. 有些时候 Udev 会同时加载相互冲突的多个模块,就需要屏蔽 不需要的模块。
检查设备状态
根据设备是 PCI 还是 USB 连接,执行 lspci -k
或 lsusb -v
检查设备驱动是否已经加载:
$ lspci -k
06:00.0 Network controller: Intel Corporation WiFi Link 5100 Subsystem: Intel Corporation WiFi Link 5100 AGN Kernel driver in use: iwlwifi Kernel modules: iwlwifi
如果是 USB 设备,执行 dmesg | grep usbcore
可以看到类似下面的输出 usbcore: registered new interface driver rtl8187
。
通过 ip link
查看无线 (设备名,通常是类似 wlp2s1
) 的设备。启用设备:
# ip link set <设备名> up
如果设备加载,接口正常启用,说明不需要安装额外的驱动和固件。
安装 driver/firmware
错误信息SIOCSIFFLAGS: No such file or directory
说明需要固件才能工作,
检查内核中的固件信息:
$ dmesg | grep firmware
[ 7.148259] iwlwifi 0000:02:00.0: loaded firmware version 39.30.4.1 build 35138 op_mode iwldvm
如果没有类似的输出,先执行命令,例如iwlwifi
,然后查找对应的错误信息:
$ dmesg | grep iwlwifi
[ 12.342694] iwlwifi 0000:02:00.0: irq 44 for MSI/MSI-X [ 12.353466] iwlwifi 0000:02:00.0: loaded firmware version 39.31.5.1 build 35138 op_mode iwldvm [ 12.430317] iwlwifi 0000:02:00.0: CONFIG_IWLWIFI_DEBUG disabled ... [ 12.430341] iwlwifi 0000:02:00.0: Detected Intel(R) Corporation WiFi Link 5100 AGN, REV=0x6B
根据获得的信息,在下面网址查找硬件支持:
- Ubuntu Wiki 维护了一个设备被内核和用户空间驱动支持状况的列表。
- Linux 无线支持页面 和硬件兼容性列表(HCL)也维护了一个内核友好的设备列表。
- 内核页面 也有一个支持的硬件矩阵。
如果列表中没有,可能你的设备只提供了 Windows 驱动(比如 Broadcom, 3com 等)。这时需要用 ndiswrapper.
Ndiswrapper 可以在 Linux 中使用 Windows 驱动。兼容性列表在 这里. 需要 Windows 中安装的 .inf
和 .sys
文件。如果有更新的网卡,请通过互联网搜索型号名称 + 'linux' 以获取更多信息。
无线网络管理
为了管理已经安装好的无线驱动,并且使无线能正常工作,需要安装一个无线连接管理工具。下面章节将帮助您确定一个最佳管理方法。
过程和需要使用的工具,将依赖于下面几个因素:
- 配置方式,从完全手动执行每一步到软件自动管理、自动启动
- 是否使用加密及加密类型
- 是否需要区分网络配置,是否经常切换不同网络(比如手提电脑)。
无论选的那个方案,最好先尝试手动方法。这将有助于您了解不同步骤的意义,并在出问题时解决之。 如果可以的话(比如说你在管理你自己的无线接入点),尝试连接一个开放的无线网络来检查是否所有的配置都在正常工作。然后再尝试加密的无线接入点,比如WEP(更易于配置)或者WPA。
此表列出可以使用的激活和管理无线网络的方法,按照加密和管理方式分类,给出了需要的工具。虽然还有其他办法,但这些是最常使用的:
管理方法 | 接口激活 | 无线连接管理 (/=alternatives) |
IP 地址分配 (/=alternatives) |
---|---|---|---|
手动设置, 无加密或 WEP 加密 |
ip | iw / iwconfig | ip / dhcpcd / dhclient |
手动管理, WPA 或 WPA2 PSK 加密 |
ip | iw / iwconfig + wpa_supplicant | ip / dhcpcd / dhclient |
自动管理, 支持网络配置 |
netctl, Wicd, NetworkManager, etc. 这些工具会自动安装手动配置需要的工具。 |
手动设置
软件包 wireless_tools 提供了建立无线连接的基础工具。如果你需要使用 WPA/WPA2 加密,还需要 wpa_supplicant。 这些强大的用户空间终端工具提供了完全的控制手段。
这些例子假设无线设备是 wlan0
, 请将其替换为正确的设备名。
和其它网络接口一样,无线设备也是通过 iproute2 软件包提供的 ip 命令进行。
基本的工具如下,这些用户空间工具可以对无线连接进行完整控制。
- iw - 当前的 nl80211 标准,不是所有的芯片都支持。
- wireless_tools - 已经过时,但是依然广泛使用。
- wpa_supplicant - 提供 WPA/WPA2 加密支持
下面表格给出了 iw
和 wireless_tools
命令的对比(更多示例参阅 这里).
iw 命令 | wireless_tools 命令 | 描述 |
---|---|---|
iw dev wlan0 link | iwconfig wlan0 | 获取连接状态 |
iw dev wlan0 scan | iwlist wlan0 scan | 扫描可用热点 |
iw dev wlan0 set type ibss | iwconfig wlan0 mode ad-hoc | 设置操作模式为 ad-hoc. |
iw dev wlan0 connect your_essid | iwconfig wlan0 essid your_essid | 连接到开放网络 |
iw dev wlan0 connect your_essid 2432 | iwconfig wlan0 essid your_essid freq 2432M | 连接到开放网络的一个频道 |
iw dev wlan0 connect your_essid key 0:your_key | iwconfig wlan0 essid your_essid key your_key | 用16进制加密密码访问 WEP 加密网络 |
iw dev wlan0 connect your_essid key 0:your_key | iwconfig wlan0 essid your_essid key s:your_key | 用 ASCII 密码访问 WEP 加密网络. |
iw dev wlan0 set power_save on | iwconfig wlan0 power on | 启用省电模式 |
获取有用信息
iw 官方文档 包含更多示例。
- 获取接口名:
$ iw dev
phy#0 Interface wlan0 ifindex 3 wdev 0x1 addr 12:34:56:78:9a:bc type managed channel 1 (2412 MHz), width: 40 MHz, center1: 2422 MHz
- 检查连接状态,未连接时,可以看到:
$ iw dev wlan0 link
Not connected.
连接到 AP 后可以看到:
$ iw dev wlan0 link
Connected to 12:34:56:78:9a:bc (on wlan0) SSID: MyESSID freq: 2412 RX: 33016518 bytes (152703 packets) TX: 2024638 bytes (11477 packets) signal: -53 dBm tx bitrate: 150.0 MBit/s MCS 7 40MHz short GI bss flags: short-preamble short-slot-time dtim period: 1 beacon int: 100
- 获取统计数据:
$ iw dev wlan0 station dump
Station 12:34:56:78:9a:bc (on wlan0) inactive time: 1450 ms rx bytes: 24668671 rx packets: 114373 tx bytes: 1606991 tx packets: 8557 tx retries: 623 tx failed: 1425 signal: -52 dBm signal avg: -53 dBm tx bitrate: 150.0 MBit/s MCS 7 40MHz short GI authorized: yes authenticated: yes preamble: long WMM/WME: yes MFP: no TDLS peer: no
激活内核接口
(可能需要) 一些无线网卡在使用 wireless_tools前需要激活内核接口:
# ip link set wlan0 up
如果出现错误 RTNETLINK answers: Operation not possible due to RF-kill
, 请确保硬件开关已经打开。参阅 #Rfkill caveat。
要验证接口确实打开:
# ip link show wlan0
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 link/ether 12:34:56:78:9a:bc brd ff:ff:ff:ff:ff:ff
<BROADCAST,MULTICAST,UP,LOWER_UP>
中的UP
显示接口已经打开。
查看接入点
# iw dev wlan0 scan |less
The important points to check:
- SSID: the name of the network.
- Signal: is reported in a wireless power ratio in dbm (e.g. from -100 to 0). The closer the negative value gets to zero, the better the signal. Observing the reported power on a good quality link and a bad one should give an idea about the individual range.
- Security: it is not reported directly, check the line starting with
capability
. If there isPrivacy
, for examplecapability: ESS Privacy ShortSlotTime (0x0411)
, then the network is protected somehow.- If you see an
RSN
information block, then the network is protected by Robust Security Network protocol, also known as WPA2. - If you see an
WPA
information block, then the network is protected by Wi-Fi Protected Access protocol. - In the
RSN
andWPA
blocks you may find the following information:- Group cipher: value in TKIP, CCMP, both, others.
- Pairwise ciphers: value in TKIP, CCMP, both, others. Not necessarily the same value than Group cipher.
- Authentication suites: value in PSK, 802.1x, others. For home router, you'll usually find PSK (i.e. passphrase). In universities, you are more likely to find 802.1x suite which requires login and password. Then you will need to know which key management is in use (e.g. EAP), and what encapsulation it uses (e.g. PEAP). Find more details at Wikipedia:Authentication protocol and the sub-articles.
- If you do not see neither
RSN
norWPA
blocks but there isPrivacy
, then WEP is used.
- If you see an
操作模式
(可能需要) 设置无线网卡的操作模式,如果连接到漫游网络,需要设置操作模式为 ibss
# iw wlan0 set type ibss
关联
根据加密方式不同,需要使用密码将无线设备关联到接入点。
假设要使用的接入点 ESSID 为 MyEssid
:
- 无加密
# iw wlan0 connect MyEssid
- WEP
使用十六进制或 ASCII 密码(格式是自动识别出来的,因为 WEP 密码长度是固定的):
# iw dev wlan0 connect your_essid key 0:your_key
使用十六进制或 ASCII 密码,第三个是默认 (从0计数,共四个):
# iw dev wlan0 connect your_essid key d:2:your_key
- WPA/WPA2
# wpa_supplicant -i interface -c <(wpa_passphrase your_SSID your_key)
假设设备使用 wext
驱动。如果无法工作,可能需要调整选项,参见 WPA supplicant。
如果连接成功,在新终端中执行后续命令或(或者通过 Ctrl+c
退出并使用 -B
参数在后台再次执行上述命令。WPA supplicant 页面包含更多参数和配置文件的信息。
通过下面命令确认是否连接成功:
# iw dev wlan0 link
获取 IP 地址
使用 DHCP:
# dhcpcd wlan0
或
# dhclient wlan0
静态 IP:
# ip addr add 192.168.0.2/24 dev wlan0 # ip route add default via 192.168.0.1
Custom startup scripts/services
Although the manual configuration method will help troubleshoot wireless problems, you will have to re-type every command each time you reboot. You can also quickly write a shell script to automate the whole process, which is still a quite convenient way of managing network connection while keeping full control over your configuration. You can find some examples in this section.
Manual wireless connection at boot using systemd and dhcpcd
This example uses systemd for start up, WPA supplicant for connecting, and dhcpcd for assigning an IP address.
Create a systemd unit, e.g /etc/systemd/system/network-wireless@.service
:
/etc/systemd/system/network-wireless@.service
[Unit] Description=Wireless network connectivity (%i) Wants=network.target Before=network.target BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=oneshot RemainAfterExit=yes ExecStart=/usr/bin/ip link set dev %i up ExecStart=/usr/bin/wpa_supplicant -B -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf ExecStart=/usr/bin/dhcpcd %i ExecStop=/usr/bin/ip link set dev %i down [Install] WantedBy=multi-user.target
Start and/or enable the unit as described in systemd#Using units, remember to pass the name of the interface:
# systemctl enable network-wireless@wlan0.service # systemctl start network-wireless@wlan0.service
Systemd with wpa_supplicant and static IP
First create configuration file for the systemd service, replace interface
with proper interface name:
/etc/conf.d/network-wireless@interface
address=192.168.0.10 netmask=24 broadcast=192.168.0.255 gateway=192.168.0.1
Create a systemd unit file:
/etc/systemd/system/network-wireless@.service
[Unit] Description=Wireless network connectivity (%i) Wants=network.target Before=network.target BindsTo=sys-subsystem-net-devices-%i.device After=sys-subsystem-net-devices-%i.device [Service] Type=oneshot RemainAfterExit=yes EnvironmentFile=/etc/conf.d/network-wireless@%i ExecStart=/usr/bin/ip link set dev %i up ExecStart=/usr/bin/wpa_supplicant -B -i %i -c /etc/wpa_supplicant/wpa_supplicant.conf ExecStart=/usr/bin/ip addr add ${address}/${netmask} broadcast ${broadcast} dev %i ExecStart=/usr/bin/ip route add default via ${gateway} ExecStop=/usr/bin/ip addr flush dev %i ExecStop=/usr/bin/ip link set dev %i down [Install] WantedBy=multi-user.target
Enable the unit and start it, passing the name of the interface:
# systemctl enable network-wireless@wlan0.service # systemctl start network-wireless@wlan0.service
自动设置
有许多可选方法,但是注意它们是互斥的,不能同时运行两个守护进程。下面是比较表格:
连接管理器 | profiles 支持 | 漫游 (自动连接和重连) |
PPP 支持 (3G modem) |
官方 GUI |
控制台工具 |
---|---|---|---|---|---|
Connman | Yes | Yes | Yes | No | connmanctl
|
Netctl | Yes | Yes | Yes | No | netctl ,wifi-menu
|
NetworkManager | Yes | Yes | Yes | Yes | nmcli
|
Wicd | Yes | Yes | No | Yes | wicd-curses
|
Connman
ConnMan is an alternative to NetworkManager and Wicd, designed to be light on resources making it ideal for netbooks, and other mobile devices. It is modular in design takes advandage of the dbus API and provides proper abstraction on top of wpa_supplicant.
See: Connman
Netctl
netctl is a replacement for netcfg designed to work with systemd. It uses a profile based setup and is capable of detection and connection to a wide range of network types. This is no harder than using graphical tools.
See: Netctl
Wicd
Wicd 是可以同时处理无线和有线网络的管理器。用 Python 和 Gtk 写成,依赖关系比 NetworkManager 少,所以是轻量级桌面的理想选择。位于官方软件仓库.
参见: Wicd
NetworkManager
NetworkManager 是高级网络管理工具,在大部分流行发行版中使用。除了能管理有线链接,NetworkManager还提供了一个易于使用的图形界面程序来选择想要的无线移动链接。
详情请见 NetworkManager。
Wifi Radar
WiFi Radar是 一个Python/PyGTK2 的管理无线配置的程序(只有无线)。它能够扫描可用的网络,为选择的网络创建新的配置。
详情请见Wifi Radar。
Power saving
参阅Power saving.
Troubleshooting
This section contains general troubleshooting tips, not strictly related to problems with drivers or firmware. For such topics, see next section.
Rfkill caveat
Many laptops have a hardware button (or switch) to turn off wireless card, however, the card can also be blocked by kernel. This can be handled by rfkill. Use rfkill to show the current status:
# rfkill list
0: phy0: Wireless LAN Soft blocked: yes Hard blocked: yes
If the card is hard-blocked, use the hardware button (switch) to unblock it. If the card is not hard-blocked but soft-blocked, use the following command:
# rfkill unblock wifi
More info: http://askubuntu.com/questions/62166/siocsifflags-operation-not-possible-due-to-rf-kill
Respecting the regulatory domain
The regulatory domain, or "regdomain", is used to reconfigure wireless drivers to make sure that wireless hardware usage complies with local laws set by the FCC, ETSI and other organizations. Regdomains use ISO 3166-1 alpha-2 country codes. For example, the regdomain of the United States would be "US", China would be "CN", etc.
Regdomains affect the availability of wireless channels. In the 2.4GHz band, the allowed channels are 1-11 for the US, 1-14 for Japan, and 1-13 for most of the rest of the world. In the 5GHz band, the rules for allowed channels are much more complex. In either case, consult this list of WLAN channels for more detailed information.
Regdomains also affect the limit on the effective isotropic radiated power (EIRP) from wireless devices. This is derived from transmit power/"tx power", and is measured in dBm/mBm (1dBm=100mBm) or mW (log scale). In the 2.4GHz band, the maximum is 30dBm in the US and Canada, 20dBm in most of Europe, and 20dB-30dBm for the rest of the world. In the 5GHz band, maximums are usually lower. Consult the wireless-regdb for more detailed information (EIRP dBm values are in the second set of brackets for each line).
Misconfiguring the regdomain can be useful - for example, by allowing use of an unused channel when other channels are crowded, or by allowing an increase in tx power to widen transmitter range. However, this is not recommended as it could break local laws and cause interference with other radio devices.
To configure the regdomain, install crda and wireless-regdb and reboot (to reload the cfg80211
module and all related drivers). Check the boot log to make sure that CRDA is being called by cfg80211
:
$ dmesg | grep cfg80211
The current regdomain can be set to the United States with:
# iw reg set US
And queried with:
$ iw reg get
However, setting the regdomain may not alter your settings. Some devices have a regdomain set in firmware/EEPROM, which dictates the limits of the device, meaning that setting regdomain in software can only increase restrictions, not decrease them. For example, a CN device could be set in software to the US regdomain, but because CN has an EIRP maximum of 20dBm, the device will not be able to transmit at the US maximum of 30dBm.
For example, to see if the regdomain is being set in firmware for an Atheros device:
$ dmesg | grep ath:
For other chipsets, it may help to search for "EEPROM", "regdomain", or simply the name of the device driver.
To see if your regdomain change has been successful, and to query the number of available channels and their allowed transmit power:
$ iw list | grep -A 15 Frequencies:
A more permanent configuration of the regdomain can be achieved through editing /etc/conf.d/wireless-regdom
and uncommenting the appropriate domain. wpa_supplicant
can also use a regdomain in the country=
line of /etc/wpa_supplicant.conf
.
It is also possible to configure the cfg80211 kernel module to use a specific regdomain by adding, for example, options cfg80211 ieee80211_regdom=EU
to /etc/modprobe.d/modprobe.conf
. However, this is part of the old regulatory implementation.
For further information, read the wireless.kernel.org regulatory documentation.
Observing Logs
A good first measure to troubleshoot is to analyze the system's logfiles first. In order not to manually parse through them all, it can help to open a second terminal/console window and watch the kernels messages with
$ dmesg -w
while performing the action, e.g. the wireless association attempt.
When using a tool for network management, the same can be done for systemd with
# journalctl -f
Frequently a wireless error is accompanied by a deauthentication with a particular reason code, for example:
wlan0: deauthenticating from XX:XX:XX:XX:XX:XX by local choice (reason=3)
Looking up the reason code might give a first hint.
The individual tools used in this article further provide options for more detailed debugging output, which can be used in a second step of the analysis, if required.
Failed to get IP address
- If getting an IP address repeatedly fails using the default dhcpcd client, try installing and using dhclient instead. Do not forget to select dhclient as the primary DHCP client in your connection manager!
- If you can get an IP address for a wired interface and not for a wireless interface, try disabling the wireless card's power saving features:
# iwconfig wlan0 power off
- If you get a timeout error due to a waiting for carrier problem, then you might have to set the channel mode to
auto
for the specific device:
# iwconfig wlan0 channel auto
Before changing the channel to auto, make sure your wireless interface is down. After it has successfully changed it, you can bring the interface up again and continue from there.
Connection always times out
The driver may suffer from a lot of tx excessive retries and invalid misc errors for some unknown reason, resulting in a lot of packet loss and keep disconnecting, sometimes instantly. Following tips might be helpful.
Lowering the rate
Try setting lower rate, for example 5.5M:
# iwconfig wlan0 rate 5.5M auto
Fixed option should ensure that the driver does not change the rate on its own, thus making the connection a bit more stable:
# iwconfig wlan0 rate 5.5M fixed
Lowering the txpower
You can try lowering the transmit power as well. This may save power as well:
# iwconfig wlan0 txpower 5
Valid settings are from 0
to 20
, auto
and off
.
Setting rts and fragmentation thresholds
Default iwconfig options have rts and fragmentation thresholds off. These options are particularly useful when there are many adjacent APs or in a noisy environment.
The minimum value for fragmentation value is 256 and maximum is 2346. In many windows drivers the maximum is the default value:
# iwconfig wlan0 frag 2346
For rts minimum is 0, maximum is 2347. Once again windows drivers often use maximum as the default:
# iwconfig wlan0 rts 2347
Random disconnections
Cause #1
If dmesg says wlan0: deauthenticating from MAC by local choice (reason=3)
and you lose your Wi-Fi connection, it is likely that you have a bit too aggressive power-saving on your Wi-Fi card[1]. Try disabling the wireless card's power-saving features:
# iwconfig wlan0 power off
See Power saving for tips on how to make it permanent (just specify off
instead of on
).
If your card does not support iwconfig wlan0 power off
, check the BIOS for power management options. Disabling PCI-Express power management in the BIOS of a Lenovo W520 resolved this issue.
Cause #2
If you are experiencing frequent disconnections and dmesg shows messages such as
ieee80211 phy0: wlan0: No probe response from AP xx:xx:xx:xx:xx:xx after 500ms, disconnecting
try changing the channel bandwidth to 20MHz
through your router's settings page.
Cause #3
On some laptop models with hardware rfkill switches (e.g., Thinkpad X200 series), due to wear or bad design, the switch (or its connection to the mainboard) might become loose over time resulting in seemingly random hardblocks/disconnects when you accidentally touch the switch or move the laptop. There is no software solution to this, unless your switch is electrical and the BIOS offers the option to disable the switch. If your switch is mechanical (most are), there are lots of possible solutions, most of which aim to disable the switch: Soldering the contact point on the mainboard/wifi-card, glueing or blocking the switch, using a screw nut to tighten the switch or removing it altogether.
Troubleshooting drivers and firmware
This section covers methods and procedures for installing kernel modules and firmware for specific chipsets, that differ from generic method.
See Kernel modules for general informations on operations with modules.
Ralink
rt2x00
Ralink 芯片组的统一驱动,代替了 rt2500
, rt61
, rt73
等。Linux 内核从 2.6.24 开始包含此驱动,但是有些设备可能需要额外固件。可以使用标准 wpa_supplicant 和 iwconfig
工具配置。
有些芯片组需要固件文件,可以安装软件包 linux-firmware。
参见: Using the new rt2x00 beta driver
- Since kernel 3.0, rt2x00 includes also these drivers:
rt2800pci
,rt2800usb
.rt2860sta
被主分支驱动rt2800pci
替代,rt2870sta
被rt2800usb
替代。 - 通过
iwpriv
可以配置很多参数,文档在 Ralink 源代码包 中。
rt3090
For devices which are using the rt3090 chipset it should be possible to use rt2800pci
driver, however, is not working with this chipset very well (e.g. sometimes it's not possible to use higher rate than 2Mb/s).
The best way is to use the rt3090-dkmsAUR[broken link: archived in aur-mirror] driver from AUR. Make sure to blacklist the rt2800pci
module and setup the rt3090sta
module to load at boot.
rt3290
The rt3290 chipset is recognised by the kernel rt2800pci
module. However, some users experience problems and reverting to a patched Ralink driver seems to be beneficial in these cases.
rt3573
2012年新出的芯片组,需要 Ralink 的闭源驱动,有不同的厂商使用他们,参阅Belkin N750 示例 。
rt5572
支持 5 Gh 频率,需要 Ralink 的闭源驱动,编译指令位于这里
Realtek
rtl8192cu
The driver is now in the kernel, but many users have reported being unable to make a connection although scanning for networks does work.
Package 8192cu-dkmsAUR in the AUR includes many patches, try this if it doesn't work fine with the driver in kernel.
rtl8192e
The driver is part of the current kernel package. 启动时可能装入模块失败,错误信息是:
rtl819xE:ERR in CPUcheck_firmware_ready() rtl819xE:ERR in init_firmware() step 2 rtl819xE:ERR!!! _rtl8192_up(): initialization is failed! r8169 0000:03:00.0: eth0: link down
一个暂时的解决方法是卸载模块:
# modprobe -r r8192e_pci
等一会后,重新装入模块:
# modprobe r8192e_pci
rtl8188eu
Some dongles, like the TP-Link TL-WN725N v2 (not sure, but it seems that uses the rtl8179 chipset), use chipsets compatible with this driver. In order to use it you have to install the dkms-8188euAUR[broken link: archived in aur-mirror] package in the AUR.
rtl8723be
The driver for this card is designated to be entered into the Linux kernel as a part of version 3.15. Until version 3.15 is released, the kernel module for the card can be downloaded from lwfinger's github. If git is not installed, please install it.
$ cd ~/temp $ git clone https://github.com/lwfinger/rtl8723be.git $ cd rtl8723be $ make # make install # modprobe rtl8723be
When running make
, some users may encounter a compile error based on the kernel version. If, and only if you encounter a compile error:
$ nano rtl8723be/trx.c
On line 621, change the line
if ((_ieee80211_is_robust_mgmt_frame(hdr)) &&
to
if ((ieee80211_is_robust_mgmt_frame(hdr)) &&
Save, then cd back to the main rtl8723be directory and continue from make install
Additionally, some users may encounter errors with powersave on this card. This is shown with occasional disconnects that are not recognized by high level network managers (netctl, NetworkManager). This error can be confirmed by running $ dmesg -w
or $ journalctl -f
and looking for output related to powersave and the rtl8723be module. If you are having this issue, you need to add a kernel option:
# nano /etc/modprobe.d/rtl8723be.conf
Add this line to the new file:
#Prevents the WiFi card from automatically sleeping and halting connection options rtl8723be fwlps=0
That should rectify any issues with firmware powersaving.
Atheros
MadWifi team 开发组维护了三个模块:
-
madwifi
是最老的驱动, Arch kernel 从 2.6.39.1 开始已经不再包含。 -
ath5k
将逐步替代ath_pci
,有些芯片组使用效果很好,但有些还不能很好工作(后面有介绍) -
ath9k
是新的官方驱动,适用于新 Atheros 硬件。
There are some other drivers for some Atheros devices. See Linux Wireless documentation for details.
ath5k
参考:
If you find web pages randomly loading very slow, or if the device is unable to lease an IP address, try to switch from hardware to software encryption by loading the ath5k
module with nohwcrypt=1
option. See Kernel modules#Setting module options for details.
有些笔记本的 LED 指示灯有问题,可以:
echo none > "/sys/class/leds/ath5k-phy0::tx/trigger" echo none > "/sys/class/leds/ath5k-phy0::rx/trigger"
ath9k
ath9k
是 Atheros 官方支持的驱动,支持所有带 802.11n 功能的芯片组,最大传输速度 180 Mbps. 这个页面 列出了所有支持的硬件。
工作模式:Station, AP and Adhoc.
ath9k
是官方内核的一部分。如果在极个别情况下遇到稳定性问题,可以使用 compat-wireless 软件包。ath9k 邮件列表 提供了支持和开发的相关信息。
参考:
ath9k
External resources:
In the unlikely event that you have stability issues that trouble you, you could try using the compat-wireless package. An ath9k mailing list exists for support and development related discussions.
ASUS
With some ASUS laptops (tested with ASUS U32U series), it could help to add options asus_nb_wmi wapf=1
to /etc/modprobe.d/asus_nb_wmi.conf
to fix rfkill-related issues.
You can also try to blacklist the module asus_nb_wmi (tested with ASUSPRO P550C):
# echo "blacklist asus_nb_wmi" >> /etc/modprobe.d/blacklist.conf
Intel
ipw2100 与 ipw2200
内核完全支持,但是需要安装额外的固件。根据芯片组型号,安装 软件包 ipw2100-fw 或 ipw2200-fw。
iwlegacy
iwlegacy is the wireless driver for Intel's 3945 and 4965 wireless chips. The firmware is included in the linux-firmware package.
udev should load the driver automatically, otherwise load iwl3945
or iwl4965
manually. See Kernel modules#Loading for details.
iwlwifi
iwlwifi is the wireless driver for Intel's current wireless chips, such as 5100AGN, 5300AGN, and 5350AGN. See the full list of supported devices. The firmware is included in the linux-firmware package.
If you have problems connecting to networks in general or your link quality is very poor, try to disable 802.11n and enable software encryption:
/etc/modprobe.d/iwlwifi.conf
options iwlwifi 11n_disable=1 options iwlwifi swcrypto=1
In case this does not work for you, you may try disabling power saving for your wireless adapter. For a permanent solution, add a new udev rule:
/etc/udev/rules.d/80-iwlwifi.rules
ACTION=="add", SUBSYSTEM=="net", ATTR{address}=="<your_mac_address>", RUN+="/usr/bin/iw dev %k set power_save off"
禁用 LED 闪烁
默认设置中 LED 闪烁是开着的,有些人不喜欢,可以systemd-tmpfiles禁止闪烁:
/etc/tmpfiles.d/phy0-led.conf
w /sys/class/leds/phy0-led/trigger - - - - phy0radio
Run systemd-tmpfiles --create phy0-led.conf
for the change to take effect, or reboot.
To see all the possible trigger values for this LED:
# cat /sys/class/leds/phy0-led/trigger
# cat /sys/class/leds/phy0-led/trigger
Broadcom
See Broadcom wireless.
Tenda w322u
Treat this Tenda card as an rt2870sta
device. See #rt2x00.
orinoco
这应当是内核的一部分,是已经被安装的。
Some Orinoco chipsets are Hermes II. You can use the wlags49_h2_cs
driver instead of orinoco_cs
and gain WPA support. To use the driver, blacklist orinoco_cs
first.
prism54
The driver p54
is included in kernel, but you have to download the appropriate firmware for your card from this site and install it into the /usr/lib/firmware
directory.
过时的 prism54
和新内核模块 p54pci
或 p54usb
同时装入造成冲突,使用 lsmod | grep prism54
查看是否装入了过时模块,如果是,那么就 屏蔽 prism54
并根据上面方法修改固件名称。
ACX100/111
Packages: tiacx
tiacx-firmware
(deleted from official repositories and AUR)
See official wiki for details.
zd1211rw
zd1211rw
是ZyDAS ZD1211 802.11b/g USB WLAN芯片的驱动,最近的版本的内核已经包括了。zd1211rw [2]有被支持的设备列表。 你只需要这样安装固件zd1211-firmware。
hostap_cs
Host AP is a Linux driver for wireless LAN cards based on Intersil's Prism2/2.5/3 chipset. The driver is included in Linux kernel.
ndiswrapper
Ndiswrapper并不是一个真正的驱动,但是如果你无法找到适合你的无线网卡驱动的适合, 它就派上用场了.有的时候, 它是非常有用的.为了使用Ndiswrapper, 你需要Windows驱动中的*.inf文件(*.sys文件应该和*.info在同一个目录中)。确保使用合适架构(也就是32/64位)的驱动。如果你需要从 *.exe
文件解压缩,你可以使用 cabextract.
下面是安装ndiswrapper的几个步骤:
1. 安装驱动到 /etc/ndiswrapper/*
ndiswrapper -i filename.inf
2. 列出所有的安装的驱动
ndiswrapper -l
3. 书写配置文件到 /etc/modprobe.d/ndiswrapper.conf
ndiswrapper -m depmod -a
现在基本上就要安装完ndiswrapper了; 依照 这里设置启动时加载这个模块。
modprobe ndiswrapper iwconfig
如果正常的话, 你应该可以看到wlan0接口了. 如果有问题的话, 你可以从 Ndiswrapper 安装 wiki上面得到更多的信息.
参见
其他资源
- NetworkManager - NetworkManager官方网站
- WICD - WICD官方网站
- Wifi Radar - Wifi Radar官方网站
- 一个很少能帮忙的废话连篇的howto
- madwifi的安装方法,如果你在用Arch的方式安装时遇到了问题