Wifi 工作,但以太网有线连接没有。同一台计算机上同一以太网端口上的同一根电缆在 Windows 10 下完美运行。在 Xubuntu 18.04 中,我无法上网。只要我插入以太网电缆,系统就会识别它。并且网络管理器显示计算机已连接到有线连接。但是,我无法通过以太网电缆连接到互联网(我可以通过 Wifi 连接)。
[剧透警告:问题是我的笔记本电脑在工作时配置了固定 IP 地址,因此无法在家连接]。
任何帮助深表感谢。这是一些诊断信息。我提供以下输出:1) ping,2) ifconfig,3) iwconfig,4) lspci -v,5) lshw -C network,和 6) /etc/network/interfaces**
1) ping -c 3 www.xubuntu.org
PING web-frontends.canonical.com (162.213.33.25) 56(84) bytes of data.
From 150.108.84.253 icmp<sub>seq</sub>=1 Destination Host Unreachable
From 150.108.84.253 icmp<sub>seq</sub>=2 Destination Host Unreachable
From 150.108.84.253 icmp<sub>seq</sub>=3 Destination Host Unreachable
— web-frontends.canonical.com ping statistics —
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2051ms
pipe 3
2) 如果配置
enp0s31f6: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 150.108.84.253 netmask 255.255.255.0 broadcast 150.108.84.255
inet6 fe80::9f88:372b:9863:b493 prefixlen 64 scopeid 0x20<link>
ether 54:ee:75:df:3d:f8 txqueuelen 1000 (Ethernet)
RX packets 576 bytes 82397 (82.3 KB)
RX errors 0 dropped 1 overruns 0 frame 0
TX packets 460 bytes 45228 (45.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xed200000-ed220000
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 9735 bytes 1008676 (1.0 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 9735 bytes 1008676 (1.0 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.148 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::589f:e92d:cf61:af77 prefixlen 64 scopeid 0x20<link>
ether f8:34:41:99:9c:51 txqueuelen 1000 (Ethernet)
RX packets 14579 bytes 6474018 (6.4 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10322 bytes 3798947 (3.7 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
3) 配置
wlp4s0 IEEE 802.11 ESSID:"Netgear 04_5G"
Mode:Managed Frequency:5.745 GHz Access Point: 2C:FD:A1:62:70:54
Bit Rate=866.7 Mb/s Tx-Power=22 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Power Management:on
Link Quality=70/70 Signal level=-37 dBm
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:267 Missed beacon:0
4) 须藤 lspci -v
00:1f.6 Ethernet controller: Intel Corporation Ethernet Connection (4) I219-V (rev 21)
Subsystem: Lenovo ThinkPad T570
Flags: bus master, fast devsel, latency 0, IRQ 126
Memory at ed200000 (32-bit, non-prefetchable) [size=128K]
Capabilities: [c8] Power Management version 3
Capabilities: [d0] MSI: Enable+ Count=1/1 Maskable- 64bit+
Capabilities: [e0] PCI Advanced Features
Kernel driver in use: e1000e
Kernel modules: e1000e
5) sudo lshw -C 网络
*-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: 54:ee:75:df:3d:f8
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-3 latency=0 link=yes multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:126 memory:ed200000-ed21ffff
6) /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)
auto lo
iface lo inet loopback
解决了这个问题。在工作中,他们为我的有线连接分配了一个固定的 IP 地址。解决方案只是删除该地址并告诉网络管理员自动分配我家路由器生成的 IP 地址(即使用自动 DHCP 方法进行连接)。