18.04 版以太网无法工作。Wi-Fi 一段时间后停止工作

18.04 版以太网无法工作。Wi-Fi 一段时间后停止工作

我对此进行了很多搜索,但尚未找到解决方案!以下是一些相关的命令输出:

$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether e0:db:55:ba:d8:2f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 196  bytes 39618 (39.6 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 3635  bytes 379737 (379.7 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3635  bytes 379737 (379.7 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.5  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::d24c:daf:8b52:1424  prefixlen 64  scopeid 0x20<link>
        ether 0c:8b:fd:f2:d8:cf  txqueuelen 1000  (Ethernet)
        RX packets 13068  bytes 7854493 (7.8 MB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 12937  bytes 1966814 (1.9 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
$

如您所见,没有 inet 地址(我根据某处的建议禁用了 IPV6。以前,我有时会得到一个 inet6 地址)。但是,可以检测到链接。以下是 ethtool 的输出:

$ sudo ethtool eth0
Settings for eth0:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Half 1000baseT/Full 
    Supported pause frame use: No
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full 
                            100baseT/Half 100baseT/Full 
                            1000baseT/Full 
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full 
                                         100baseT/Half 100baseT/Full 
    Link partner advertised pause frame use: Symmetric
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 100Mb/s
    Duplex: Full
    Port: MII
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: on
    Supports Wake-on: pumbg
    Wake-on: d
    Current message level: 0x00000033 (51)
                   drv probe ifdown ifup
    Link detected: yes
$

以下是硬件信息:

$ sudo lshw -C network
  *-network                 
       description: Wireless interface
       product: Wireless 7260
       vendor: Intel Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       logical name: wlan0
       version: 73
       serial: 0c:8b:fd:f2:d8:cf
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list ethernet physical wireless
       configuration: broadcast=yes driver=iwlwifi driverversion=4.15.0-30-generic firmware=17.948900127.0 ip=192.168.1.5 latency=0 link=yes multicast=yes wireless=IEEE 802.11
       resources: irq:48 memory:e3500000-e3501fff
  *-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0.1
       bus info: pci@0000:03:00.1
       logical name: eth0
       version: 12
       serial: e0:db:55:ba:d8:2f
       size: 100Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl8411-2_0.0.1 07/08/13 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       resources: irq:19 ioport:4000(size=256) memory:e3404000-e3404fff memory:e3400000-e3403fff
$ 

我看到驱动程序 r8169 已加载(而不是 r8168,因为许多其他人遇到此卡问题),但我没有看到其软件包已安装。不确定这是否是预期的。我应该尝试安装它吗?我没有尝试,因为我不想进一步破坏它。

$ lsmod | grep r8 
r8169                  86016  0
mii                    16384  1 r8169
$ dpkg -l | grep r8
$

我尝试使用以下方法将 eth0 添加到 /etc/networking/interfaces

auto eth0
iface eth0 inet dhcp

然后 sudo ifdown eth0 ; sudo ifup eth0 但是我没有获取 IP 地址。长时间只获取“DHCPDISCOVER”行:

$ sudo ifup eth0
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/eth0/e0:db:55:ba:d8:2f
Sending on   LPF/eth0/e0:db:55:ba:d8:2f
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 21 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 12 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 17 (xid=0xc4c52e42)
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 18 (xid=0xc4c52e42)

我正在使用带有 Windows 10 的双启动 PC。但是,我有一段时间没有启动 Windows 10 了,上次启动 Windows 10 后,路由器和笔记本电脑都重启了好几次。

一切都运行良好,直到上周我从 16.04 LTS 升级到 18.04.1 LTS。任何帮助都非常感谢。

答案1

好的。问题解决了。以下是我对以太网连接的操作:

在文件 /etc/NetworkManager/NetworkManager.conf 中,我进行了以下更改

[ifupdown]
managed=false

[ifupdown]
managed=true

在此之后,我执行了

sudo service NetworkManager restart

以太网开始自动工作!

对于 wifi,我的 NetworkManager 似乎认为它被硬件禁用了(工作了几个小时后)。我使用的是 Dell Inspiron 7537,没有任何硬件开关。我尝试使用 rfkill 来查看它是否是软阻止:

$ rfkill list all
0: dell-rbtn: Wireless LAN
    Soft blocked: no
    Hard blocked: no
3: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: yes

我发现我的键盘上有一个“飞行模式”按钮。按下它后,wifi 开始工作!不过我不确定为什么它被注册为硬阻止而不是软阻止。此后的 rfkill 输出:

$ rfkill list all
0: dell-rbtn: Wireless LAN
    Soft blocked: no
    Hard blocked: no
3: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
5: hci0: Bluetooth
    Soft blocked: no
    Hard blocked: no

显然,我的蓝牙之前也被禁用了!

相关内容