我买了一台新的工作笔记本电脑,从旧的 HP Elitebook 8560w 换成了新的 850 G5。除了有线以太网连接之外,一切似乎都正常工作。
屏幕右上角的网络连接图标上有一个问号。在以太网上,我可以 ping 任何内容并得到响应:
ping google.com
PING google.com (172.217.22.174) 56(84) bytes of data.
64 bytes from arn09s11-in-f174.1e100.net (172.217.22.174): icmp_seq=1 ttl=45 time=8.43 ms
64 bytes from arn09s11-in-f174.1e100.net (172.217.22.174): icmp_seq=2 ttl=45 time=8.68 ms
64 bytes from arn09s11-in-f174.1e100.net (172.217.22.174): icmp_seq=3 ttl=45 time=8.65 ms
64 bytes from arn09s11-in-f174.1e100.net (172.217.22.174): icmp_seq=4 ttl=45 time=8.62 ms
但实际上在浏览器上的某个地方进行连接或尝试建立 telnet 连接将立即失败。
Trying 172.217.22.174...
Trying 2a00:1450:400f:80b::200e...
telnet: Unable to connect to remote host: Network is unreachable
同样,UDP连接失败:
nc -z -v google.com 80
nc: connect to google.com port 80 (tcp) failed: Connection refused
nc: connect to google.com port 80 (tcp) failed: Network is unreachable
我没有启用网络代理,至少根据 Ubuntu 的网络设置没有启用。这似乎不是 DNS 问题,因为 ping 和 nslookup 似乎正在工作并提供正确的答案。以下是 sudo lshw -C network 的相关部分,供参考:
*-network
description: Ethernet interface
product: Ethernet Connection (4) I219-V
vendor: Intel Corporation
physical id: 1f.6
bus info: pci@0000:00:1f.6
logical name: enp0s31f6
version: 21
serial: b0:0c:d1:42:60:4f
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 33MHz
capabilities: pm msi bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000e driverversion=3.2.6-k duplex=full firmware=0.1-4 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:145 memory:ba400000-ba41ffff
*-network
description: Ethernet interface
physical id: 2
logical name: enp0s20f0u3c2
serial: 02:1e:10:1f:00:00
capabilities: ethernet physical
configuration: broadcast=yes driver=cdc_ether driverversion=22-Aug-2005 firmware=CDC Ethernet Device link=no multicast=yes
并且 $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: enp0s31f6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether b0:0c:d1:42:60:4f brd ff:ff:ff:ff:ff:ff
inet 10.110.61.55/24 brd 10.110.61.255 scope global dynamic noprefixroute enp0s31f6
valid_lft 691196sec preferred_lft 691196sec
inet6 fe80::d0ea:fad4:2d50:eae9/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: enp0s20f0u3c2: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc fq_codel state DOWN group default qlen 1000
link/ether 02:1e:10:1f:00:00 brd ff:ff:ff:ff:ff:ff
4: wlp2s0: <BROADCAST,MULTICAST> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether a0:a4:c5:6b:d4:38 brd ff:ff:ff:ff:ff:ff
我想最明显的一点是缺少 eth0 接口。这意味着...我不知道那是什么意思。
我应该强调的是,我的旧笔记本电脑也运行着 Ubuntu 18.04,使用完全相同的以太网连接和完全相同的电缆,运行得非常好。此外,我的新笔记本电脑使用无线的连接,因此问题仅仅出在有线连接上。
这可能与我的安装无关;我也无法与 USB 记忆棒 Ubuntu 建立有线连接,而且重新安装操作系统几次也无济于事。
答案1
您说的是有线连接,但ip a
输出显示您正在使用 wifi(wlp2s0
接口)。有线连接enp0s...
在一种情况下没有显示 IP,在第二种情况下没有显示电缆