我最近为我的笔记本电脑买了一个新的以太网适配器,但它总是无法连接到互联网。我没有改变我的网络设置(一切都设置为自动),我知道 USB 端口可以工作(并且是 3.0),我切换了以太网电缆,并且重新启动了,但问题仍然存在。我查看了几个类似的问题,但没有找到答案。以下是一些相关命令的输出:
~$ ifconfig
enx00e04c680050: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::660a:4122:589c:5867 prefixlen 64 scopeid 0x20<link>
ether 00:e0:4c:68:00:50 txqueuelen 1000 (Ethernet)
RX packets 13613 bytes 2126629 (2.1 MB)
RX errors 0 dropped 5 overruns 0 frame 0
TX packets 539 bytes 529852 (529.8 KB)
TX errors 247 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 3817 bytes 240361 (240.3 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3817 bytes 240361 (240.3 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.43.207 netmask 255.255.255.0 broadcast 192.168.43.255
inet6 fe80::c550:81b5:cbfc:9922 prefixlen 64 scopeid 0x20<link>
ether 9c:b6:d0:d0:ab:35 txqueuelen 1000 (Ethernet)
RX packets 3473 bytes 4532992 (4.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2303 bytes 369202 (369.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
适配器接口是第一个,enx00e04c6880050
。
~$ lsusb
Bus 002 Device 004: ID 0bda:8153 Realtek Semiconductor Corp.
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 0cf3:e301 Atheros Communications, Inc.
Bus 001 Device 004: ID 0c45:6713 Microdia
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
适配器是 Realtek 设备。以下是 的部分输出dmesg
;还有更多内容,但都完全相同。
~$ dmesg | grep enx00e04c680050
[ 3.145962] r8152 1-2:1.0 enx00e04c680050: renamed from eth0
[ 4.594647] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 4.599211] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 4.748235] r8152 1-2:1.0 enx00e04c680050: carrier on
[ 5.407467] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c680050: link becomes ready
[ 100.932975] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933018] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933057] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933095] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933135] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933183] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933342] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 100.933379] r8152 1-2:1.0 enx00e04c680050: Rx status -71
[ 106.567052] r8152 2-1:1.0 enx00e04c680050: renamed from eth0
[ 106.598088] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 106.601933] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 108.156517] r8152 2-1:1.0 enx00e04c680050: carrier on
[ 108.156551] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c680050: link becomes ready
[ 217.647356] r8152 2-1:1.0 enx00e04c680050: Stop submitting intr, status -71
[ 306.017018] r8152 2-2:1.0 enx00e04c680050: renamed from eth0
[ 306.045732] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 306.049858] IPv6: ADDRCONF(NETDEV_UP): enx00e04c680050: link is not ready
[ 307.612495] r8152 2-2:1.0 enx00e04c680050: carrier on
[ 307.612522] IPv6: ADDRCONF(NETDEV_CHANGE): enx00e04c680050: link becomes ready
[ 321.228465] r8152 2-2:1.0 enx00e04c680050: Tx status -71
[ 321.231900] r8152 2-2:1.0 enx00e04c680050: Tx status -71
我还dmesg
为驱动程序运行了;这是上面唯一没有显示的两行:
~$ dmesg | grep r8152
[ 2.833638] usbcore: registered new interface driver r8152
[ 3.144927] r8152 1-2:1.0 eth0: v1.09.9
编辑:我尝试谷歌搜索“Tx status -71”,我感觉这— 这似乎是一个尚未解决的错误 — 是相关的,尽管我不完全确定如何实现提供的补丁,或者是否能解决问题。
答案1
这对我有用:
sudo touch /etc/NetworkManager/conf.d/10-globally-managed-devices.conf
sudo systemctl restart NetworkManager
答案2
答案3
这在 Ubuntu 18.04.4 下有效。可以在以下位置创建服务
/etc/systemd/system/dell-quirks.service
内容如下:
[Unit]
Description=Install quirks for DELL TypeC ethernet/VGA/ DA 200 adapter
Documentation=https://askubuntu.com/questions/1081128/usb-3-0-ethernet-adapter-not-working-ubuntu-18-04
[Service]
Type=oneshot
RemainAfterExit=true
#ExecStart=/usr/bin/echo 0bda:8153:k > /sys/module/usbcore/parameters/quirks
ExecStart=/bin/bash -c "echo 0bda:8153:k > /sys/module/usbcore/parameters/quirks"
[Install]
WantedBy=multi-user.target
重新加载守护进程
systemctl 守护进程重新加载
启用服务,使其在每次重启时启动
systemctl 启用 dell-quirks.service
启动服务
systemctl 启动 dell-quirks.service
必须创建接口配置。在创建接口配置之前,可以在以下位置为以太网接口命名
/etc/udev/rules.d/70-persistent-net.rules
内容如下:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*",ATTR{address}=="<MAC address of the ethernet interface>",ATTR{dev_id}=="0x0",ATTR{type}=="1",KERNEL=="eth*",NAME="eth0"
以太网配置完成后,可以使用网络计划通过创建 yaml 文件
/etc/netplan/01-网卡.yaml
内容如下:
network:
version: 2
renderer: NetworkManager
ethernets:
eth0:
dhcp4: true
当笔记本电脑启动时,断开 USB 设备,启动后再连接,几分钟后它应该就可以工作了。如果需要,重新启动网络管理器并等待几分钟。
systemctl 重启 NetworkManager
答案4
复制修改后的文件
cp /etc/netplan/01-netcfg.yaml /etc/netplan/01-netcfg.yaml.backup
写:
lshw -c network
并保存逻辑名称以太网卡
转到文件nano /etc/netplan/01-netcfg.yaml
并添加ethernets:
your-logical-name-ethernet:
dhcp4: yes
整个事情看起来应该是这样的:
network:
version: 2
renderer: networkd
ethernets:
enx00e04c480394:
dhcp4: yes
保存并输入
netplan --debug apply
就我而言,在 /etc/udev/rules.d/ 中重命名卡不起作用,我必须输入原始名称