我在从 Azure 机器访问我的一台 DigitalOcean 服务器时经常遇到麻烦。
我已经隔离了一个测试,我认为该测试可以演示该问题,并从服务器捕获了工作示例和不工作示例的 tcpdump。但我不确定如何解释结果。
下面,您可以看到测试和结果。我从两台 Azure 计算机访问同一台服务器上的同一端口,一台可以正常工作(端口状态为“打开”),另一台不能正常工作(端口状态为“已过滤”)。
NMap 测试
主机不工作
root@NOT_WORKING_HOST:~# nmap -p 28015 SERVER_HOST
Starting Nmap 6.40 ( http://nmap.org ) at 2015-10-27 01:26 UTC
Nmap scan report for SERVER_HOST (SERVER_IP)
Host is up (0.013s latency).
rDNS record for SERVER_IP: SERVER_HOST
PORT STATE SERVICE
28015/tcp filtered unknown
Nmap done: 1 IP address (1 host up) scanned in 1.33 seconds
工作主机
root@WORKING_HOST:~# nmap -p 28015 SERVER_HOST
Starting Nmap 6.40 ( http://nmap.org ) at 2015-10-27 01:26 UTC
Nmap scan report for SERVER_HOST (SERVER_IP)
Host is up (0.021s latency).
rDNS record for SERVER_IP: SERVER_HOST
PORT STATE SERVICE
28015/tcp open unknown
Nmap done: 1 IP address (1 host up) scanned in 1.34 seconds
服务器上的 TCP 转储
root@SERVER_HOST:~# tcpdump host WORKING_IP or NOT_WORKING_IP
不工作
21:26:34.311497 IP NOT_WORKING_IP.1176 > SERVER_HOST.https: Flags [S], seq 3413304565, win 1024, options [mss 1440], length 0
21:26:34.311609 IP SERVER_HOST.https > NOT_WORKING_IP.1176: Flags [R.], seq 0, ack 3413304566, win 0, length 0
21:26:35.343395 IP NOT_WORKING_IP.1176 > SERVER_HOST.28015: Flags [S], seq 4045817122, win 1024, options [mss 1440], length 0
21:26:35.449202 IP NOT_WORKING_IP.1177 > SERVER_HOST.28015: Flags [S], seq 4045882659, win 1024, options [mss 1440], length 0
在职的
21:26:40.193280 IP WORKING_IP.1120 > SERVER_HOST.https: Flags [S], seq 2982542630, win 1024, options [mss 1440], length 0
21:26:40.193365 IP SERVER_HOST.https > WORKING_IP.1120: Flags [R.], seq 0, ack 2982542631, win 0, length 0
21:26:41.211945 IP WORKING_IP.1120 > SERVER_HOST.28015: Flags [S], seq 2474523314, win 1024, options [mss 1440], length 0
21:26:41.212021 IP SERVER_HOST.28015 > WORKING_IP.1120: Flags [S.], seq 3409621485, ack 2474523315, win 29200, options [mss 1460], length 0
21:26:41.224350 IP WORKING_IP.1120 > SERVER_HOST.28015: Flags [R], seq 2474523315, win 0, length 0
21:26:41.334956 IP WORKING_IP.1121 > SERVER_HOST.28015: Flags [S], seq 2474588851, win 1024, options [mss 1440], length 0
21:26:41.335040 IP SERVER_HOST.28015 > WORKING_IP.1121: Flags [S.], seq 2978496887, ack 2474588852, win 29200, options [mss 1460], length 0
21:26:41.356445 IP WORKING_IP.1121 > SERVER_HOST.28015: Flags [R], seq 2474588852, win 0, length 0