我有一个在虚拟化的 Debian 8.5(Windows 10 下的 VirtualBox)下运行的测试游戏服务器;这台 Linux 机器在网络中有自己的 IP 地址。 游戏服务器使用端口 2106、7777 和 10241。我成功地配置了我的盒子,使游戏服务器可以从 WAN 访问,这 3 个端口被重定向到 Linux 机器 IP 192.168.1.70(测试是从我的 Windows 机器 192.168.1.1 进行的)。
我从 Windows 做了一些 telnet 测试,比如:
telnet 192.168.1.70 2106 ==> Test OK
telnet 192.168.1.70 7777 ==> Test OK
telnet MY_PUBLIC_IP 2106 ==> Test OK
telnet MY_PUBLIC_IP 7777 ==> Test OK
telnet 192.168.1.70 10241 ==> Test KO !!
telnet MY_PUBLIC_IP 10241 ==> Test KO !!
同时,我从 Linux 机器上 tcdump 数据包,并有端口 2106:
23:10:50.525372 IP 192.168.1.1.55598 > 192.168.1.70.2106: Flags [S], seq 2926133714, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
23:10:50.525398 IP 192.168.1.70.2106 > 192.168.1.1.55598: Flags [S.], seq 2509536992, ack 2926133715, win 29200, options [mss 1460,nop,nop,sackOK,nop,wscale 7], length 0
23:10:50.525493 IP 192.168.1.1.55598 > 192.168.1.70.2106: Flags [.], ack 1, win 2053, length 0
23:10:50.526496 IP 192.168.1.70.2106 > 192.168.1.1.55598: Flags [P.], seq 1:187, ack 1, win 229, length 186
23:10:50.526555 IP 192.168.1.1.55598 > 192.168.1.70.2106: Flags [.], ack 187, win 2052, length 0
对于端口 10241 :
23:06:38.490407 IP 192.168.1.1.55536 > 192.168.1.70.10241: Flags [S], seq 1465108966, win 8192, options [mss 1460,nop,wscale 8,nop,nop,sackOK], length 0
23:06:38.490431 IP 192.168.1.70.10241 > 192.168.1.1.55536: Flags [R.], seq 0, ack 1, win 0, length 0
23:06:38.990784 IP 192.168.1.1.55536 > 192.168.1.70.10241: Flags [S], seq 1465108966, win 8192, options [mss 1460,nop,nop,sackOK], length 0
23:06:38.990815 IP 192.168.1.70.10241 > 192.168.1.1.55536: Flags [R.], seq 0, ack 1, win 0, length 0
nmap -sT -O localhost
的结果:
Starting Nmap 6.47 ( http://nmap.org ) at 2017-02-17 23:12 CET
Nmap scan report for localhost (127.0.0.1)
Host is up (0.000084s latency).
Other addresses for localhost (not scanned): 127.0.0.1
Not shown: 994 closed ports
PORT STATE SERVICE
25/tcp open smtp
80/tcp open http
111/tcp open rpcbind
2106/tcp open ekshell
3306/tcp open mysql
7777/tcp open cbt
Device type: general purpose
Running: Linux 3.X
OS CPE: cpe:/o:linux:linux_kernel:3
OS details: Linux 3.7 - 3.15
Network Distance: 0 hops
和 netstat -tulpn(删除无用的端口):
tcp 0 0 0.0.0.0:56069 0.0.0.0:* LISTEN 473/sshd
tcp 0 0 0.0.0.0:3306 0.0.0.0:* LISTEN 883/mysqld
tcp6 0 0 :::9014 :::* LISTEN 3796/java
tcp6 0 0 :::2106 :::* LISTEN 3796/java
tcp6 0 0 :::7777 :::* LISTEN 3811/java
我没有为 Linux 机器配置防火墙(这是一台测试机器,而不是实际机器),只有默认的 Debian IPtable。有人知道我可以做什么来打开这个端口吗?
最佳答案
根据您的 netstat 命令,tcp 10241 没有在监听。 您可以尝试以下检查。
netstat -a|grep 10241
nc -u localhost 10241
这会给你一些指示。可能是它正在监听 UDP 端口。
关于linux - Debian 8.5下无法打开10241端口,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42308331/