Minecraft server can't connect from WAN



  • I've had a Minecraft server for a while now, and somewhat recently (I don't play often enough to pin it to a specific week) it is impossible to connect from a WAN address. I've run out of ideas on how to fix it.

    Here are the symptoms:

    • Server appears online from multiplayer list.
    • Joining the server results in falling into the void while chunks don't load or loading extremely slowly (if flying around in creative)
    • Inside f3 info on the client, Rx packets shows initially 1-5 and eventually 0 before timeout. Normal good connection sees hundreds at the minimum. Tx packets show in the teens to twenties which seems normal from a good connection.
    • Server-side, the player does show in logs, and currently logged-in list (if server is run with a gui).
    • Commands are not executed, and block updates (like stepping on pressure plates) don't happen. Blocks broken don't drop etc..
    • Disconnected with "Connection Lost Internal Exception: java.net.SocketException: Connection reset" after exactly 1 minute each time (sometimes simply "connection lost timed out").

    Here are some details:

    • Server is windows 10 pro, and java is whitelisted in windows firewall
    • Direct connection to the LAN address works perfectly
    • Firewall/router is PFSense 2.6.0 (running on Hyper-V from same box) with NAT port forward rules on mc server port, and Pure NAT reflection (connecting to the hostname gets reflected and appears to the mc-server as a WAN connection which originates from the gateway. The exact same behavior is observed by a buddy of mine however who is a properly remote client).
    • Other servers (not Minecraft) work perfectly from WAN with identical (except port and address) NAT rules.
    • I've restarted everything in every combination, re-installed java, re-installed Minecraft, installed a new Minecraft server (latest version 1.19)

    I can only assume some windows or pfsense update broke something, but I'm not even sure where to go from here. There's clearly some amount of communication in both ways here because the world and player inventory start to load (if slowly), and in the other direction the server is aware of which player is logged in, but it would seem the connection is never fully established (and times out). What can I do to find out why the connection is not made?

    Edit

    re comments: I was able to host a python -m http.server from the windows 10 pc (server) which is accessible from wan with no issue (I connected from my phone over LTE).

    As for connecting the MC client, I am able to watch the connection in pftop by filtering for my server port, and the connection (client pc to router & router to server pc) shows ESTABLISHED:ESTABLISHED then when the connection is lost, the connections show TIME_WAIT:TIME_WAIT, which would normally indicate an intentionally closed connection. Why would minecraft be intentionally closing the connection? how can I determine why the connection was closed from the application side?



  • After many various combinations of minecraft version, java version, server.properties, windows firewall, and PFSense NAT/firewall; I decided to install minecraft server on an Ubuntu 20.04 VM (on the same hardware), which worked perfectly. It may be possible that a clean re-installation of Windows 10 Pro would have solved the issue, however I did not want to loose other things I had setup on that installation. In order to install on Ubuntu I followed a combination of https://minecraft.fandom.com/wiki/Tutorials/Ubuntu_startup_script , and https://unix.stackexchange.com/a/612118/538346 to how to setup minecraft as a service which will run at boot, and still be able to fully interact with the server.


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2