有线以太网无法工作 Ubuntu 18.04.2

有线以太网无法工作 Ubuntu 18.04.2

我遇到了这个相当常见的问题。我刚刚安装了Ubuntu 18.04.2 LTS 桌面(并选择了最小安装)在东芝 C660-10F 笔记本电脑上,并一直将其连接到我的 LAN 网络。在安装过程中,我有一些网络连接,但重启后它停止工作。每当我拔下电缆、打开计算机并将其插入时,LAN 连接就可以正常工作。睡眠后连接也会断开。当我不使用电缆重新启动计算机,然后将其插入时,它也无法工作。我需要关闭它,然后在不使用电缆的情况下将其打开。

我已经尝试了该线程的第一个答案,但是没有用,也许我做错了什么?

以太网连接 Ubuntu 18.04 无法正常工作

我将 /etc/network/interfaces 文件更改为

 # interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
auto wlp6s0
iface wlp6s0 inet dhcp

ifconfig 打印:

benutzer@C660-10F:~$ ifconfig
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  (Lokale Schleife)
        RX packets 6849  bytes 586042 (586.0 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6849  bytes 586042 (586.0 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.14  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::6754:328a:2ca:11be  prefixlen 64  scopeid 0x20<link>
        ether 4c:ed:de:74:66:22  txqueuelen 1000  (Ethernet)
        RX packets 81100  bytes 104343532 (104.3 MB)
        RX errors 0  dropped 0  overruns 0  frame 6385
        TX packets 50258  bytes 4861359 (4.8 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  

lshw-C 网络

benutzer@C660-10F:~$ sudo lshw -C network
[sudo] Passwort für benutzer: 
  *-network                 
       Beschreibung: Kabellose Verbindung
       Produkt: BCM4313 802.11bgn Wireless Network Adapter
       Hersteller: Broadcom Inc. and subsidiaries
       Physische ID: 0
       Bus-Informationen: pci@0000:06:00.0
       Logischer Name: wlp6s0
       Version: 01
       Seriennummer: 4c:ed:de:74:66:22
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress bus_master cap_list ethernet physical wireless
       Konfiguration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) latency=0 multicast=yes wireless=IEEE 802.11
       Ressourcen: irq:17 memory:d1400000-d1403fff

lspci -v | grep -i 以太网 -A 10

benutzer@C660-10F:~$ sudo lspci -v | grep -i ethernet -A 10
[sudo] Passwort für benutzer: 
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 05)
    Subsystem: Toshiba America Info Systems RTL810xE PCI Express Fast Ethernet controller
    Flags: bus master, fast devsel, latency 0, IRQ 16
    I/O ports at 3000 [size=256]
    Memory at d0404000 (64-bit, prefetchable) [size=4K]
    Memory at d0400000 (64-bit, prefetchable) [size=16K]
    Capabilities: [40] Power Management version 3
    Capabilities: [50] MSI: Enable- Count=1/1 Maskable- 64bit+
    Capabilities: [70] Express Endpoint, MSI 01
    Capabilities: [b0] MSI-X: Enable+ Count=4 Masked-
    Capabilities: [d0] Vital Product Data
    Capabilities: [100] Advanced Error Reporting

猫/etc/netplan/*.yaml

benutzer@C660-10F:~$ cat /etc/netplan/*.yaml
# Let NetworkManager manage all devices on this system
network:
  version: 2
  renderer: NetworkManager

如果在局域网连接时打印配置:

benutzer@C660-10F:~$ ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.25  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::111c:c864:1de2:e3eb  prefixlen 64  scopeid 0x20<link>
        ether 88:ae:1d:fc:15:51  txqueuelen 1000  (Ethernet)
        RX packets 5804097  bytes 6757236146 (6.7 GB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 7843422  bytes 7870222047 (7.8 GB)
        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  (Lokale Schleife)
        RX packets 1299  bytes 127499 (127.4 KB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 1299  bytes 127499 (127.4 KB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlp6s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.14  netmask 255.255.255.0  broadcast 10.0.0.255
        inet6 fe80::6754:328a:2ca:11be  prefixlen 64  scopeid 0x20<link>
        ether 4c:ed:de:74:66:22  txqueuelen 1000  (Ethernet)
        RX packets 286334  bytes 277731993 (277.7 MB)
        RX errors 0  dropped 0  overruns 0  frame 44517
        TX packets 81969  bytes 6275155 (6.2 MB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 17  

我还尝试将 enp1s0 添加到 /etc/network/interfaces 文件中,然后重新启动计算机,但这没有帮助,所以我撤消了该文件中的所有更改。现在它只剩下前三行

插入并连接以太网电缆,关闭 Wi-Fi:

benutzer@C660-10F:~$ sudo lshw -C network
[sudo] Passwort für benutzer: 
  *-network                 
       Beschreibung: Ethernet interface
       Produkt: RTL810xE PCI Express Fast Ethernet controller
       Hersteller: Realtek Semiconductor Co., Ltd.
       Physische ID: 0
       Bus-Informationen: pci@0000:01:00.0
       Logischer Name: enp1s0
       Version: 05
       Seriennummer: 88:ae:1d:fc:15:51
       Größe: 100Mbit/s
       Kapazität: 100Mbit/s
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd autonegotiation
       Konfiguration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=full firmware=rtl_nic/rtl8105e-1.fw ip=10.0.0.25 latency=0 link=yes multicast=yes port=MII speed=100Mbit/s
       Ressourcen: irq:16 ioport:3000(Größe=256) memory:d0404000-d0404fff memory:d0400000-d0403fff
  *-network DEAKTIVIERT
       Beschreibung: Kabellose Verbindung
       Produkt: BCM4313 802.11bgn Wireless Network Adapter
       Hersteller: Broadcom Inc. and subsidiaries
       Physische ID: 0
       Bus-Informationen: pci@0000:06:00.0
       Logischer Name: wlp6s0
       Version: 01
       Seriennummer: 4c:ed:de:74:66:22
       Breite: 64 bits
       Takt: 33MHz
       Fähigkeiten: pm msi pciexpress bus_master cap_list ethernet physical wireless
       Konfiguration: broadcast=yes driver=wl0 driverversion=6.30.223.271 (r587334) latency=0 multicast=yes wireless=IEEE 802.11
       Ressourcen: irq:17 memory:d1500000-d1503fff
benutzer@C660-10F:~$ lspci -v | grep -i ethernet -A 20
01:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL810xE PCI Express Fast Ethernet controller (rev 05)
    Subsystem: Toshiba America Info Systems RTL810xE PCI Express Fast Ethernet controller
    Flags: bus master, fast devsel, latency 0, IRQ 16
    I/O ports at 3000 [size=256]
    Memory at d0404000 (64-bit, prefetchable) [size=4K]
    Memory at d0400000 (64-bit, prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: r8169
    Kernel modules: r8169

06:00.0 Network controller: Broadcom Inc. and subsidiaries BCM4313 802.11bgn Wireless Network Adapter (rev 01)
    Subsystem: Askey Computer Corp. BCM4313 802.11bgn Wireless Network Adapter
    Flags: bus master, fast devsel, latency 0, IRQ 17
    Memory at d1500000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: <access denied>
    Kernel driver in use: wl
    Kernel modules: bcma, wl

ff:00.0 Host bridge: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers (rev 05)
    Subsystem: Intel Corporation Core Processor QuickPath Architecture Generic Non-core Registers
    Flags: bus master, fast devsel, latency 0

答案1

你的/etc/network/interfaces文件看起来应该像这样:

# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback

然后,在terminaldo 中:

sudo apt-get install dkms r8168-dkms# 安装不同的以太网驱动程序

reboot# 重启计算机并验证网络运行情况

更新#1:

让我们手动加载它的驱动程序...

sudo -H gedit /etc/modules# 编辑此文件

在文件末尾添加:

# load ethernet driver at boot time
r8168

保存文件。退出编辑器。使用连接的以太网电缆重新启动。

相关内容