Minecraft Server

I'm trying to set up a Minecraft server. I've got it running, and when I netstat -l I see it listening on port 25565, but when I try to connect to it from home it says it cannot connect. Any ideas?

6 Replies

Hello Javaguy418,

That's peculiar, can you check your firewall to see if there's any kind of rule in place to block connectivity to your server? For example, do you have a reject all? Have you tried making exceptions for your computer's IP address (if you're not sure where it is, whatsmyip.org can tell you). If you need a little reference point for firewall rules, you can check here:

https://www.linode.com/docs/security/fi … h-iptables">https://www.linode.com/docs/security/firewalls/control-network-traffic-with-iptables

I hope this helps!

Regards,

Soh

I used the iptables command to accept connections:

 iptables -A INPUT -p tcp --dport 25565 -j ACCEPT

Is that correct?

Iptables listing:

# iptables -L
Chain INPUT (policy ACCEPT)
target     prot opt source               destination
ACCEPT     tcp  --  anywhere             anywhere             tcp dpt:25565

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination

Netstat after starting server:

 netstat -l | grep 25565
tcp6       0      0 0.0.0.0:25565           [::]:*                  LISTEN

Hello,

This would allow you to accept on port 25565, so the issue may be on the home computer's side. What exactly are you doing to connect? Just hitting the Multiplayer and entering the IP on your home computer? What do you see when you do this?

Regards,

Soh

When I check my web server with netstat -l, it shows the server is listening on both tcp and tcp6 protocols:

tcp 0 0 [redacted]:https : LISTEN

tcp6 0 0 [redacted]:https [::]:* LISTEN

When I use iptables command directly I use -I to avoid issues with appending. For regular stuff, on Ubuntu I use ufw, easier.

I just did a test with a simple Spark Java server then a simple Python server and found that Java prefers to bind to tcp6. This guy found the same, use the JVM option he did and it will fix your problem:

http://notes.richdougherty.com/2011/09/ … -ipv6.html">http://notes.richdougherty.com/2011/09/minecraft-server-and-ipv6.html

Thanks! I think we're making progress here. I've added -Djava.net.preferIPv4Stack=true to the java startup, but then when I netstat it still show tcp6.

netstat -an | grep 25565
tcp6       0      0 0.0.0.0:25565           :::*                    LISTEN

@javaguy418:

Thanks! I think we're making progress here. I've added -Djava.net.preferIPv4Stack=true to the java startup, but then when I netstat it still show tcp6.

netstat -an | grep 25565
tcp6       0      0 0.0.0.0:25565           :::*                    LISTEN

Check your Minecraft server logs, or system logs, I'm guessing the server can't come up on tcp, only tcp6. See if you can run another server on the same port and connect to it (after making sure the Minecraft server is shut down) - well first make sure netstat shows it's listening:

python -m SimpleHTTPServer 25565

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct