I have a Minecraft server running on a server. It runs on port 25565 and I can connect to it at home.

At school, however (it's a boarding school), due to the port blocking, I can't connect to the server (or any other), this is because only traffic from certain ports can get outside the network. Having talked to the head of IT, he's happy to open a port so that I can connect (we have a very accommodating head of IT) however, after some looking around, I discovered that Minecraft uses a seemingly random port over 50000 to connect to a server.

I was wondering how I could force Minecraft to use one port to connect to the server?
Then I can pass it on to the head of IT, so he can unblock it.


this is because only traffic from certain ports can get outside the network

Are you quite sure? Because if that was how it worked, you would be unable to connect to the Internet. "Random port over 50000" sounds like you're talking about the ephemeral port range.

It is more likely that your school restricts the remote ports that you can access. Your network admin would have to allow outbound traffic to port 25565, or alternatively you could run your server on a port that is already allowed. Port 80's a pretty safe bet.

The local port Minecraft opens on your machine is randomly assigned by the operating system and should not factor into this at all. Pretty much any program that opens a network connection has to open up a random port to receive data.

  • "Because if that was how it worked, you would be unable to connect to the Internet." That depends on the ports that are open. As far as I know, port 80 and 443 are always open. – Kevin Aug 2 '13 at 12:45
  • 1
    @Kevin Unless you're running a web server on your computer, those are remote ports. No sane operating system would use either of those as ephemeral ports. – a cat Aug 2 '13 at 12:50
  • umm.... Where did I say that? You said connecting to the internet is impossible if "only traffic from certain ports can get outside the network". This is simply not true. – Kevin Aug 2 '13 at 12:51
  • 1
    @Kevin If a network is restricting the ports that outbound traffic comes from, they'd have to open up the entire ephemeral range and hope that nobody uses Windows XP. Otherwise, you can't establish TCP/UDP connections unless the OS randomly assigns the program a port that happens to be allowed. – a cat Aug 2 '13 at 12:56
  • 1
    @Kevin That's what I'm assuming as well. That's filtering based on destination port though. Filtering based on source port (as the OP claimed) doesn't make a lot of sense. – a cat Aug 2 '13 at 13:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.