Configuring Firewall Rules and Filters for Minecraft Print

  • minecraft, filters, firewall, ubuntu, windows
  • 0

Configuring Firewall Rules And Filters For Minecraft

You will learn how to setup the firewall rules needed to run a Minecraft server. I will be assuming you are using sudo for commands or are the root user for this guide. I will also be assuming you are running the Java Edition of minecraft. 

 

  • Minecraft Java Edition by default has the following TCP and UDP Port 25565. This is the port I will be assuming you are using in this guide.

 

Pterodactyl Ports

In the case that we want to set up Pterodactyl, we will have to assign them under the allocation setting, using the 'Assign New Allocations' feature. If you are looking to set up Pterodactyl on your server, you can follow our Pterodactyl Panel Installation Guide.

We will want to assign the port we are using for our Minecraft server here. The one being:

  • TCP/UDP Port 25565

 

Configuring The Firewall Manager on Ubuntu

 If you used our previous guide for a Pterodactyl install you will notice multiple ports already defined in your UFW status, 22/tcp for SSH, 80/tcp for Web Server, 443/tcp for Web Server TLS/SSL, 8080 for Pterodactyl and 2022 also for Pterodactyl.

 

Run the following command to verify this.

ufw status

We will need to allow the following ports through our firewall

  • TCP/UDP Port 25565 

 

We can do this by running:

ufw allow 25565

 

To further lockdown our firewall we will set the default to deny incoming traffic by running the following command: (Be sure that you have allowed SSH connections through the firewall (port 22) otherwise you will not be able to SSH back into this machine.)

sudo ufw default deny incoming

 

Configuring the Firewall Manager on Windows

If you are using Windows instead please access the Windows Defender Firewall via searching for it.

You will see the following two relevant rules that we will need to use.

From here we have to create the following new rules by:

Click on 'Inbound Rules' > New Rule > TCP, Specific Port: 25565 > Allow the connection > Domain, Private & Public > Name: Minecraft Server

Click on 'Inbound Rules' > New Rule > UDP, Specific Port: 25565 > Allow the connection > Domain, Private & Public > Name: Minecraft Server

Click on 'Outbound Rules' > New Rule > TCP, Specific Port: 25565 > Allow the connection > Domain, Private & Public > Name: Minecraft Server

Click on 'Outbound Rules' > New Rule > UDP, Specific Port: 25565 > Allow the connection > Domain, Private & Public > Name: Minecraft Server

 

Edge Rules & Filters

Now onto our Edge Rules/Filters, due to our link with Path.net we can define edge firewall rules/filters. Unfortunately for now our Filter Manager is offline, however you can open a ticket allowing us to assign them for you. We have 2 things to work with, Firewall rules and filters, let's start with firewall rules, below are the firewall rules we will setup.

Port - Protocol - Action - Source (If any)

  • 0.0.0.0/0 - DENY ALL (Port Punch) (Blocks all access outside of the rules we define)
  • 25565 - tcp - allow all (This allows connections to the Minecraft server)
  • 25565 - udp - allow all (Minecraft query)
  • 8080 - tcp - allow all  (Pterodactyl Ports)
  • 2022 - tcp - allow all (Pterodactyl Ports)
  • 22 - tcp - allow all OR allow from (Your IP) (SSH port)
  • 443 - tcp - allow all (Used for SSL/TLS - Pterodactyl Web server) - OR 80 if you are not using SSL/TLS

 

Edge Filters

  • Minecraft Java Edition Server (symmetric) - port 25565  (This filter enables full packet validation for Minecraft Java Edition traffic.)

    (This guide will be updated once the new filter page is released.)

Was this answer helpful?

« Back