无线接口不工作

无线接口不工作

我无法连接 Wi-Fi 网络。网络之前一直运行良好,但最近突然停止工作。我尝试重新启动计算机和路由器,但问题仍然存在。

我运行了 lshw -class network 命令,输出如下:

*-generic DISABLED

description: Wireless interface
product: RTL8821CE 802.11ac PCIe Wireless Network Adapter
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: wlo1
version: ff
serial: d4:1b:81:a3:c4:85
width: 32 bits
clock: 66MHz
capabilities: bus_master vga_palette cap_list ethernet physical wireless
configuration: broadcast=yes driver=rtw_8821ce driverversion=6.2.0-26-generic firmware=N/A latency=255 link=no maxlatency=255 mingnt=255 multicast=yes wireless=IEEE 802.11
resources: irq:151 ioport:3000(size=256) memory:84000000-8400ffff
*-network
description: Ethernet interface
physical id: 11
bus info: usb@1:1
logical name: enx160bf7e81578
serial: 16:0b:f7:e8:15:78
capabilities: ethernet physical
configuration: autonegotiation=off broadcast=yes driver=rndis_host driverversion=6.2.0-26-generic duplex=half firmware=RNDIS device ip=192.168.117.141 link=yes multicast=yes port=twisted pair

I am not sure what else to do to troubleshoot this problem. Any help would be greatly appreciated.

答案1

根据您提供的信息,您的 wifi 链接似乎已被禁用。

以下是一些用于排除一般网络问题的基本命令。每个命令都有一个手册页,大多数命令都带有丰富的选项开关。抱歉,但我硬连线到网络,因此代码片段显示以太网链接结果而不是 wifi。但过程是相同的。对于 DHCP(未分配固定 IP 地址),您需要能够访问 wifi 路由器、以太网路由器或交换机。在您的情况下,ping 路由器的 IP 地址可能不起作用,因此您的特定问题非常简单。

ip [命令]

frankie@ubuntu-m8h:~$ip link

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 70:4d:7b:2d:77:94 brd ff:ff:ff:ff:ff:ff
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1441 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 500
    link/none 

需要检查的事项:链接是否正常并且具有十六进制 MAC 地址。如果无线链接根本没有列出,则可能是硬件或驱动程序存在问题。

frankie@ubuntu-m8h:~$ip a

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 70:4d:7b:2d:77:94 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.15/24 brd 192.168.0.255 scope global dynamic noprefixroute enp0s31f6
       valid_lft 2063sec preferred_lft 2063sec
    inet6 fe80::effd:9dde:6ef8:ad83/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
5: tun0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1441 qdisc fq_codel state UNKNOWN group default qlen 500
    link/none 
    inet 10.11.18.146/24 scope global tun0
       valid_lft forever preferred_lft forever
    inet6 fe80::7cdb:3f07:2ad0:f7c0/64 scope link stable-privacy 
       valid_lft forever preferred_lft forever

需要注意的事项:所讨论的链接是否分配有 IP 地址。如果没有,则可能是网络层问题。

nmcli [命令] [参数]

frankie@ubuntu-m8h:~$nmcli device status

DEVICE     TYPE      STATE                   CONNECTION    
enp0s31f6  ethernet  connected               Auto Ethernet 
tun0       tun       connected (externally)  tun0          
lo         loopback  unmanaged               --            

frankie@ubuntu-m8h:~$ping localhost

PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.032 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.032 ms
64 bytes from localhost (127.0.0.1): icmp_seq=4 ttl=64 time=0.028 ms
^C
--- localhost ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3062ms
rtt min/avg/max/mdev = 0.028/0.032/0.038/0.003 ms

如果 Ubuntu 根本检测不到您的 Wi-Fi 网络,或者您收到错误,那么您可以尝试从 Ubuntu ISO 文件安装或重新安装 Wi-Fi 驱动程序。此论坛上有足够的信息来了解如何执行此操作。

lsusb或者lspci取决于您安装了哪种 wifi 设备。

frankie@ubuntu-m8h:~$sudo lspci

00:00.0 Host bridge: Intel Corporation Xeon E3-1200 v5/E3-1500 v5/6th Gen Core Processor Host Bridge/DRAM Registers (rev 07)
00:02.0 VGA compatible controller: Intel Corporation HD Graphics 530 (rev 06)
00:14.0 USB controller: Intel Corporation 100 Series/C230 Series Chipset Family USB 3.0 xHCI Controller (rev 31)
00:16.0 Communication controller: Intel Corporation 100 Series/C230 Series Chipset Family MEI Controller #1 (rev 31)
00:17.0 SATA controller: Intel Corporation Q170/Q150/B150/H170/H110/Z170/CM236 Chipset SATA Controller [AHCI Mode] (rev 31)
00:1b.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #17 (rev f1)
00:1b.3 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #20 (rev f1)
00:1c.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #1 (rev f1)
00:1d.0 PCI bridge: Intel Corporation 100 Series/C230 Series Chipset Family PCI Express Root Port #9 (rev f1)
00:1f.0 ISA bridge: Intel Corporation Z170 Chipset LPC/eSPI Controller (rev 31)
00:1f.2 Memory controller: Intel Corporation 100 Series/C230 Series Chipset Family Power Management Controller (rev 31)
00:1f.3 Audio device: Intel Corporation 100 Series/C230 Series Chipset Family HD Audio Controller (rev 31)
00:1f.4 SMBus: Intel Corporation 100 Series/C230 Series Chipset Family SMBus (rev 31)
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (2) I219-V (rev 31)
02:00.0 SATA controller: ASMedia Technology Inc. ASM1062 Serial ATA Controller (rev 02)
03:00.0 USB controller: ASMedia Technology Inc. ASM1142 USB 3.1 Host Controller

frankie@ubuntu-m8h:~$sudo lshw -C network

*-network                 
       description: Ethernet interface
       product: Ethernet Connection (2) I219-V
       vendor: Intel Corporation
       physical id: 1f.6
       bus info: pci@0000:00:1f.6
       logical name: enp0s31f6
       version: 31
       serial: 70:4d:7b:2d:77:94
       size: 1Gbit/s
       capacity: 1Gbit/s
       width: 32 bits
       clock: 33MHz
       capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=5.15.0-82-generic duplex=full firmware=0.7-4 ip=192.168.0.15 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
       resources: irq:126 memory:df200000-df21ffff

根据 lsusb 或 lspci 命令的结果,这将确认(或不确认)Ubuntu 是否可以看到无线设备。如果是这样,您可以假设固件正在运行,但系统不知道如何与设备通信。这就是需要驱动程序或模块的地方。

sudo lsmod

列出现有的模块。要激活模块,请键入以下命令,其中“modulename”是芯片组的名称。

sudo modprobe modulename

在你的情况下,模块名称应该类似于 RTL8821CE

sudo service network-manager restart

重新启动网络服务。如果您意外删除或卸载了网络管理器,此命令将失败。如果是这样,您将无法使用 Internet 和网络管理器。

sudo apt install network-manager

如果以上方法均不起作用,您可能需要编辑配置文件。

sudo gedit /etc/network/interfaces

它看起来应该是这样的:

auto lo
iface lo inet loopback
 
auto wlan0
iface wlan0 inet dhcp

然后重新启动界面(使用您设备的链接名称):

sudo ifdown wlan0 && sudo ifup -v wlan0

相关内容