我有一台安装了 Ubuntu 18.04 Desktop 的笔记本电脑。该系统渴望配置和操作 WiFi,但我需要有线连接,因为与 1000BASE-T 以太网相比,我的适配器速度较慢。
以太网电缆已插入,但我在桌面上看不到如何配置有线。关闭 WiFi 后,出现“?” 音量控制旁边。单击此处显示与以太网连接无关。
另一方面,如果我手动启动界面,网络工作正常:
% sudo ifup enp5s0f1
Internet Systems Consortium DHCP Client 4.3.5
Copyright 2004-2016 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/enp5s0f1/78:24:af:ca:08:74
Sending on LPF/enp5s0f1/78:24:af:ca:08:74
Sending on Socket/fallback
DHCPDISCOVER on enp5s0f1 to 255.255.255.255 port 67 interval 3 (xid=0x637da107)
DHCPDISCOVER on enp5s0f1 to 255.255.255.255 port 67 interval 5 (xid=0x637da107)
DHCPREQUEST of 192.168.1.24 on enp5s0f1 to 255.255.255.255 port 67 (xid=0x7a17d63)
DHCPOFFER of 192.168.1.24 from 192.168.1.1
DHCPACK of 192.168.1.24 from 192.168.1.1
bound to 192.168.1.24 -- renewal in 41444 seconds.
ssh、ftp、web 浏览器...正常工作。
我添加了以下要求的信息:
% sudo lshw -C 网络 *-网络已禁用 描述:无线接口 产品:AR9462无线网络适配器 供应商:高通创锐讯 物理ID:0 总线信息:pci@0000:04:00.0 逻辑名称:wlp4s0 版本:01 序列号:40:e2:30:ae:5b:17 宽度:64 位 时钟:33MHz 功能:pm msi pciexpress bus_master cap_list rom 以太网物理无线 配置:广播=是驱动程序=ath9k驱动程序版本=4.15.0-36-通用固件=不适用延迟=0链接=无多播=是无线 ss=IEEE 802.11 资源:irq:18 内存:f7900000-f797ffff 内存:f7980000-f798ffff *-网络已禁用 描述:以太网接口 产品:RTL8111/8168/8411 PCI Express千兆以太网控制器 供应商:瑞昱半导体有限公司 物理id:0.1 总线信息:pci@0000:05:00.1 逻辑名称:enp5s0f1 版本:12 序列号:78:24:af:ca:08:74 大小:1Gbit/s 容量:1Gbit/s 宽度:64 位 时钟:33MHz 功能: pm msi pciexpress msix vpd bus_master cap_list 以太网物理 tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000 bt-fd 自动协商 配置:自动协商=广播=是驱动程序=r8169驱动程序版本=2.3LK-NAPI双工=全延迟=0链接=无多播 =是端口=MII速度=1Gbit/s 资源:irq:19 ioport:d000(size=256) 内存:f7814000-f7814fff 内存:f7810000-f7813fff
在 syslog 中查找 NetworkManager:
/var/log/syslog.1:Oct 17 21:24:28 myhostname NetworkManager[802]: [1539825868.9200] bluez5: NAP: 删除接口 40:E2:30:AE:5B:16 /var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]:[1539825869.1167] 经理:睡眠:唤醒请求(睡眠:是启用:是) /var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]: [1539825869.1169] 设备 (wlp4s0): 状态变化: 非托管 -> 不可用 (原因 '托管', sys-iface-state: '管理') /var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]: [1539825869.1174] manager: NetworkManager 状态现在为 DISCONNECTED /var/log/syslog.1:Oct 17 21:24:29 myhostname NetworkManager[802]: [1539825869.7907] bluez5: NAP: 添加接口 40:E2:30:AE:5B:16 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.7085] NetworkManager(版本 1.10.6)正在启动...(第一次) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.7086] 读取配置:/etc/NetworkManager/NetworkManager.conf (lib: 10-dns-resolved.conf, 20-connectivity -ubuntu.conf,no-mac-addr-change.conf)(运行:10-globally-managed-devices.conf)(等:default-wifi-powersave-on.conf) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.7123] manager[0x55ae928e6060]: 监控内核固件目录'/lib/firmware'。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.7124] 监控 ifupdown 状态文件 '/run/network/ifstate'。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8188] 主机名:主机名:使用主机名 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8189] 主机名:主机名从(无)更改为“我的主机名” /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8192] dns-mgr[0x55ae92900140]:init:dns=systemd-resolved,rc-manager=symlink,plugin=systemd-解决 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8199] rfkill1: 找到 WiFi 无线电 killswitch (在 /sys/devices/pci0000:00/0000:00:1c.2/ 0000:04:00.0/ieee80211/phy0/rfkill1) (驱动程序 ath9k) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8200] manager[0x55ae928e6060]: rfkill: WiFi 硬件无线电设置已禁用 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8201] manager[0x55ae928e6060]:rfkill:WWAN 硬件无线电集已启用 /var/log/syslog.1:Oct 17 21:29:46 myhostname dbus-daemon[775]: [system] 通过 systemd 激活:service name='org.freedesktop.nm_dispatcher' unit='dbus-org.freedesktop。 ':1.14' 请求的 nm-dispatcher.service' (uid=0 pid=800 comm="/usr/sbin/NetworkManager --no-daemon " label="unconfined") /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8363] 初始化! /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8364] interface-parser: 解析文件 /etc/network/interfaces /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8364] interface-parser: 完成解析文件 /etc/network/interfaces /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8366] 猜测的连接类型 (enp5s0f1) = 802-3-ethernet /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8366] update_connection_setting_from_if_block: name:enp5s0f1, type:802-3-ethernet, id:Ifupdown (enp5s0f1), uuid: a4537f7b- 6324-fd3f-6489-f76bfb2af0dc /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8367] 将 enp5s0f1 添加到连接 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8367] 将 iface enp5s0f1 添加到 eni_ifaces /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8367] 管理模式:非托管 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8371] 设备添加(路径:/sys/devices/pci0000:00/0000:00:1c.2/0000:04 :00.0/net/wlp4s0, iface: wlp4s0) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8371] 设备添加(路径:/sys/devices/pci0000:00/0000:00:1c.2/0000:04 :00.0/net/wlp4s0, iface: wlp4s0): 没有找到 ifupdown 配置。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8371] 设备添加(路径:/sys/devices/pci0000:00/0000:00:1c.3/0000:05 :00.1/net/enp5s0f1, iface: enp5s0f1) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8372] 锁定有线连接设置 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8372] settings-connection[0x55ae928b2360,a4537f7b-6324-fd3f-6489-f76bfb2af0dc]:写入:更新连接失败:写入不支持的设置 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8372] 设备添加(路径:/sys/devices/virtual/net/lo,iface:lo) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8372] 设备添加(路径:/sys/devices/virtual/net/lo, iface: lo):找不到 ifupdown 配置. /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8372] end _init. /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8372] 设置:加载插件 ifupdown: (C) 2008 Canonical Ltd. 要报告错误,请使用 NetworkManager 邮件列表。(/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-settings-plugin-ifupdown.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8373] 设置:加载的插件密钥文件:(c) 2007 - 2016 Red Hat, Inc. 要报告错误,请使用 NetworkManager 邮件列表。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8373] (-1835934528) ... get_connections。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8373] (-1835934528) ... get_connections (managed=false): 返回空列表。 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8464] 密钥文件:新连接 /etc/NetworkManager/system-connections/有线连接 1 (823e4837-330a-3bf9-8be5- 6fc1f1fde418,"有线连接1") /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8543] 密钥文件:新连接 /etc/NetworkManager/system-connections/Necronomicon (b247a602-6c61-4875-af1e-58d0d88bbd81, 《死灵之书》) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8548] 获取非托管设备数:1 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8548] manager: rfkill: WiFi 被无线电 killswitch 禁用;被状态文件禁用 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8548] manager: rfkill: WWAN 由无线电 killswitch 启用;由状态文件启用 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8548] manager:网络由状态文件启用 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8549] dhcp-init: 使用 DHCP 客户端 'dhclient' /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMBondDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMBridgeDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMDummyDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8550] 加载的设备插件:NMEthernetDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMInfinibandDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMIPTunnelDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMMacsecDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8550] 加载的设备插件:NMMacvlanDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8551] 加载的设备插件:NMPppDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8551] 加载的设备插件:NMTunDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8551] 加载的设备插件:NMVethDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8551] 加载的设备插件:NMVlanDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8551] 加载的设备插件:NMVxlanDeviceFactory(内部) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8570] 加载的设备插件:NMWwanFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin- wwan.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8580] 加载的设备插件:NMAtmManager (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin- adsl.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8602] 加载的设备插件:NMBluezManager (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-蓝牙.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8611] 加载的设备插件:NMWifiFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin- wifi.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8635] 加载的设备插件:NMTeamFactory (/usr/lib/x86_64-linux-gnu/NetworkManager/libnm-device-plugin-团队.so) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8641] 设备(lo):运营商:链接已连接 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8646] manager: (lo): new Generic device (/org/freedesktop/NetworkManager/Devices/1) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8655] manager: (enp5s0f1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8663] wifi-nl80211: (wlp4s0): 使用 nl80211 进行 WiFi 设备控制 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8664] 设备 (wlp4s0): 驱动程序支持接入点 (AP) 模式 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8670] manager: (wlp4s0): new 802.11 WiFi device (/org/freedesktop/NetworkManager/Devices/3) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8679] 设备 (wlp4s0): 状态变化: 非托管 -> 不可用 (原因 '托管', sys-iface-state: '外部的') /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8723] bluez: 使用 BlueZ 版本 5 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8735] modem-manager: ModemManager 可用 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8757] 请求者:wpa_supplicant 正在运行 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8760] manager: 启动完成 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8767] bluez5: NAP: 添加接口 40:E2:30:AE:5B:16
寻找 enp5s0f1:
/var/log/syslog.1:Oct 17 21:29:46 myhostname 内核:[1.210408] r8169 0000:05:00.1 enp5s0f1:从 eth0 重命名 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8366] 猜测的连接类型 (enp5s0f1) = 802-3-ethernet /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8366] update_connection_setting_from_if_block: name:enp5s0f1, type:802-3-ethernet, id:Ifupdown (enp5s0f1), uuid: a4537f7b- 6324-fd3f-6489-f76bfb2af0dc /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]:[1539826186.8367] 将 enp5s0f1 添加到连接 /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8367] 将 iface enp5s0f1 添加到 eni_ifaces /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8371] 设备添加(路径:/sys/devices/pci0000:00/0000:00:1c.3/0000:05 :00.1/net/enp5s0f1, iface: enp5s0f1) /var/log/syslog.1:Oct 17 21:29:46 myhostname NetworkManager[800]: [1539826186.8655] manager: (enp5s0f1): new Ethernet device (/org/freedesktop/NetworkManager/Devices/2)
/etc/network/interfaces 的内容:
# ifup(8) 和 ifdown(8) 使用的 interfaces(5) 文件 自动lo iface lo inet 环回 iface enp5s0f1 inet dhcp
来自 /etc/netplan/01-network-manager-all.yaml
# 让 NetworkManager 管理这个系统上的所有设备 网络: 版本:2 渲染器:网络管理器
谢谢你的帮助,
查尔斯
如果您在 SSD 上运行,您将面临启动速度快于网络上线速度的风险,然后您需要修改以下文件:/etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service
并将超时时间从 更改30
为60
。重启。更新#1:
terminal
...rfkill list
如果这显示任何被阻止的设备...
rfkill unblock all
并确保没有“无线”硬件开关或功能键设置为“禁用”。
/etc/network/interfaces
和更改...这个:
iface enp5s0f1 inet dhcp
对此:
#iface enp5s0f1 inet dhcp
/etc/NetworkManager/NetworkManager.conf
并确保此行设置为false
...[ifupdown]
managed=false
重新启动系统并重新测试有线和无线连接。再给我看看
sudo lshw -C network
。我找到的所有答案都暂时解决了问题,但重启后又恢复了原样。唯一为我永久修复它的是:
https://askubuntu.com/a/1006979/956940
然后单击菱形图标并选择“启用网络”