gentoo浣跨敤wpa_supplicant閰嶇疆鏃犵嚎缃戝崱

鍓嶈█

鍏徃鍏ㄩ儴浣跨敤浜嗘棤绾跨綉缁滐紝鎴戜篃琚€橀€尖€欑殑寮€濮嬬爺绌秅entoo鐨勬棤绾夸笂缃戯紝鐪嬩簡缃戜笂寰堝鏂囩珷锛屼互鍙奼entoo鏂囨。锛屼絾鏄劅瑙夐兘璁╂垜寰堣糠绯婏紝浠ヤ笅鏄垜浣跨敤wpa_supplicant鏄竴浜涙€荤粨
####鎬荤粨

  • 鏌ョ湅鏈満鐨勬棤绾跨綉鍗�
emerge pciutils #杩欐牱灏辨湁浜唋spci杩欎釜鍛戒护  
localhost ~ # lspci |grep -i wire  
02:00.0 Network controller: Atheros Communications Inc. AR9285 Wireless Network Adapter (PCI-Express) (rev 01)  

鍙互鍙戠幇锛岀綉鍗℃槸Atheros鐨凙R9285

  • 瀹夎wpa_supplicant
emerge -s wpa_supplicant  
  • 鐢熸垚涓€涓厤缃厤缃枃浠�
zcat /usr/share/doc/wpa_supplicant-2.0/wpa_supplicant.conf.bz2 > /etc/wpa_supplicant/wpa_supplicant.conf  
  • 閰嶇疆锛屼互涓嬫槸鎴戝幓鎺夋敞閲婅锛岀┖鐧借绛夊墿涓嬬殑閰嶇疆锛屽叾涓殑psk鐨勫瓧绗︿覆杩欐牱鐢熸垚锛�
localhost ~ # wpa_passphrase 鎴戠殑ssid 鎴戠殑key  
network={  
    ssid=鈥濇垜鐨剆sid鈥�  
    #psk=鈥濇垜鐨刱ey鈥�  
    psk=e596aa911775ed47e04f5b9a9540978203210874eb258208b87cf82b5cf72588  
}  

鎶婅繖娈靛姞鍦ㄩ厤缃枃浠朵腑

localhost ~ # cat /etc/wpa_supplicant.conf  

ctrl_interface=/var/run/wpa_supplicant  
eapol_version=1  
ap_scan=1  
fast_reauth=1  
network={  
    ssid=鈥濇垜鐨剆sid鈥�  
    psk=e596aa911775ed47e04f5b9a9540978203210874eb258208b87cf82b5cf72588  
    priority=2  
}  
  • 鍛戒护琛屽惎鍔╳pa(濡傛灉鎯崇湅璇︾粏鐨勪俊鎭敤浜庤皟璇曪紝鍔�-d閫夐」)
localhost ~ # wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf  
Successfully initialized wpa_supplicant  
wlan0: Trying to associate with 20:dc:c6:61:ab:34 (SSID=鈥欐垜鐨剆sid鈥� freq=2437 MHz)  
ioctl[SIOCSIWFREQ]: Device or resource busy  
wlan0: Association request to the driver failed  
wlan0: Associated with 20:dc:c6:61:ab:34  
wlan0: WPA: Key negotiation completed with 20:dc:c6:61:ab:34 [PTK=CCMP GTK=CCMP]  
wlan0: CTRL-EVENT-CONNECTED - Connection to 20:dc:c6:61:ab:34 completed [id=0 id_str=]  

鍏朵腑wlan0: Association request to the driver failed 娌″叧绯�

  • 瀹夎udhcpc
emerge udhcpc  
  • 閫氳繃dhcp鑷姩鑾峰緱
localhost ~ # dhcpcd wlan0  
dhcpcd[12395]: version 5.6.4 starting  
dhcpcd[12395]: wlan0: waiting for carrier  
dhcpcd[12395]: wlan0: carrier acquired  
dhcpcd[12395]: wlan0: carrier lost  
dhcpcd[12395]: wlan0: waiting for carrier  
dhcpcd[12395]: wlan0: carrier acquired  
dhcpcd[12395]: wlan0: sending IPv6 Router Solicitation  
dhcpcd[12395]: wlan0: sendmsg: Cannot assign requested address  
dhcpcd[12395]: wlan0: rebinding lease of 192.168.0.106  
dhcpcd[12395]: wlan0: acknowledged 192.168.0.106 from 192.168.0.1 `锟解€�  
dhcpcd[12395]: wlan0: checking for 192.168.0.106  
dhcpcd[12395]: wlan0: sending IPv6 Router Solicitation  
dhcpcd[12395]: wlan0: leased 192.168.0.106 for 7200 seconds  
dhcpcd[12462]: wlan0: wlan0: MTU set to 576  
dhcpcd[12395]: forked to background, child pid 12479  

鐪嬪埌浜嗗惂 鑾峰緱浜�192.168.0.106杩欎釜鍦板潃

鐗堟潈澹版槑锛氭湰鏂囩敱 钁d紵鏄� 鍘熷垱锛屾湭缁忎綔鑰呮巿鏉冪姝换浣曞井淇″叕浼楀彿鍜屽悜鎺橀噾(juejin.im)杞浇锛孾鎶€鏈崥瀹㈣浆杞介噰鐢� 淇濈暀缃插悕-闈炲晢涓氭€т娇鐢�-绂佹婕旂粠 4.0-鍥介檯璁稿彲鍗忚](https://creativecommons.org/licenses/by-nc-nd/4.0/deed.zh)
杞浇璇蜂繚鐣欎互涓婂0鏄庝俊鎭紒