linux 无线网卡配置

来源:互联网 发布:2017淘宝双11实时 编辑:程序博客网 时间:2024/05/16 06:51

系统为gentoo,内核版本为4.3.2

内核配置网卡种类ID内核选项  Intel Corporation Dual Band Wireless-N 72608086:08b1CONFIG_MAC80211
CONFIG_IWLWIFI  Broadcom Corporation BCM4312 802.11b/g LP-PHY14e4:4315CONFIG_CFG80211
CONFIG_HOSTAP  


查看内核的驱动模块(需要编译成模块)

# modinfo iwlwififilename:       /lib/modules/4.3.2-gentoo/kernel/drivers/net/wireless/iwlwifi/iwlwifi.kolicense:        GPLauthor:         Copyright(c) 2003- 2015 Intel Corporation <ilw@linux.intel.com>description:    Intel(R) Wireless WiFi driver for Linuxfirmware:       iwlwifi-7265D-12.ucodefirmware:       iwlwifi-7265-12.ucodefirmware:       iwlwifi-3160-12.ucodefirmware:       iwlwifi-7260-12.ucodefirmware:       iwlwifi-8000-12.ucode...... 

# modinfo wlfilename:       /lib/modules/4.3.2-gentoo/net/wireless/wl.kolicense:        MIXED/Proprietaryalias:          pci:v*d*sv*sd*bc02sc80i*depends:        cfg80211vermagic:       4.3.2-gentoo SMP mod_unload parm:           passivemode:intparm:           wl_txq_thresh:intparm:           oneonly:intparm:           piomode:intparm:           instance_base:intparm:           nompc:intparm:           intf_name:string

BCM4312需要另外安装broadcom驱动

emerge -av broadcom-sta

Wireless-N 7260 需要安装ucode

iwl7260-ucode

安装iw, libnl

emerge -pv iw libnlCalculating dependencies... done![ebuild   R    ] dev-libs/libnl-3.2.27:3::gentoo  USE="-python -static-libs -utils" ABI_X86="(64) -32 (-x32)" PYTHON_TARGETS="python2_7 python3_4 -python3_3" 0 KiB[ebuild   R    ] net-wireless/iw-4.3::gentoo  0 KiB

安装wpa_supplicant,deconfig配置

CONFIG_DRIVER_NL80211=y

iw info

# iw phyWiphy phy0max # scan SSIDs: 20max scan IEs length: 439 bytesmax # sched scan SSIDs: 20max # match sets: 11Retry short limit: 7Retry long limit: 4Coverage class: 0 (up to 0m)Device supports RSN-IBSS.Device supports AP-side u-APSD.Supported Ciphers:* WEP40 (00-0f-ac:1)* WEP104 (00-0f-ac:5)* TKIP (00-0f-ac:2)* CCMP (00-0f-ac:4)* CMAC (00-0f-ac:6)* WPI-SMS4 (00-14-72:1)Available Antennas: TX 0 RX 0...


设置为Monitor模式(mac80211)

 

$iw dev wlan0 interface add mon0 type monitor<pre class="plain" name="code">$iw mon0 infoInterface mon0        ifindex 4        wdev 0x2        addr 11:11:11:11:11:11        type monitor        wiphy 0        channel 11 (2462 MHz), width: 20 MHz (no HT), center1: 2462 MHz

broadcom driver设置为Monitor模式

ifconfig wlan0 downecho 1 > /proc/brcm_monitor0ifconfig prism0 up








0 0