在家里,我可以通过公共光纤网络访问互联网。我的 ISP 是免费的(法国的),它提供了一个名为“freebox”的盒子,里面有一个集成交换机,提供 4 个以太网端口。我的家庭办公室墙上有一个以太网插头,以太网线一直延伸到盒子所在的车库。我的电脑运行的是 Ubuntu 20.04
当我在计算机和办公室插头之间插入一根以太网线,然后将这根墙上的线直接连接到其中一个盒子以太网端口时,我的网络连接仅以 10Mb/s 的速度建立。
如果我使用另一个交换机(其速度限制为 100Mb/s)连接到我的盒子上的同一个以太网交换机,然后将墙上的线连接到这个新交换机上,我就能得到 100Mb/s 的连接。
当我把我的电脑带到车库,并将电脑上的以太网线直接插入我的盒子上的以太网端口时,我得到了 1000Mb/s 的连接。
网络连接速度在设备属性上指定:
$> networkctl status 2
WARNING: systemd-networkd is not running, output will be incomplete.
Failed to query link bit rates: Unit dbus-org.freedesktop.network1.service not found.
● 2: eno2
Link File: /usr/lib/systemd/network/99-default.link
Network File: n/a
Type: ether
State: n/a (unmanaged)
Alternative Names: enp0s31f6
Path: pci-0000:00:1f.6
Driver: e1000e
Vendor: Intel Corporation
Model: Ethernet Connection (10) I219-V
HW Address: xx:xx:xx:xx:xx:xx (ASUSTek COMPUTER INC.)
MTU: 1500 (min: 68, max: 9000)
Queue Length (Tx/Rx): 1/1
Auto negotiation: yes
Speed: 10Mbps
Duplex: full
Port: tp
Address: 192.168.0.80
2a01:e0a:81d:dda0:398d:d4ca:5505:7b24
2a01:e0a:81d:dda0:416a:799:3fa4:2e69
fe80::e262:472d:cf2f:98ee
Gateway: 192.168.0.254 (FREEBOX SAS)
fe80::72fc:8fff:fe57:42e0 (FREEBOX SAS)
Activation Policy: up
Required For Online: yes
然后我做了一个速度测试,显示真实的网络速度,并与网络配置相符:
在 1、2 和 3 之间更改配置非常困难:每次我都必须等待很长时间,拔掉并重新插入电线,更改端口,却不明白到底是什么出了问题。我认为我遇到了 DHCP 问题
这是尝试建立连接时的网络管理器日志:
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8684] device (eno2): carrier: link connected
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8709] device (eno2): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8864] policy: auto-activating connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8911] device (eno2): Activation: starting connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8914] device (eno2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8929] device (eno2): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8943] device (eno2): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:24 fabien-book NetworkManager[1275]: <info> [1673186724.8951] dhcp4 (eno2): activation: beginning transaction (timeout in 45 seconds)
janv. 08 15:05:33 fabien-book NetworkManager[1275]: <info> [1673186733.1254] device (eno2): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:33 fabien-book NetworkManager[1275]: <info> [1673186733.1378] device (eno2): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:33 fabien-book NetworkManager[1275]: <info> [1673186733.1380] device (eno2): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
janv. 08 15:05:33 fabien-book NetworkManager[1275]: <info> [1673186733.1411] device (eno2): Activation: successful, device activated.
janv. 08 15:05:39 fabien-book NetworkManager[1275]: <info> [1673186739.5049] device (eno2): state change: activated -> unavailable (reason 'carrier-changed', sys-iface-state: 'managed')
janv. 08 15:05:39 fabien-book NetworkManager[1275]: <info> [1673186739.5204] dhcp4 (eno2): canceled DHCP transaction
janv. 08 15:05:39 fabien-book NetworkManager[1275]: <info> [1673186739.5205] dhcp4 (eno2): state changed unknown -> done
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8681] device (eno2): carrier: link connected
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8703] device (eno2): state change: unavailable -> disconnected (reason 'carrier-changed', sys-iface-state: 'managed')
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8766] policy: auto-activating connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8771] device (eno2): Activation: starting connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8772] device (eno2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8776] device (eno2): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8781] device (eno2): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:05 fabien-book NetworkManager[1275]: <info> [1673186765.8784] dhcp4 (eno2): activation: beginning transaction (timeout in 45 seconds)
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <warn> [1673186811.5964] dhcp4 (eno2): request timed out
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.5965] dhcp4 (eno2): state changed unknown -> timeout
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.5966] device (eno2): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <warn> [1673186811.5995] device (eno2): Activation: failed for connection 'Connexion filaire 1'
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6004] device (eno2): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6323] dhcp4 (eno2): canceled DHCP transaction
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6324] dhcp4 (eno2): state changed timeout -> done
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6400] policy: auto-activating connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6424] device (eno2): Activation: starting connection 'Connexion filaire 1' (fec0ebdf-87f4-38db-ac22-950eca00c172)
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6426] device (eno2): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6431] device (eno2): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6439] device (eno2): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
janv. 08 15:06:51 fabien-book NetworkManager[1275]: <info> [1673186811.6444] dhcp4 (eno2): activation: beginning transaction (timeout in 45 seconds)
然后当它终于开始工作(但速度很慢)时:
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6178] dhcp4 (eno2): state changed unknown -> bound
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6189] device (eno2): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6268] device (eno2): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6269] device (eno2): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6273] manager: NetworkManager state is now CONNECTED_LOCAL
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6282] manager: NetworkManager state is now CONNECTED_SITE
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6285] policy: set 'Connexion filaire 1' (eno2) as default for IPv4 routing and DNS
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6302] device (eno2): Activation: successful, device activated.
janv. 08 14:38:07 fabien-book NetworkManager[1275]: <info> [1673185087.6755] manager: NetworkManager state is now CONNECTED_GLOBAL
janv. 08 14:38:09 fabien-book NetworkManager[1275]: <info> [1673185089.5987] policy: set 'Connexion filaire 1' (eno2) as default for IPv6 routing and DNS
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0897] dhcp4 (eno2): option requested_time_offset => '1'
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0898] dhcp4 (eno2): option requested_wpad => '1'
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0898] dhcp4 (eno2): option routers => '192.168.0.254'
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0898] dhcp4 (eno2): option subnet_mask => '255.255.255.0'
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0898] dhcp4 (eno2): state changed unknown -> bound
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0914] device (eno2): state change: ip-config -> ip-check (reason 'none', sys-iface-state: 'managed')
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0996] device (eno2): state change: ip-check -> secondaries (reason 'none', sys-iface-state: 'managed')
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.0998] device (eno2): state change: secondaries -> activated (reason 'none', sys-iface-state: 'managed')
janv. 08 15:11:19 fabien-book NetworkManager[1293]: <info> [1673187079.1027] device (eno2): Activation: successful, device activated.
我不知道问题出在哪里:是电缆损坏的物理问题(但这样根本就无法工作)吗?是我电脑的配置问题吗?是 ISP 自由盒的配置问题吗?我应该在哪里查看,我可以做什么来做进一步调查?