CentOS 7:无法使用 wpa_supplicant 连接 wifi

CentOS 7:无法使用 wpa_supplicant 连接 wifi

我最近买了一张新的无线卡,特别是英特尔双频无线-AC 7260 WiFi 蓝牙半迷你卡。之前我一直用以太网连接,所以这台机器从来没有连接过wifi。

我尝试使用nmcli来让事情正常工作,但没有成功,所以我又转而尝试使用wpa_supplicant.

首先,我确保我的界面与ifconfig wlp3s0 up.接下来,我尝试扫描我的无线接入点,iwlist wlp3s0 scanning返回结果:

wlp3s0    Scan completed :
          Cell 01 - Address: 94:10:3E:70:60:FE
                    Channel:36
                    Frequency:5.18 GHz (Channel 36)
                    Quality=25/70  Signal level=-85 dBm
                    Encryption key:on
                    ESSID:"Foobar"
                    Bit Rates:6 Mb/s; 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s
                              36 Mb/s; 48 Mb/s; 54 Mb/s
                    Mode:Master
                    Extra:tsf=0000000011eb802d
                    Extra: Last beacon: 2005ms ago
                    IE: Unknown: 0006466F6F626172
                    IE: Unknown: 01088C129824B048606C
                    IE: Unknown: 050400030000
                    IE: Unknown: 0706555320010B1E
                    IE: Unknown: 2D1A6F181FFFFF000000000000000000000000000000000000000000
                    IE: Unknown: 3D1624050000000000000000000000000000000000000000
                    IE: Unknown: 7F080000000000000040
                    IE: Unknown: BF0C3120C103FAFF0C03FAFF0C03
                    IE: Unknown: C005012A00F0FF
                    IE: IEEE 802.11i/WPA2 Version 1
                        Group Cipher : CCMP
                        Pairwise Ciphers (1) : CCMP
                        Authentication Suites (1) : PSK
                    IE: Unknown: DD180050F2020101000003A4000027A4000042435E0062322F00
                    IE: Unknown: DD1E00904C336F181FFFFF000000000000000000000000000000000000000000
                    IE: Unknown: DD1A00904C3424050000000000000000000000000000000000000000
                    IE: Unknown: DD0700E04C02026004

我已经wpa_supplicant.conf这样设置我的文件:

ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

# reading passphrase from stdin
network={
    ssid="Foobar"
    #psk="my-pass-phrase"
    psk=af865233abdc002e9181256fdbc34b81fa956fcf28ac33fd0ec92e25241eb6f3
    key_mgmt=WPA-PSK
        proto=WPA RSN
        pairwise=CCMP
    group=CCMP

我尝试运行 wpa_supplicant ,wpa_supplicant -B -Dnl80211 -iwlp3s0 -c/etc/wpa_supplicant/wpa_supplicant.conf它只是返回Successfully initialized wpa_supplicant

dmesg 的输出返回:

[ 1867.954640] wlp3s0: authenticate with 94:10:3e:70:60:fe
[ 1867.957296] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 1/3)
[ 1868.159030] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 2/3)
[ 1868.361207] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 3/3)
[ 1868.562248] wlp3s0: authentication with 94:10:3e:70:60:fe timed out
[ 1882.404522] wlp3s0: authenticate with 94:10:3e:70:60:fe
[ 1882.407019] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 1/3)
[ 1882.608645] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 2/3)
[ 1882.810806] wlp3s0: direct probe to 94:10:3e:70:60:fe (try 3/3)
[ 1883.011897] wlp3s0: authentication with 94:10:3e:70:60:fe timed out

有什么想法为什么我无法连接吗?

答案1

使用 wpa 请求者初始化后,您需要使用 DHCP 客户端来请求 IP 地址,例如

dhclient wlp0... //replace with your interface name

答案2

我自己使用Centos7,我可以使用以下命令连接到wifi

 $ nmcli dev wifi list
 *  SSID                      MODE   CHAN  DÉBIT    SIGNAL  BARS  SÉCURITÉ    
    Livebox-3WYX              Infra  1     54 Mo/s  65      ▂▄▆_  WPA2  
 ...       

然后

 $ nmcli --ask dev wifi connect Livebox-3WYX
 Mot de passe : ...
 Périphérique « wlo1 » activé avec « 9c234370-5a39-468d-9b62-202cbc56e9fe ».

使用 nmcli 连接 SSID 时遇到什么错误/问题?

相关内容