无法在双 NAT LAN 上访问 Ubuntu 20.04 服务器

无法在双 NAT LAN 上访问 Ubuntu 20.04 服务器

我的 LAN 上有一些设备运行不同的 Linux 发行版:

  • 乌班图20.04
  • 操作系统7
  • 软呢帽 33

它们都在同一个子网中192.168.50.0/24。网络图:网络图

直到最近,Subnet 2我还可以从我的 PC ( ) 访问 ( ssh, http) 所有三个设备。

前几天,由于 .ubuntu 的提示,我重新启动了 ubuntu 盒子motd。重新启动后,我无法再访问(ping、、)进入 ubuntu 框。不过,我仍然可以访问 ubuntu 盒子sshhttp通过其他linux盒子。 IE。登录centos盒子;从centos盒子登录ubuntu盒子。

发生了一些奇怪的事情,我无法准确指出它是什么。

非常感谢任何指示或我应该尝试的其他内容。谢谢


环境

  • 操作系统:20.04.2 LTS(焦点窝)

调试结果

路由表

ubuntu # ip route show
default via 192.168.50.1 dev enp3s0 src 192.168.50.2 metric 202
10.6.0.0/24 dev wg0 proto kernel scope link src 10.6.0.1
192.168.50.0/24 dev enp3s0 proto dhcp scope link src 192.168.50.2 metric 202
192.168.50.1 dev enp3s0 proto dhcp scope link src 192.168.50.2 metric 100

centos # ip route show
default via 192.168.50.1 dev enp4s0
192.168.50.0/24 dev enp4s0 proto kernel scope link src 192.168.50.3

fedora # ip route show
default via 192.168.50.1 dev enp3s0 proto dhcp metric 100
192.168.50.0/24 dev enp3s0 proto kernel scope link src 192.168.50.4 metric 100

Nmap 子网 1 与子网 2:

pc-01 # nmap -v 192.168.50.0/24
Starting Nmap 7.80 ( https://nmap.org ) at 2021-02-27 17:13
Nmap scan report for 192.168.50.1
Host is up (0.011s latency).
Nmap scan report for 192.168.50.5
Host is up (0.0090s latency).
Nmap scan report for 192.168.50.3
Host is up (0.014s latency).
Nmap scan report for 192.168.50.4
Host is up (0.010s latency).
Nmap done: 256 IP addresses (4 hosts up) scanned in 8.93 seconds

来自子网 1 的 Nmap 子网 1:

centos # nmap -v 192.168.50.0/24
Starting Nmap 6.40 ( http://nmap.org ) at 2021-02-27 18:15 AEDT
Nmap scan report for 192.168.50.1
Host is up (0.00031s latency).
Nmap scan report for 192.168.50.2
Host is up (0.00035s latency).
Nmap scan report for 192.168.50.3
Host is up (0.00050s latency).
Nmap scan report for 192.168.50.4
Host is up (-0.100s latency).
Nmap scan report for 192.168.50.5
Host is up.
Nmap done: 256 IP addresses (5 hosts up) scanned in 2.08 seconds

-Pn带子网 2 交换机的Nmap ubuntu 盒子

pc-01 # nmap -v -Pn 192.168.50.2
Starting Nmap 7.80 ( https://nmap.org ) at 2021-02-27 16:45
Initiating Parallel DNS resolution of 1 host. at 16:45
Completed Parallel DNS resolution of 1 host. at 16:45, 0.23s elapsed
Initiating SYN Stealth Scan at 16:45
Scanning 192.168.50.2 [1000 ports]
Completed SYN Stealth Scan at 16:50, 323.24s elapsed (1000 total ports)
Nmap scan report for 192.168.50.2
Host is up.
All 1000 scanned ports on 192.168.50.2 are filtered

防火墙

ubuntu # ufw status
Status: inactive

ubuntu # iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

答案1

我不知道发生了什么事。但在我刷了路由器(192.168.50.1)后,问题就消失了。尽管事实上我在调试问题时多次重新启动路由器。

也许 ubuntu 上的 ip renew 命令可以解决这个问题:

dhclient -r

在我更清楚地了解导致此问题的原因之前,我不会将其标记为正确答案。

相关内容