Wifi/测试

From Gentoo Wiki
< Wifi
Jump to: navigation, search
This page is a translated version of the page Wifi/Testing and the translation is 88% complete.

Other languages:
English • ‎español • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어

测试

After a reboot with the new kernel or after loading the modules, the device can be checked for availability by using following methods:

/sys 文件系统

通过使用 ls -altree 命令(由app-text/tree 包提供))列出 /sys/class/net 目录内容来获取设备名称:

user $tree /sys/class/net
/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命令

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

user $ip addr
3: wlan0:   ...

ifconfig 命令

ifconfig 命令是 sys-apps/net-tools 包提供的。使用 ifconfig -a列出所有检测到的网卡,即使那些尚未启用/尚未活动的网卡:

user $ifconfig -a
wlan0     ...

网卡可以用下面的方法激活:

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命令

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
   phy#0
	Interface wlan0
		ifindex 4
		type managed