我的工作场所有一台运行 Ubuntu 20.04 的服务器,它有 LAN 和 WAN 连接,每个连接都用单独的以太网电缆连接。我们遇到一个问题,机器会随机丢失 WAN 连接,导致远程连接挂起和超时,并阻止任何新连接。我们可以通过登录同一 LAN 上的另一台计算机,然后通过 LAN 接口通过 ssh 连接到 Ubuntu 服务器并运行命令“ifmetric eno1 50”来临时修复此问题。该命令是由我们团队中一位已离职的前成员发现的,但据我了解,这正在改变 WAN 连接的优先级,从而以某种方式恢复与互联网的连接。因此,我认为问题是由于更改了连接的优先级而导致的,因此 LAN 连接取代了 WAN 并阻止了来自互联网的连接。我是否可以永久解决此问题或进一步调查以找出原因?
(编辑)以下是所请求命令的输出:
$ ip -br link
lo UNKNOWN 00:00:00:00:00:00 <LOOPBACK,UP,LOWER_UP>
eno1 UP ac:1f:6b:a1:bd:4c <BROADCAST,MULTICAST,UP,LOWER_UP>
eno2 UP ac:1f:6b:a1:bd:4d <BROADCAST,MULTICAST,UP,LOWER_UP>
virbr0 DOWN 52:54:00:95:94:95 <NO-CARRIER,BROADCAST,MULTICAST,UP>
virbr0-nic DOWN 52:54:00:95:94:95 <BROADCAST,MULTICAST>
$ ip -4 -br address
lo UNKNOWN 127.0.0.1/8
eno1 UP X.X.X.8/24
eno2 UP 192.168.0.20/24
virbr0 DOWN 192.168.122.1/24
$ ip route
default via X.X.X.1 dev eno1 proto dhcp metric 200
default via 192.168.0.239 dev eno2 proto static metric 20100
X.X.X.0/24 dev eno1 proto kernel scope link src X.X.X.8 metric 200
X.X.0.0/16 dev virbr0 scope link metric 1000 linkdown
192.168.0.0/24 dev eno2 proto kernel scope link src 192.168.0.20 metric 100
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
$ ip -4 neigh
X.X.X.15 dev eno1 lladdr d8:5e:d3:01:92:c5 STALE
X.X.X.16 dev eno1 lladdr 90:09:d0:09:2f:bd STALE
192.168.0.24 dev eno2 lladdr 00:11:32:f7:e0:f1 REACHABLE
X.X.X.20 dev eno1 lladdr 90:09:d0:0a:58:f1 STALE
X.X.X.21 dev eno1 lladdr b4:b0:24:1b:47:96 STALE
192.168.0.3 dev eno2 lladdr b4:96:91:53:d2:4a STALE
X.X.X.X dev eno1 lladdr 40:6c:8f:0b:0d:9d STALE
192.168.0.239 dev eno2 lladdr 80:cc:9c:82:e7:ae REACHABLE
X.X.X.33 dev eno1 lladdr b4:96:91:53:d2:48 STALE
X.X.X.1 dev eno1 lladdr 3c:08:f6:21:a5:c0 REACHABLE
192.168.0.10 dev eno2 INCOMPLETE
192.168.0.15 dev eno2 lladdr 90:09:d0:09:2a:55 REACHABLE
X.X.X.9 dev eno1 lladdr 3c:52:82:58:4e:31 STALE
X.X.X.10 dev eno1 lladdr f4:02:70:9d:99:ec STALE
X.X.X.X dev virbr0 FAILED