查看无线网卡设备名称

iwconfig

$ iwconfig

lo        no wireless extensions.

enp3s0    no wireless extensions.

wlp1s0    IEEE 802.11  ESSID:off/any
          Mode:Managed  Access Point: Not-Associated   Tx-Power=20 dBm
          Retry short limit:7   RTS thr=2347 B   Fragment thr:off
          Encryption key:off
          Power Management:off

建立Wifi密码配置文件

$ mkdir -p /etc/wpa_supplicant
$ wpa_passphrase NET-WIFI  wifi0988 | tee  /etc/wpa_supplicant/wap_supplicant.conf

network={
    ssid="NET-WIFI"
    #psk="wifi0988"
    psk=a5285ee353231742c48f8977b3434f66cdc29ed34af2f23d82e54afd50bf1dd4
}

interfaces 文件添加无线配置

vim /etc/network/interfaces

auto  wlp1s0
iface wlp1s0 inet dhcp
wpa-conf /etc/wpa_supplicant/wap_supplicant.conf

加载无线网卡名称 wlp1s0

ifdown wlp1s0 && ifup wlp1s0

$ ifdown wlp1s0 && ifup wlp1s0

Killed old client process
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlp1s0/00:e0:4c:91:b8:49
Sending on   LPF/wlp1s0/00:e0:4c:91:b8:49
Sending on   Socket/fallback
DHCPRELEASE of 192.168.0.187 on wlp1s0 to 192.168.0.1 port 67
Internet Systems Consortium DHCP Client 4.4.1
Copyright 2004-2018 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/

Listening on LPF/wlp1s0/00:e0:4c:91:b8:49
Sending on   LPF/wlp1s0/00:e0:4c:91:b8:49
Sending on   Socket/fallback
DHCPDISCOVER on wlp1s0 to 255.255.255.255 port 67 interval 8

DHCPOFFER of 192.168.0.187 from 192.168.0.1
DHCPREQUEST for 192.168.0.187 on wlp1s0 to 255.255.255.255 port 67
DHCPACK of 192.168.0.187 from 192.168.0.1
bound to 192.168.0.187 -- renewal in 43088 seconds.

$ ip a

3: wlp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 00:e0:4c:91:b8:49 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.187/24 brd 192.168.0.255 scope global dynamic wlp1s0
       valid_lft 86384sec preferred_lft 86384sec
    inet6 fe80::2e0:4cff:fe91:b849/64 scope link
       valid_lft forever preferred_lft forever

0 条评论

发表回复

Avatar placeholder

您的邮箱地址不会被公开。 必填项已用 * 标注