Skip to content

Firewall and router configuration

pjscruggs edited this page Nov 8, 2026 · 3 revisions

This guide is for server operators. Raknetify2 needs a working UDP route to the server or proxy accepting RakNet connections. The default setup uses the same port number as Minecraft's TCP listener.

For players on the same local network, use the server's local address and allow UDP through its host firewall. Router port forwarding is needed when internet traffic must cross your router's IPv4 NAT.

Choose the destination and port

Direct server

Send public UDP traffic to the machine running the Minecraft server with Raknetify2. The destination port is that server's RakNet UDP listener. Allow that port in the server machine's host firewall. Keep its existing TCP route for ordinary Minecraft connections.

For example, if Raknetify2 listens on UDP 25570, forward the public UDP port to the server's local address on port 25570. The server's TCP port can stay at 25565. See direct-server listener settings to choose a different UDP port.

Velocity or BungeeCord

Send public UDP traffic to the machine running Velocity or BungeeCord with the Raknetify2 proxy plugin. Use the proxy's RakNet UDP listener as the forwarding destination. Keep the proxy's existing public TCP route for ordinary Minecraft connections.

The proxy connects to backend Minecraft servers over TCP. Adding Raknetify2 to the proxy does not require opening backend gameplay UDP ports to players.

Connection Access to allow
Players to the proxy Public UDP to the RakNet listener, plus the existing public TCP listener
Proxy to backend servers Backend Minecraft TCP ports, reachable only from the intended proxy hosts
Players directly to backend gameplay ports Keep blocked, including through IPv6

When the proxy and backends run directly on a dedicated machine you control, backend listeners can use loopback addresses with the proxy configured to reach them there. Across machines, restrict backend TCP access to the proxy hosts using a firewall or an isolated private network. Containers and managed hosts need equivalent restrictions for their network layout. See Velocity's backend security guide and BungeeCord's firewall guide.

Player forwarding and firewall restrictions work together. Direct backend access can bypass the proxy's login checks. For plugin installation, forwarding settings, and UDP port overrides, follow Velocity and BungeeCord.

Public and local port numbers

The public port and the listener's port can differ when a router translates between them:

Setting Port to use
Client server address Public UDP port
Router forwarding rule's external port Public UDP port
Router forwarding rule's internal port RakNet listener's UDP port
Host firewall's local port RakNet listener's UDP port

IPv4 port forwarding

For hosting behind an IPv4 router:

  1. Find the local IPv4 address of the machine accepting RakNet connections. Use a DHCP reservation or a suitable static address so the forwarding rule continues to target that machine.
  2. Add a UDP forwarding rule for the public port players will use.
  3. Set the rule's destination to that machine's local address and the RakNet listener's UDP port.
  4. Allow inbound UDP on the listener's port in the host firewall.

For example, a server listening on UDP port 25565 can use a rule with public port 25565, destination address 192.168.1.100, and destination port 25565. Replace the example address with your server's actual local address.

Keep the existing TCP rule for ordinary Minecraft connections. A TCP forwarding rule alone does not carry UDP.

When forwarding still fails

Check whether another router or your ISP performs NAT before traffic reaches your router. With two routers you control, forwarding must cover both. If your ISP uses carrier-grade NAT, ask whether it can provide a public IPv4 address or use a hosting service or tunnel that supports inbound UDP. Your router's forwarding rule cannot configure the ISP's NAT. See TP-Link's port forwarding guidance for the public WAN address requirement.

IPv6 firewall rules

Allow the selected UDP port through both the router's IPv6 firewall and the host firewall. Target the IPv6 address of the machine accepting RakNet connections.

Check that the hostname's IPv6 address points to that machine. If its IPv6 address changes, update the DNS record and any address-specific firewall rules.

A hostname that publishes both IPv4 and IPv6 addresses needs a working route for each advertised address. Check both sets of rules when one player can connect and another cannot.

If IPv4 forwarding changes the port number, make sure the port players enter also reaches the IPv6 listener. An IPv4 port translation does not configure the IPv6 route.

Hosting providers and tunnels

The provider or tunnel must support UDP on the public endpoint you give players. Check its port allocations and network firewall rules as well as the server's own firewall.

If an additional UDP proxy forwards client addresses using PROXY protocol v2, follow UDP forwarding and PROXY protocol and restrict access to the receiving UDP listener to the trusted proxy.

Check the connection

Connect from outside the server's local network with an updated Raknetify2 client, using an address such as raknet;play.example.com:25565. Use the public UDP port in this address.

Use a real RakNet connection to verify the route. A UDP scan that receives no response can report an inconclusive result because a working service may discard an unfamiliar probe. Nmap's UDP scan documentation explains this behavior.

A successful TCP connection confirms only the TCP route. If RakNet times out, check the listener, forwarding destination, UDP port, and firewall rules using the troubleshooting guide.

Clone this wiki locally