笔记本电脑:HP Spectre X360 15-bl001na
Ubuntu 22.04 没有看到任何 wifi 网络,然后我用下面的命令检查,看到“DISABLED”。
我怎样才能启用该接口?
$ sudo lshw -class network
*-network DISABLED
description: Ethernet interface
product: Wireless 8265 / 8275
vendor: Intel Corporation
physical id: 0
bus info: pci@0000:3b:00.0
logical name: wlp59s0
version: 78
serial: 00:28:f8:3d:dd:58
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress bus_master cap_list ethernet physical
configuration: broadcast=yes driver=iwlwifi driverversion=5.15.0-40-generic firmware=36.ca7b901d.0 8265-36.ucode latency=0 link=no multicast=yes
resources: irq:149 memory:dd300000-dd301fff
*-network
description: Ethernet interface
physical id: 11
bus info: usb@4:1
logical name: enx00e04c689b6e
serial: 00:e0:4c:68:9b:6e
size: 1Gbit/s
capacity: 1Gbit/s
capabilities: ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8152 driverversion=v1.12.12 duplex=full firmware=rtl8153a-4 v2 02/07/20 ip=192.168.10.112 link=yes multicast=yes port=MII speed=1Gbit/s
和 的结果sudo ifconfig eth0 up
如下ifconfig -a
:
$ sudo ifconfig eth0 up
eth0: ERROR while getting interface flags: No such device
$ ifconfig -a
enx00e04c689b6e: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.112 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 fdee:569e:153:1:26c:b654:dd91:80a6 prefixlen 64 scopeid 0x0<global>
inet6 fe80::bc95:8997:9cc1:46d9 prefixlen 64 scopeid 0x20<link>
inet6 fdee:569e:153:1:cc97:9d2b:2679:afc5 prefixlen 64 scopeid 0x0<global>
ether 00:e0:4c:68:9b:6e txqueuelen 1000 (Ethernet)
RX packets 8360 bytes 6322125 (6.3 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 5815 bytes 986862 (986.8 KB)
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 889 bytes 87942 (87.9 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 889 bytes 87942 (87.9 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp59s0: flags=4098<BROADCAST,MULTICAST> mtu 1500
ether 00:28:f8:3d:dd:58 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
结果为frkill
:
$ rfkill list all
1: phy0: Wireless LAN
Soft blocked: no
Hard blocked: no
2: hci0: Bluetooth
Soft blocked: yes
Hard blocked: no
这是的内容/etc/network/interfaces
:
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
我还可以补充一点,在 Ubuntu 配置面板中,WiFi 当然是启用的,但“可见网络”却一直在旋转 截屏
还添加有关 iwlwifi 模块的信息:
$ sudo dmesg | grep iwl
[ 5.807156] Loading modules backported from iwlwifi
[ 5.807160] iwlwifi-stack-public:master:9858:4c7cba27
[ 5.931364] iwlwifi 0000:3b:00.0: enabling device (0000 -> 0002)
[ 5.945970] iwlwifi 0000:3b:00.0: loaded firmware version 36.ca7b901d.0 8265-36.ucode op_mode iwlmvm
[ 6.040276] iwlwifi 0000:3b:00.0: Detected Intel(R) Dual Band Wireless AC 8265, REV=0x230
[ 6.111727] iwlwifi 0000:3b:00.0: base HW address: 00:28:f8:3d:dd:58, OTP minor version: 0x0
[ 6.187327] ieee80211 phy0: Selected rate control algorithm 'iwl-mvm-rs'
[ 6.939593] iwlwifi 0000:3b:00.0 wlp59s0: renamed from wlan0
[ 8.244186] iwlwifi 0000:3b:00.0: mac start retry 0
[ 8.491711] iwlwifi 0000:3b:00.0: mac start retry 1
[ 8.734390] iwlwifi 0000:3b:00.0: mac start retry 2
[ 8.997580] iwlwifi 0000:3b:00.0: mac start retry 0
[ 9.246283] iwlwifi 0000:3b:00.0: mac start retry 1
[ 9.485438] iwlwifi 0000:3b:00.0: mac start retry 2
[ 9.734349] iwlwifi 0000:3b:00.0: mac start retry 0
[ 9.970349] iwlwifi 0000:3b:00.0: mac start retry 1
...
答案1
同样的问题。我发现我移动了一些硬件,特别是 LSI 磁盘控制器。这个看似无关的良性行为导致我的网卡地址发生变化!
要解决此问题,只需编辑自动生成的 netplan 文件
sudo /etc/netplan/00-installer-config.yaml
cat /etc/netplan/00-installer-config.yaml
# This is the network config written by 'subiquity'
network:
ethernets:
enp6s0:
dhcp4: true
version: 2
ifconfig
包括、等在内的许多工具ip a
都会向您显示正确的接口 ID。在我的示例中,接口 ID 已从 enp5s0 更改为 enp6s0。
希望这可以帮助!