美文网首页
linux无线网卡连接网络

linux无线网卡连接网络

作者: 望山不是山 | 来源:发表于2019-01-05 21:38 被阅读0次

    涉及命令

    命令 说明
    ifconfig eth0 up/down 网卡的启用/禁用
    service network restart 重新启动网卡。如果刚插上网卡需要重启获取ip
    dhclient eth0 自动分配ip
    wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant.conf -B 启动wpa server

    正文

    1. 启动wpa_supplicant服务
    wpa_supplicant -Dwext -iwlan0 -c /etc/wpa_supplicant.conf -B
    
    1. 启动wpa_cli
    > scan
    OK
    <3>CTRL-EVENT-SCAN-RESULTS <wbr>
    > scan_result
    bssid / frequency / signal level / flags / ssid
    6c:59:40:ec:7d:b4 <wbr> <wbr> <wbr> <wbr>2422 <wbr> <wbr>-66 <wbr> <wbr> <wbr> <wbr>[WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] <wbr> <wbr> <wbr> <wbr>[lizhiyong](http://www.uplooking.club/)
    50:fa:84:25:9b:72 <wbr> <wbr> <wbr> <wbr>2472 <wbr> <wbr>-82 <wbr> <wbr> <wbr> <wbr>[WPA-PSK-CCMP][WPA2-PSK-CCMP][ESS] <wbr> <wbr> <wbr> <wbr>\xe4\xbd\xa0\xe6\x98\xaf\xe8\x83\x86\xe5\xb0\x8f\xe9\xac\xbc
    > add_net <wbr>
    1
    > set_net 1 ssid "lizhiyong"
    OK
    > set_net 1 psk "[lzylgq12345678](http://www.uplooking.club/)​"
    OK
    > select_net 1
    OK
    > enable_net 1
    OK
    > q
    
    1. dhcpcd wlan0或dhclient wlan0
    2. 开机自动连接wifi
    [root@linux:~] vi /etc/wpa_supplicant.conf
    ctrl_interface=/var/run/wpa_supplicant
    update_config=1
    
    network={
            ssid="lizhiyong"
            psk="lzylgq12345678"
    } 
    
    [root@linux:~] vi /etc/init.d/rcS
    ifconfig wlan0 up
    /usr/sbin/wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf -B
    dhcpcd wlan0 
    [root@linux:~] chkconfig --add rcS
    [root@linux:~] chkconfig rcS on
    

    相关文章

      网友评论

          本文标题:linux无线网卡连接网络

          本文链接:https://www.haomeiwen.com/subject/dpwdrqtx.html