iw 无法配置接口

iw 无法配置接口

我有两台电脑:

  • Ubuntu 12.04.4、3.5.0-45-generic(我们称之为“myGoodPC”)
  • Ubuntu 12.04.3、3.8.0-35-generic(我们称之为“myBadPC”)

myBadPC在ESXi 5.0.0的虚拟机中运行。

myGoodPC我设法正确配置无线接口:

root@myGoodPC:~# sudo iw --debug dev wlan0 set channel 10 HT40-
-- Debug: Sent Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 44
    .nlmsg_type = 24 <0x18>
    .nlmsg_flags = 5 <REQUEST,ACK>
    .nlmsg_seq = 1398703424
    .nlmsg_pid = 14796
  [PAYLOAD] 28 octets
    02 00 00 00 08 00 03 00 08 00 00 00 08 00 26 00 99 09 ..............&...
    00 00 08 00 27 00 02 00 00 00                         ....'.....
---------------------------  END NETLINK MESSAGE   ---------------------------
-- Debug: Received Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 36
    .nlmsg_type = 2 <ERROR>
    .nlmsg_flags = 0 <>
    .nlmsg_seq = 1398703424
    .nlmsg_pid = 14796
  [ERRORMSG] 20 octets
    .error = 0 "Success"
  [ORIGINAL MESSAGE] 16 octets
    .nlmsg_len = 16
    .nlmsg_type = 24 <0x18>
    .nlmsg_flags = 5 <REQUEST,ACK>
    .nlmsg_seq = 1398703424
    .nlmsg_pid = 14796
---------------------------  END NETLINK MESSAGE   ---------------------------

我还成功嗅探 WiFi 数据包(ICMP / ping 数据包)。

尝试配置时出现myBadPC错误:

root@myBadPC:~# sudo iw --debug dev wlan0 set channel 10 HT40-
-- Debug: Sent Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 44
    .nlmsg_type = 25 <0x19>
    .nlmsg_flags = 5 <REQUEST,ACK>
    .nlmsg_seq = 1398698982
    .nlmsg_pid = 14533
  [PAYLOAD] 28 octets
    02 00 00 00 08 00 03 00 03 00 00 00 08 00 26 00 99 09 ..............&...
    00 00 08 00 27 00 02 00 00 00                         ....'.....
---------------------------  END NETLINK MESSAGE   ---------------------------
-- Debug: Received Message:
--------------------------   BEGIN NETLINK MESSAGE ---------------------------
  [HEADER] 16 octets
    .nlmsg_len = 64
    .nlmsg_type = 2 <ERROR>
    .nlmsg_flags = 0 <>
    .nlmsg_seq = 1398698982
    .nlmsg_pid = 14533
  [ERRORMSG] 20 octets
    .error = -16 "Device or resource busy"
  [ORIGINAL MESSAGE] 16 octets
    .nlmsg_len = 16
    .nlmsg_type = 25 <0x19>
    .nlmsg_flags = 5 <REQUEST,ACK>
    .nlmsg_seq = 1398698982
    .nlmsg_pid = 14533
---------------------------  END NETLINK MESSAGE   ---------------------------
command failed: Device or resource busy (-16)

显然,在此命令之后我无法嗅探数据包(ICMP/ping)(但广播可见)。

注意:为了清楚起见,我从上面的代码中删除了其他命令(例如ifconfig wlan0 down之前iwiwconfig wlan0 mode monitor之后ifconfig wlan0 up的命令)。

什么可能导致 wlan0 出现错误myBadPC

相关内容