【问题标题】:Unable to open port 10241 under Debian 8.5Debian 8.5下无法打开10241端口
【发布时间】:2017-02-17 22:17:49
【问题描述】:

我有一个在虚拟化 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 !!

同时,我 tcdump 来自 Linux 机器的数据包并拥有 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。有人知道我可以做些什么来打开这个端口吗?

【问题讨论】:

    标签: linux binding port


    【解决方案1】:

    根据您的 netstat 命令,tcp 10241 没有在监听。 您可以尝试以下检查。

     netstat -a|grep 10241
    
     nc -u localhost 10241
    

    这会给你一些指示。可能是在监听 UDP 端口。

    【讨论】:

    • 第一个命令没有任何返回,第二个命令被发送但没有任何反应
    • 还有其他想法吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-09-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多