运行 Minetest 服务器

运行 Minetest 服务器

我希望这是提出此问题的正确的 stackexchange 网站。

我正在尝试从我的计算机(Linux)运行 minetest 服务器,但无法从不同网络中连接到互联网的另一台计算机连接它。我正在使用 minetestserver 运行 minetest 服务器,它给出以下输出:

2016-07-13 20:45:22: WARNING[Main]: Couldn't find a locale directory!
2016-07-13 20:45:22: [Main]: Automatically selecting world at [/root/.minetest/worlds/world]
2016-07-13 20:45:22: WARNING[Main]: NodeDefManager: Ignoring CONTENT_IGNORE redefinition
2016-07-13 20:45:22: ACTION[Main]:         .__               __                   __   
2016-07-13 20:45:22: ACTION[Main]:   _____ |__| ____   _____/  |_  ____   _______/  |_ 
2016-07-13 20:45:22: ACTION[Main]:  /     \|  |/    \_/ __ \   __\/ __ \ /  ___/\   __\
2016-07-13 20:45:22: ACTION[Main]: |  Y Y  \  |   |  \  ___/|  | \  ___/ \___ \  |  |  
2016-07-13 20:45:22: ACTION[Main]: |__|_|  /__|___|  /\___  >__|  \___  >____  > |__|  
2016-07-13 20:45:22: ACTION[Main]:       \/        \/     \/          \/     \/        
2016-07-13 20:45:22: ACTION[Main]: World at [/root/.minetest/worlds/world]
2016-07-13 20:45:22: ACTION[Main]: Server for gameid="minetest" listening on 0.0.0.0:30000.

如果一切成功的话这确实应该是输出。

当服务器运行时,

netstat -na | grep 30000

给出

udp        0      0 0.0.0.0:30000           0.0.0.0:*

我还配置了路由器的端口转发功能。我尝试从另一台连接到互联网的机器 ping 我的公共 IP,但没有成功。

我尝试使用netcat以了解一些情况,但并没有得到太多信息,部分原因是我真的不知道该怎么做。尽管如此,我开始监听 30001 端口,并使用 netcat 从同一台机器使用网络中的本地 IP(192.168.0.102)发送数据包,并且成功了。但是当我使用我的公共 IP 并从远程机器发送数据包时,它没有显示任何内容。

当我从另一台机器跟踪路由到我的公共 IP 时,它实际上并没有到达我的地址,而是以其他地址结束;当我从我的服务器机器跟踪路由到 google.com 或任何其他网站时,我可以看到所有请求都通过来自同一网络的 IP。我真的不知道这是否意味着什么。

我发布了这个问题拱门论坛我认为这可能是与操作系统相关的问题,但我并没有真正成功。

编辑 :

nmap从远程位置运行后的输出:

> sudo nmap -sU -sS <public ip> -p 70-80
Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-23 13:43 IST
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 2.65 seconds

> sudo nmap -sU -Pn -sS <public ip> -p 70-80
Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-23 13:43 IST
Nmap scan report for <public ip>
Host is up (0.12s latency).
PORT   STATE         SERVICE
70/tcp filtered      gopher
71/tcp filtered      netrjs-1
72/tcp filtered      netrjs-2
73/tcp filtered      netrjs-3
74/tcp filtered      netrjs-4
75/tcp filtered      priv-dial
76/tcp filtered      deos
77/tcp filtered      priv-rje
78/tcp filtered      unknown
79/tcp filtered      finger
80/tcp filtered      http
70/udp open|filtered gopher
71/udp open|filtered netrjs-1
72/udp open|filtered netrjs-2
73/udp open|filtered netrjs-3
74/udp open|filtered netrjs-4
75/udp open|filtered priv-dial
76/udp open|filtered deos
77/udp open|filtered priv-rje
78/udp open|filtered vettcp
79/udp open|filtered finger
80/udp open|filtered http
Nmap done: 1 IP address (1 host up) scanned in 8.15 seconds

sudo nmap -sU -Pn -sS <public ip> -p 29999-30005
Starting Nmap 6.47 ( http://nmap.org ) at 2016-07-23 13:50 IST
Nmap scan report for <public ip>
Host is up.
PORT      STATE         SERVICE
29999/tcp filtered      unknown
30000/tcp filtered      unknown
30001/tcp filtered      pago-services1
30002/tcp filtered      unknown
30003/tcp filtered      unknown
30004/tcp filtered      unknown
30005/tcp filtered      unknown
29999/udp open|filtered unknown
30000/udp open|filtered unknown
30001/udp open|filtered unknown
30002/udp open|filtered unknown
30003/udp open|filtered unknown
30004/udp open|filtered unknown
30005/udp open|filtered unknown

答案1

矿山测试维基百科指出,您需要启用 UDP 和 TCP 数据包的转发。这可能是您的问题。如果它没有帮助,请执行以下操作:

  1. 首先调试本地网络上不同计算机的连接。从同一台机器连接到本地 IP 不起作用 - 此通信会自动通过环回设备路由,并且永远不会离开您的机器。

  2. 验证您的公共 IP 是否可远程访问,并且确实允许在端口 30000 上进行连接。许多路由器会丢弃来自外部网络的 ICMP(ping)数据包,作为一种“安全”措施来阻止跟踪。相反,请尝试使用 nmap 等工具从远程位置扫描您的公共 IP 端口。这还应该会告诉您您的 ISP 是否阻止了连接。端口范围 70 到 80 的示例:

    nmap -sU -sS 127.0.0.1 -p 70-80

边注: Arch 论坛已经提到了这一点 - 不要以 root 身份运行公开的游戏服务器。有太多事情可能会出错。即使只是为了测试,这也是一个非常糟糕的主意。编号大于 1024 的端口不需要特权访问,您可以使用任何普通用户帐户登录并运行服务器进程。即使对于特权端口,您也不需要成为 root,请检查问题。

编辑: 是的 - 您的 IP 显然是可访问的,但没有显示它正在将数据包转发到本地网络(在这种情况下,即使本地网络上没有任何设备在等待,端口 30000 也应该显示 TCP 处于 OPEN 状态)。它可能被 ISP 阻止,也可能是由于路由器没有做它应该做的事情。我认为仅凭这些信息我无法进一步帮助您 - 您确实应该测试这些东西:

  1. 从本地网络中的另一台机器连接到 minetest 服务器或使用 Virtual Box 和桥接适配器进行模拟。

  2. 测试路由器转发是否可以使用一些更容易验证的方法,例如:按照 Morn 在 arch 论坛中的建议,将 TCP 端口 80 转发到 apache。

相关内容