无线网络接口无法出现

无线网络接口无法出现

我的设备(操作系统 Ubuntu 20.04)的无线连接无法激活。

  • 这是之前的状态
    $ ip a sh dev wlp1s0
    
     4: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
        link/ether b8:b7:f1:c0:4a:05 brd ff:ff:ff:ff:ff:ff
    
  • 然后我提出来
    $ sudo ifconfig wlp1s0 up
    
  • 当我再次检查时,没有任何变化......
    $ ip a sh dev wlp1s0
    
     4: wlp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
        link/ether b8:b7:f1:c0:4a:05 brd ff:ff:ff:ff:ff:ff
    
  • 这是网络规划配置:
    $ cat /etc/netplan/01-wifi.yaml
    
     renderer: networkd
     ethernets:
         enp1s0:
             dhcp4: true
         enp2s0:
             dhcp4: true
     version: 2
     wifis:
         wlp1s0:
             optional: true
             access-points:
                 "abc":
                     password: "xyz"
             dhcp4: true
    
  • 这是来自的回应ifconfig
    enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.111.140.246  netmask 255.255.255.0  broadcast 10.111.140.255
            inet6 fe80::4e38:d5ff:fe11:746e  prefixlen 64  scopeid 0x20<link>
            ether 4c:38:d5:11:74:6e  txqueuelen 1000  (Ethernet)
            RX packets 109968  bytes 126944297 (126.9 MB)
            RX errors 0  dropped 4233  overruns 0  frame 0
            TX packets 61725  bytes 8701147 (8.7 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
            inet 127.0.0.1  netmask 255.0.0.0
            inet6 ::1  prefixlen 128  scopeid 0x10<host>
            loop  txqueuelen 1000  (Local Loopback)
            RX packets 234239  bytes 26630063 (26.6 MB)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 234239  bytes 26630063 (26.6 MB)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    
    wlp1s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
            ether b8:b7:f1:c0:4a:05  txqueuelen 1000  (Ethernet)
            RX packets 0  bytes 0 (0.0 B)
            RX errors 0  dropped 0  overruns 0  frame 0
            TX packets 0  bytes 0 (0.0 B)
            TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

我怎样才能连接无线网络?

答案1

的输出ifconfig清楚地表明wlp1s0up。如果sudo ifconfig wlp1s0 up失败,您将收到通知,无法引发此特定接口。ifconfig [dev] up其本身不负责在引发特定接口后建立连接。

  1. 您需要确保已wpa-supplicant安装才能使用 WPA2 进行身份验证。你可以通过sudo apt install wpa-supplicant

  2. 该文件01-wifi.yaml不是有效的配置文件。为了实现此配置,您需要执行文件sudo netplan generate中的设置,以便为所选渲染器(即您的情况)*.yaml重新生成。networkd

  3. 最后,生成配置后,您需要应用它sudo netplan apply

相关内容