Jump to content

No IPv6 with 1.12 and above.


Kuhdolf

Recommended Posts

Hi

 

Sorry to bother you, but I've spent hours with this and can't get any further. 

 

In Germany we now have a lot of cheap IPv6-only client networks (so called dual stack "light"). I've got clients who can deal with IPv4 and IPv6 while others only have a proper IPv6 and a NAT-based ("light") IPv4 stack. These "light" clients can only connect over IPv6 to Minecraft servers. 

 

Unfortunately IPv6 seems no longer to work for me with the newer Forge servers. IPv6 works for me with 1.10.2 for a long time without any problems.  

 

I've set up a 1.12 server. Accepting connections for IPv4 and IPv6 (just like the vanilla server) never worked for me with Forge. So I have set server-ip (config file: "server.properties") to my servers IPv6 address to make the server IPv6 only:

server-ip=2a01\:238\:42b5\:cd00\:d0a4\:b9f\:3a6b\:fe36

 

I use the same configuration for 10.2 where it works without any problem for months. After starting the 1.12 server I couldn't see any error in my fml-server-latest.log. Minecraft Forge seems to start normally. In the latest.log the IPv6 address is also shown correctly:

[23:53:36] [Server thread/INFO]: Starting Minecraft server on 2a01:238:42b5:cd00:d0a4:b9f:3a6b:fe36:25565

 

But I can't connect to the server ("connection refused") and this has an easy reason: When I run the lsof command on my server I see for my Java process:

# lsof -i -n
COMMAND  PID        USER   FD   TYPE     DEVICE SIZE/OFF NODE NAME
java    7113   minecraft   68u  IPv4 3509573306      0t0  TCP 58.107.254.54:25565 (LISTEN)

 

 

The address 58.107.254.54 is obviously not my IPv6 address but also not my IPv4 address. It's completely bogus.

It looks like if the Forge 1.12 server just pushes the IPv6 address somehow into an IPv4 socket.

 

I've tested this with the latest Forge versions for Minecraft 1.12, 1.12.1 and 1.12.2 under Ubuntu 16.4 (server) with openjdk-8-jre-headless.

 

Any of you guys got a Forge 1.12 Linux server running on IPv6? Which distribution do you use? By the way: Why dual stack doesn't work with Forge? Or am I doing something wrong? Any small hint is welcome. 

 

Regards

Oliver

 

 

(Please forgive mistakes. I try hard, but I'm not a native speaker.) 

Edited by Kuhdolf
Link to comment
Share on other sites

I think it could be the setProperty call line 31 in FMLTweaker.java what causes my problems:

See:

System.setProperty("java.net.preferIPv4Stack", "true"); //Lets do this as early as possible. Vanilla does it in Main.main

 

https://github.com/MinecraftForge/FML/blob/master/src/main/java/net/minecraftforge/fml/common/launcher/FMLTweaker.java

 

What does this command do in a dual stack environment? Why this property is set?

Edited by Kuhdolf
Link to comment
Share on other sites

1.12 updated the version of various libraries, including Netty (4.0.23 -> 4.1.9).

 

This would seem to be the culprit: https://github.com/netty/netty/issues/5657

 

I can't find a call setting "java.net.preferIPv4Stack" in Main.main, and the FML code dates back to July 2014 (https://github.com/MinecraftForge/FML/commit/ab52901b8b47a525e2719cf280327e97bad7f91e) so it's probably no longer needed.

Edited by quadraxis
formatting
Link to comment
Share on other sites

On 27.11.2017 at 2:41 AM, quadraxis said:

There's a PR for this issue open here:

 

https://github.com/MinecraftForge/MinecraftForge/pull/4547

 

Yes, there was a corresponding change. I've tested the new version 14.23.1.2556. The Forge server now behaves as expected. It opens an IPv6 socket with the correct address. But if I want to connect directly over IPv6 to my server from the Forge client, I run into a timeout:

Failed to connect to the server io.netty.channel.ConnectTimeoutException: connection timed out:

 

However, the server can be reached via IPv6. The port is open. So here's what I did: I've set a simple proxy_pass rule for my Minecraft server in my Nginx server:

 

server {
 15         listen 25565;
 17 
 18         #TCP traffic will be proxied a proxied server
 20         proxy_pass [2a01:238:42b5:cd00:d0a4:b9f:3a6b:fe36]:25565;
 21     }

 

Then I connected from my Forge (14.23.1.2556) client over IPv4 to my Nginx server. And lo and behold, it worked! My Nginx server could establish an IPv6 connection to the Forge server without any problems. But if I try to connect directly to the IPv6 server, it doesn't work with the Forge client. The client tries to connect and after a while the above error message is displayed. To test the direct IPv6 connection I use the FQDN computercult6.finnx.de in my client.This FQDN only resolves to the IPv6 address of my IPv6 server and to nothing else. 

 

I also could connect with the vanilla client directly to computercult6.finnx.de (don't have any mods loaded). Therefore, I suspect that the Forge client is still trying to establish an IPv4 connection even if I use computercult6.finnx.de as server. But to be able to say that for sure, I would have to sniff with wireshark. But thank you very much for your quick help so far. I'll be back after I run some more tests. 

 

Edited by Kuhdolf
Link to comment
Share on other sites

12 hours ago, quadraxis said:

Can you see if a Forge client can connect if you pass -Djava.net.preferIPv4Stack=false as a launch argument (to the client)?

This works! OK, so that solves my last problem. I now have an IPv6 server and the client connects directly to it. Thank you very much!

 

And also many thanks to the developers for the quick patch. 

Edited by Kuhdolf
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.