我可以确认这个问题已被问过几次,不幸的是,对我而言没有一个解决方案起作用。
我可以确认以太网电缆工作正常。我只需将其从附近运行 18.04 的计算机上拔下并连接到这台新计算机即可。如果我更换旧计算机上的电缆,一切正常。这台新计算机显示已检测到有线连接,但我无法访问互联网。
但是之后:
$ ifconfig
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 2001:690:2200:9aa1:7055:cd5f:6e9d:7072 prefixlen 64 scopeid 0x0<global>
inet6 2001:690:2200:9aa1:5159:6a43:60c:8217 prefixlen 64 scopeid 0x0<global>
inet6 fe80::d530:de7:90c9:7c8e prefixlen 64 scopeid 0x20<link>
ether 4c:cc:6a:91:41:d5 txqueuelen 1000 (Ethernet)
RX packets 126869 bytes 84840453 (84.8 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 24876 bytes 4529725 (4.5 MB)
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 15848 bytes 4739907 (4.7 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 15848 bytes 4739907 (4.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions
$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
$ ping google.com
ping: google.com: Temporary failure in name resolution
$ sudo lshw -C network
*-network
description: Ethernet interface
product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
vendor: Realtek Semiconductor Co., Ltd.
physical id: 0
bus info: pci@0000:01:00.0
logical name: enp1s0
version: 15
serial: 4c:cc:6a:91:41:d5
size: 1Gbit/s
capacity: 1Gbit/s
width: 64 bits
clock: 33MHz
capabilities: pm msi pciexpress msix bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=5.11.0-40-generic duplex=full firmware=rtl8168h-2_0.0.2 02/26/15 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:16 ioport:e000(size=256) memory:df004000-df004fff memory:df000000-df003fff
$ ping 8.8.8.8
ping: connect: Network is unreachable
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 21.04
Release: 21.04
Codename: hirsute
您还有什么建议?
编辑
以太网电缆传输到旧计算机时工作正常,但插入新机器时却不行。
$ cat /etc/network/interfaces
cat: /etc/network/interfaces: No such file or directory
$ cat /etc/netplan/*.yaml
# Let NetworkManager manage all devices on this system
network:
version: 2
renderer: NetworkManager