安装与配置wpa_supplicant无线网络链接工具

Posted renren-study-notes

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了安装与配置wpa_supplicant无线网络链接工具相关的知识,希望对你有一定的参考价值。

1.安装wireless

2.安装pciutils,运行命令查看无线网络设备硬件的名字

lspci

3.解压在编译lfs过程中用过的linux内核包,进入linux内核包按照lfs的linux内核编译方法编译内核加入以下配置

[*] Networking support  --->                              [CONFIG_NET]
  [*] Wireless  --->                                      [CONFIG_WIRELESS]
    <*/M> cfg80211 - wireless configuration API           [CONFIG_CFG80211]
    [*]     cfg80211 wireless extensions compatibility    [CONFIG_CFG80211_WEXT]
    <*/M> Generic IEEE 802.11 Networking Stack (mac80211) [CONFIG_MAC80211]
Device Drivers  --->
  [*] Network device support  --->                        [CONFIG_NETDEVICES]
    [*] Wireless LAN  --->                                [CONFIG_WLAN]
<*/M>一定要在所选择的项目上面打上m
我的机器是intel7625的无线网卡设备,wireless LAN下没有这个型号,查询manjaro给无线网卡加载的是哪个模块,所以选择了iwlwifi的两个模块
Device Drivers  --->
 
        [*] Network device support  --->
 
        --- Network device support
        [*]   Wireless LAN  --->
 
            --- Wireless LAN
            [ ]   ADMtek devices
            [ ]   Atheros/Qualcomm devices
            [ ]   Atmel devices
            [ ]   Broadcom devices
            [ ]   Cisco devices
            [*]   Intel devices
            < >     Intel PRO/Wireless 2100 Network Connection
            < >     Intel PRO/Wireless 2200BG and 2915ABG Network Connection
            < >     Intel Wireless WiFi 4965AGN (iwl4965)
            < >     Intel PRO/Wireless 3945ABG/BG Network Connection (iwl3945)
            <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
            [ ]       Enable broadcast filtering (NEW)
            [ ]       Enable runtime power management mode for PCIe devices (NEW)
                      Debugging Options  --->
            [ ]   Intersil devices
            [ ]   Marvell devices
            [ ]   MediaTek devices
            [ ]   Ralink devices
            [ ]   Realtek devices
            [ ]   Redpine Signals Inc devices
            [ ]   STMicroelectronics devices
            [ ]   Texas Instrument devices
            [ ]   ZyDAS devices
            < >   Simulated radio testing tool for mac80211
            < >   Wireless RNDIS USB support

安装推荐依赖

libnl-3.4.0

libnl下载地址:http://mirror.fileplanet.com/lfs/pub/blfs/8.3/l/libnl-3.4.0.tar.gz

 

libnl-doc下载地址: http://mirror.fileplanet.com/lfs/pub/blfs/8.3/l/libnl-doc-3.4.0.tar.gz

暂不考虑安装桌面网络配置,运行安装命令行wifi链接工具

cat > wpa_supplicant/.config << "EOF"
CONFIG_BACKEND=file
CONFIG_CTRL_IFACE=y
CONFIG_DEBUG_FILE=y
CONFIG_DEBUG_SYSLOG=y
CONFIG_DEBUG_SYSLOG_FACILITY=LOG_DAEMON
CONFIG_DRIVER_NL80211=y
CONFIG_DRIVER_WEXT=y
CONFIG_DRIVER_WIRED=y
CONFIG_EAP_GTC=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_TLS=y
CONFIG_EAP_TTLS=y
CONFIG_IEEE8021X_EAPOL=y
CONFIG_IPV6=y
CONFIG_LIBNL32=y
CONFIG_PEERKEY=y
CONFIG_PKCS12=y
CONFIG_READLINE=y
CONFIG_SMARTCARD=y
CONFIG_WPS=y
CFLAGS += -I/usr/include/libnl3
EOF
patch -p1 -i ../wpa_supplicant-2.6-upstream_fixes-2.patch &&
cd wpa_supplicant                                         &&
make BINDIR=/sbin LIBDIR=/lib
install -v -m755 wpa_{cli,passphrase,supplicant} /sbin/ &&
install -v -m644 doc/docbook/wpa_supplicant.conf.5 /usr/share/man/man5/ &&
install -v -m644 doc/docbook/wpa_{cli,passphrase,supplicant}.8 /usr/share/man/man8/

设置wpa

wpa_passphrase SSID SECRET_PASSWORD > /etc/sysconfig/wpa_supplicant-wifi0.conf

安装引导blfs-bootscripts-20180105脚本

make install-service-wpa

为dhcpcd创建


cat > /etc/sysconfig/ifconfig.wifi0 << "EOF"
ONBOOT="yes"
IFACE="wlan0"
SERVICE="wpa"

# Additional arguments to wpa_supplicant
WPA_ARGS=""

WPA_SERVICE="dhcpcd"
DHCP_START="-b -q <insert appropriate start options here>"
DHCP_STOP="-k <insert additional stop options here>"
EOF

链接无线接入点

ifup wifi0

 重启后会出现如下提示:

技术分享图片

显示需要iwlwifi-7265D-22和29固件,去lfs的固件网站下载,放到/lib/firmware/目录下,重启机器就可以看到无线网卡模块已经自动加载了。

lfs的固件下载网站:http://anduin.linuxfromscratch.org/BLFS/linux-firmware/


以上是关于安装与配置wpa_supplicant无线网络链接工具的主要内容,如果未能解决你的问题,请参考以下文章

树莓派配置wifi链接

linux 无线网络配置工具wpa_supplicant与wireless-tools

centos6.5配置无线网络

gentoo下的wpa_supplicant无线配置

gentoo下的wpa_supplicant无线配置

树莓派中用Python配置WIFI账号密码