mojira.dev
MC-473

Linux users can't open to lan because it's binded to 127.0.0.1

When you click on "open to lan", the game takes the loopback interface as the one to get the ip address. so it binds to 127.0.0.1 and no one but you can connect to the game.

Linked issues

Comments 32

can you direct connect to the IP shown?

This happened to me, but for 127.0.0.2.
It turns out Minecraft uses the local hostname to get the IP facing LAN, but /etc/hosts only has a default 127.0.0.2 IP.
I'm using NetworkManager and I think it fails to alias the hostname to the IP it gets from DHCP.
To quote from IRC:
"the way I did it in one of my node.js projects is I got the IP of the first externally visible network interface (node.js provides that information, Java may have something similar)"

I forgot to mention, to workaround this problem, add "external-ip local-hostname" to /etc/hosts.
You can get the external-ip with /sbin/ifconfig and the local-hostname with /bin/hostname.

the ip shown is 127.0.0.1. you can't connect to localhost if you are not running minecraft in localhost πŸ™‚

Just checking

22 more comments

Grum, if you are prepared to say you are 100% sure that this always happens via a user firewall/network configuration issue, perhaps then, opening to lan failure could trigger a screen explaining several troubleshooting steps the user could take, similar to how browsers often deal with network failure. Abiding by the principle of giving helpful error messages, and making it clear that system configuration is at the heart of the matter.

I'm 99.9999% sure it is always firewall/network configuration and obviously there is no way to detect this.

There is no 'failing' in 'open to Lan' because you ALWAYS have a loopback device it can open a port on. This means there is no way to display such a screen.

IMHO People who use a firewall should know how to use it πŸ™‚

Fair enough.

Is this still a concern in the current Minecraft version? If so, please update the affected versions in order to best aid Mojang ensuring bugs are still valid in the latest releases/pre-releases.

The main issue was fixed, if you still having difficulties connecting check you firewall/router settings. For additional technical support please use the Mojang Support Center.

pancake

Erik Broes

Community Consensus

Minecraft 1.4.1, Minecraft 1.4.2, Minecraft 1.4.4

Retrieved