I've got a problem. I'm making server for Minecraft server in Raspberry Pi 3 B+ and I want to open port 25565. I can't do it. I looked up many forums and videos and all people make this with setting router. But I want to do it without setting router. Please, help me and say how can I do it? Best Regards, Mammadli Elnur.
A Minecraft server uses port 25565 by default. The Minecraft server itself is a program that runs on a computer. The computer has an ip address, maybe 192.168.10.11, but there are running many programs, for example also a ssh server and a web server. If you want to connect to one of this server it is not enough to address it only with the ip address of the computer. It does not know what running server do you want to connect to. For this is the port number. The ssh server has default port 22, the web server has default port 80 and the Minecraft server has default port 25565. If you want to connect to it then you have to connect to 192.168.10.11:25565.
This means a running Minecraft server has always its port open, otherwise you won't be able to connect to it. You can check it on the RasPi with, for example:
rpi ~$ sudo ss -tlpn State Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 128 *:22 *:* users:(("sshd",pid=4168,fd=3)) LISTEN 0 128 :::22 :::* users:(("sshd",pid=4168,fd=4))
This is the output with a running ssh daemon (sshd) on port 22. I don't have a Minecraft server running. You should see a similar output for it with port 25565.
The problem now is that you can play Minecraft only on your local area network. Other players from the internet cannot access the port 25565 on the RasPi because the internet router blocks this. The solution in this case is to open port 25565 on the router to forward packages to this port on 192.168.10.11.
To make a long story short: just play Minecraft with your friends on your local area network without doing something on your internet router. If you want to give other players from the internet access to your Minecraft server to play with you, you must configure the router to open port 25565 and forward packages to your RasPi (port forwarding).
If you do not have access to the internet router to configure it then you may consider to use a ssh reverse tunnel. But I can tell you, that really does not make things easier.