jammsen / docker-sons-of-the-forest-dedicated-server

Docker container to easily provision and manage Sons of the Forest Dedicated Server with Wine
https://hub.docker.com/r/jammsen/sons-of-the-forest-dedicated-server
134 stars 20 forks source link

Can't find game server #51

Open VegetablCat opened 1 month ago

VegetablCat commented 1 month ago

Have you read the Important information text above

Current behavior

I'm sure I have a public ip, and I have correctly set the port mapping and released the designated port, but I can't find the game server through ip direct connection, no matter whether I use the public IP or the LAN IP under the same router as the server.

Desired behavior

i hope it can work correctly

Links to screenshots

e462d9c92b8f8f03fda281742e03c2f4 dcd6428351541d0e615006cdbf43f1ba

To Reproduce

no way

Software setup

Hardware setup

Additional context

No response

gitzec commented 1 month ago

It should show up in the game's online server browser as dedicated server with the name you gave it.

VegetablCat commented 1 month ago

It should show up in the game's online server browser as dedicated server with the name you gave The online server browser is not displayed either.

VegetablCat commented 1 month ago

DSL [Self-Tests] [Networking] Testing server ports against public ip (public ip)_...

DSE [Self-Tests] [Networking] UDP GamePort [8766] is closed. Please fix and restart.

DSE [Self-Tests] [Networking] UDP QueryPort [27016] is closed. Please fix and restart.

DSE [Self-Tests] [Networking] UDP BlobSyncPort [9700] is closed. Please fix and restart.

DSE [Self-Tests] [Networking] Some ports are closed or already in use and the game server will not be accessible. You may need

to setup port forwarding and open them in your firewall, or change port numbers if they are used by some other software. Alterna

tively, consider using the LanOnly configuration if you didn't intend to make your server public. Please fix and restart.

DSE [Self-Tests] Please restart the server.

I am quite sure that I have set up the correct port forwarding and have not occupied ports 8766, 27016 and 9700. Even if I turn on DMZ, I will be prompted as above.

VegetablCat commented 1 month ago

DSL [自检] [网络] 针对公共 IP (public ip) 测试服务器端口_...

DSE [自检] [网络] UDP GamePort [8766] 已关闭。请修复并重新启动。

DSE [自检] [网络] UDP QueryPort [27016] 已关闭。请修复并重新启动。

DSE [自检] [网络] UDP BlobSyncPort [9700] 已关闭。请修复并重新启动。

DSE [自检] [网络] 某些端口已关闭或已在使用中,无法访问游戏服务器。您可能需要

设置端口转发并在防火墙中打开它们,或者更改端口号(如果它们被其他软件使用)。奥特纳

如果您不打算公开服务器,请考虑使用 LanOnly 配置。请修复并重新启动。

DSE 【自检】请重启服务器。

我非常确定我已经设置了正确的端口转发,并且没有占用端口 8766、27016 和 9700。即使我打开 DMZ,我也会收到如上所述的提示。

and i have closed firewall

gitzec commented 1 month ago

If you set up all the port forwardings correctly... Do you have a public ipv4 address at all?

VegetablCat commented 1 month ago

如果您正确设置了所有端口转发...你有公共 ipv4 地址吗? I'm sure I have a public ip, and I can SSH to the server from other places, and I used to be able to play on the server normally, but not since I changed the router to another room. And even if I don't have a public ip, I should be able to connect to the server through a LAN ip, but I still can't. I'm also quite sure that the port is not occupied.

gitzec commented 1 month ago

Please compare your setup with this scetch:

  1. you have some kind of cable with your ISP on the other end
  2. your isp gave you a device (which?) which turns the cable into an ethernet port
  3. you use a router (which?) to do nat between your LAN and the public IPv4 you got from your ISP
  4. you configured port forwarding on your router to get incoming connections to your router be forwarded to your docker host
  5. your docker host is inside this LAN (static ip or static dhcp lease) and has access to the internet
  6. your docker host accepts incoming requests on given ports.
  7. your docker container is running on this host and has port forwarding for incoming connections for given ports
VegetablCat commented 1 month ago

请将您的设置与此 scetch 进行比较:

  1. 你有某种电缆与你的ISP在另一端
  2. 您的 ISP 为您提供了一个设备(哪个?),可以将电缆变成以太网端口
  3. 您使用路由器(哪个?)在LAN和从ISP获得的公共IPv4之间执行NAT操作
  4. 您在路由器上配置了端口转发,以便将路由器的传入连接转发到 Docker 主机
  5. 您的 docker 主机位于此 LAN(静态 IP 或静态 DHCP 租约)内,并且可以访问 Internet
  6. 您的 Docker 主机接受给定端口上的传入请求。
  7. 您的 Docker 容器在此主机上运行,并且具有给定端口的传入连接的端口转发

I am sure that my configuration meets the above conditions and I can connect to the server normally before I move the router.

VegetablCat commented 1 month ago

246f61fc070196da45e57928796359dd 37c0c5318ecb2d7dbd77517a0a59a027 5853bd0ae3f60a21a930f18ee2828066 cbd19458a2284679a448a887599f5059 97994247caade5c3272287d2a3566113 aa23e36a3cd4b5b5d70b84c99960b55c These are my configurations (only one of them is captured in three port forwarding, and the other two port configurations are similar to this one). I'm sure there is no problem, because I can play PalWorld running on the same server normally, and I can also access my server on the external network.

jogerj commented 1 month ago

Your setup looks really weird. I'm guessing from your setup, you have an ISP modem/router at 192.168.1.1 that hosts the DHCP server, then an access point at 192.168.1.3? In which case then the port forwarding should be configured at the ISP router and the repeater/access point left alone. The port forwarding rule should target the host IP address (your PC's internal IP), not the access point's.

As for why PalWorld works, you should be able to replicate the same port forwarding setup as PalWorld and it should work.

Usually when port forwarding doesn't work it's one of these scenarios:

  1. Incorrect configuration: wrong target IP/ports.
  2. you're on VPN (for obvious reasons won't work, at least not from public net)
  3. your ISP only gives you IPv6 (DS Lite, shared IPv4) -> in your case it doesn't seem like it
  4. your ISP blocks ports by default -> you need to contact your ISP about it

If you're sure the ports should be accessible anyway or you have workaround to let you access the server (e.g. via 4in6 tunnel), you can disable the self tests in dedicatedserver.cfg:

  "SkipNetworkAccessibilityTest": true,
  "LanOnly": true,

Setting LanOnly will also prevent your server to be publicly listed on servers list (you need to use direct connect)

VegetablCat commented 3 weeks ago

Your setup looks really weird. I'm guessing from your setup, you have an ISP modem/router at 192.168.1.1 that hosts the DHCP server, then an access point at 192.168.1.3? In which case then the port forwarding should be configured at the ISP router and the repeater/access point left alone. The port forwarding rule should target the host IP address (your PC's internal IP), not the access point's.

As for why PalWorld works, you should be able to replicate the same port forwarding setup as PalWorld and it should work.

Usually when port forwarding doesn't work it's one of these scenarios:

  1. Incorrect configuration: wrong target IP/ports.
  2. you're on VPN (for obvious reasons won't work, at least not from public net)
  3. your ISP only gives you IPv6 (DS Lite, shared IPv4) -> in your case it doesn't seem like it
  4. your ISP blocks ports by default -> you need to contact your ISP about it

If you're sure the ports should be accessible anyway or you have workaround to let you access the server (e.g. via 4in6 tunnel), you can disable the self tests in :dedicatedserver.cfg

  "SkipNetworkAccessibilityTest": true,
  "LanOnly": true,

Setting LanOnly will also prevent your server to be publicly listed on servers list (you need to use direct connect)

I set the router (192.168.1.3/192.168.3.1) to DMZ in the ISP modem, but my computer and server are connected to the router (192.168.3.1), that is, in the same LAN, even so, I can't connect to the server. However, it is very strange that I downloaded someone else's image of the dedicated server for the children of the forest and ran it without any problem. However, once the router network cable is loosened and reconnected, even if the container is completely deleted and the directory is mounted and the container is rebuilt, it will report that the port is closed.

jammsen commented 2 weeks ago

Im not sure from reading, is this issue solved or still ongoing? @VegetablCat

jogerj commented 2 weeks ago

Maybe the router which your computer is connected to is on a different NAT. The router needs to be set as an access point only without its own DHCP server (use DHCP server from main modem/router)

milobluebell commented 2 weeks ago

Maybe the router which your computer is connected to is on a different NAT. The router needs to be set as an access point only without its own DHCP server (use DHCP server from main modem/router)

  1. Means it must use host mode in docker, right?
  2. But After i installed that image and docker's everything running seemed ok, it shown me"cannot get public ip from steam" on my tencent-cloud vps in the end
jogerj commented 2 weeks ago

Means it must use host mode in docker, right?

Not necessary. As long as you specify the exposed ports in docker, the ports are exposed to the host machine (and assuming default firewall settings, the private network). The game server is then accessible at your-host-machine-ip-address:8766. Forward your ports to public internet then it's accessible at your-public-ip:8766

@milobluebell your issue might be different since it's a VPS setup. You should start a new issue including your configs and setup description.

VegetablCat commented 2 weeks ago

Im not sure from reading, is this issue solved or still ongoing? @VegetablCat

it still doesn't work,

VegetablCat commented 2 weeks ago

Im not sure from reading, is this issue solved or still ongoing? @VegetablCat

Although I put the server and the client in the same LAN (under the same router), the client still can't find the server through the LAN ip of the server, but the servers of other games can run normally.

VegetablCat commented 2 weeks ago

Maybe the router which your computer is connected to is on a different NAT. The router needs to be set as an access point only without its own DHCP server (use DHCP server from main modem/router)

I'm sure they are under the same network segment, and the server running other games on the same server is still normal, but only the server of the son of the forest can't run normally.

jogerj commented 2 weeks ago

This seems like the problem basically is an issue with your port forwarding setup and not the dedicated server container. Steps you can try to test and troubleshoot:

  1. On the host machine docker run -it --rm -p "8766:8766/udp" networkstatic/iperf3 -s -p 8766
  2. Then run iperf as client docker run -it --rm networkstatic/iperf3 -c <your-public-ip> -p 8766 -4 -u -> get ip from e.g. curl -4 checkip.amazonaws.com
  3. If it fails, then the issue is with your port forwarding setup. Repeat for port 9700 and 27016

Also as I mentioned previously, your setup looks like you have double NAT. You need to port forward on both routers serving as gateways or configure the secondary router to use the same DHCP (so they can be on the same NAT layer), then port forward once at the main router.

VegetablCat commented 2 weeks ago

This seems like the problem basically is an issue with your port forwarding setup and not the dedicated server container. Steps you can try to test and troubleshoot:

  1. On the host machine docker run -it --rm -p "8766:8766/udp" networkstatic/iperf3 -s -p 8766
  2. Then run iperf as client -> get ip from e.g. docker run -it --rm networkstatic/iperf3 -c <your-public-ip> -p 8766 -4 -u``curl -4 checkip.amazonaws.com
  3. If it fails, then the issue is with your port forwarding setup. Repeat for port 9700 and 27016

Also as I mentioned previously, your setup looks like you have double NAT. You need to port forward on both routers serving as gateways or configure the secondary router to use the same DHCP (so they can be on the same NAT layer), then port forward once at the main router.

QQ_1722997063407 This should not be a problem of port forwarding. First of all, I have configured the server of other games, and the configuration of the son of the forest is the same as them, but other game servers can operate normally, except the son of the forest. Secondly, my client and server can't access the child server of the forest under the same router, which means it's not a port forwarding problem.

VegetablCat commented 2 weeks ago

c9a929bc1a47277b31acf0e82eec5ec6

jogerj commented 1 week ago

c9a929bc1a47277b31acf0e82eec5ec6

You have a double NAT. Otherwise your router wouldn't have two IP addresses assigned. Port forward on both or remove the NAT layer altogether.