On this pageHow floods reach a game server
Game servers get flooded for petty reasons: a ban, a lost match, a rival community. The tools are cheap and the target is public, because a server's whole purpose is to be reachable. Protection comes in layers. Some of it sits in the network in front of your server, and some of it is configuration only you can do: hiding the real address, putting a proxy in front, and rate-limiting the traffic that looks like players but is not. This guide covers both for Minecraft and for FiveM, the GTA V multiplayer platform, and ends with a plan for the day an attack lands. For the wider list of threats, from exposed admin ports to poisoned plugins, see our game server security checklist.
How floods reach a game server
| Kind | What you see | What stops it |
|---|---|---|
| Volumetric: UDP floods, amplification | Everyone times out at once while the server's CPU looks calm | Filtering in the network upstream |
| Protocol: SYN floods, connection exhaustion | New connections fail, players already online may stay | Upstream filtering, plus the kernel's SYN cookies |
| Application: bot joins, status pings, login spam | Traffic that looks like players, rising tick time, logs full of joins | Your proxy, game settings and plugins |
Protocols matter here. Java Minecraft uses TCP on 25565, while Bedrock and the Geyser bridge use UDP on 19132. FiveM uses both TCP and UDP on 30120, plus HTTP endpoints that players' games query before joining. UDP coverage is the first thing to confirm about any protection.
Layer 1: filtering in front of the server
No firewall on the server can stop a flood that fills the network link before packets reach it. That job belongs to filtering in the provider's network, which recognizes attack traffic and drops it while letting legitimate packets through. When comparing hosts, ask whether filtering is always on or only triggered, whether it covers UDP, and what happens when an attack exceeds capacity; some networks protect themselves by null-routing the target, which takes your server offline anyway.
On CloudSat, network filtering is part of every server, and cloud firewall rules drop traffic to unused ports before it reaches the machine. On the server itself, confirm that SYN cookies are on, which most distributions enable by default:
sysctl net.ipv4.tcp_syncookies
Layer 2: keep the real address hidden
Attackers aim at the address players connect to. If that is a proxy, they hit the proxy; if it is your game server, they hit the game server. Keep the backend address out of sight:
- Never publish it in server lists, Discord or documentation.
- Do not run a website, voice server or panel on the same address; a web server's address is easy to find through DNS.
- Old DNS records live on in public history databases. If an address leaked once, move to a new one rather than hoping.
Put the game on its own address from the start. A CloudSat floating IP costs $2.00/mo and can be replaced with a fresh one if the old address becomes a target.
Layer 3: Minecraft
Put Velocity in front
A Velocity proxy gives players one public address and keeps the game servers behind it, listening on 127.0.0.1 or a private network. Because backends run with online-mode=false behind a proxy, they must accept connections from the proxy only. Our server software comparison shows the forwarding setup.
Rate-limit logins and packets
Velocity limits how often one address may log in, and how long it waits on slow connections:
# velocity.toml
[advanced]
# milliseconds one IP must wait between logins (default 3000)
login-ratelimit = 3000
# milliseconds to wait when connecting to a backend (default 5000)
connection-timeout = 5000
# milliseconds to wait for data before dropping a connection (default 30000)
read-timeout = 30000
A Paper server that faces players directly has its own per-address throttle in bukkit.yml under settings.connection-throttle. Behind a proxy, every connection comes from the proxy's address, so set that throttle to -1 on the backends and let Velocity do the limiting.
Paper also caps how many packets each player may send, which stops clients that spam packets to stall the main thread:
# config/paper-global.yml (defaults shown)
packet-limiter:
all-packets:
interval: 7.0
max-packet-rate: 500.0
action: KICK
The overrides section of the same block sets tighter limits for individual packet types.
Bot joins and lockdown
online-mode=true, on the server or the proxy, means bots cannot finish joining without real accounts. They can still hammer the handshake, status and login stages, which cost CPU and fill logs. During a bot wave, turn on the whitelist so only known players get in, and consider an anti-bot plugin for Velocity that makes new connections pass a check before they reach a game server. Choose one that is actively maintained, since bot tools adapt.
Filtering proxies and the PROXY protocol
Some external filtering services sit in front of Minecraft and forward players with the PROXY protocol, so your server still sees real player addresses. In that setup, enable haproxy-protocol = true in Velocity, or proxies.proxy-protocol: true in Paper's global config, and accept connections only from the service's address ranges. Otherwise anyone can forge the header and pose as any address.
Layer 4: FiveM
A FiveM server, FXServer, listens on TCP and UDP 30120 in the official example configuration, and the txAdmin web panel listens on TCP 40120. Start with the panel: it controls the whole server, so restrict port 40120 to your own address in the firewall, or reach it through an SSH tunnel.
Keep the server out of the listing
By default the server list publishes the server's address. FiveM's official proxy setup changes that with two reverse proxies: a connect proxy for the HTTPS endpoints that games query before joining, and a server proxy for the game traffic itself. The backend's server.cfg then points everything at the proxies:
set sv_forceIndirectListing true
set sv_listingHostOverride "connect.example.com"
set sv_proxyIPRanges "198.51.100.40/32"
set sv_endpoints "198.51.100.41:30120"
sv_forceIndirectListing stops the list from advertising the real address, sv_listingHostOverride names the connect proxy, sv_proxyIPRanges lists the proxies trusted to pass real client addresses (they also bypass the rate limiter), and sv_endpoints tells clients where game traffic should go.
The game traffic proxy
The server proxy needs to forward both TCP and UDP on the same port. With nginx's stream module, installed on Debian and Ubuntu as libnginx-mod-stream, the block goes in nginx.conf or a file under conf.d, not in sites-enabled:
stream {
upstream fivem_backend {
server 203.0.113.10:30120;
}
server {
listen 30120;
proxy_pass fivem_backend;
}
server {
listen 30120 udp reuseport;
proxy_pass fivem_backend;
}
}
The connect proxy is an ordinary HTTPS reverse proxy on port 443, configured as in FiveM's documentation, which also covers caching of the files players download. Finally, firewall the backend so port 30120 accepts only the proxies. Players connect with a full URL, such as connect "https://connect.example.com/", because a bare domain is not looked up. FiveM's documentation also notes that the Linux build of FXServer is a courtesy port and recommends Windows for servers where support matters.
On the day of an attack
- Confirm it. Compare traffic graphs with the tick time. A flood saturates the network while the game itself is fine; lag shows high tick times with normal traffic.
ss -sand the server log show whether connections or joins are piling up. - Check the upstream side. Ask your provider whether filtering engaged, with the target address, the ports and the start time.
- Lock down the application. Whitelist on, anti-bot checks on, rate limits tighter, and block traffic as early in the chain as you can.
- Move if the origin is exposed. If attacks reach the real game server, put it on a new address behind the proxy and fix whatever leaked the old one.
- Talk to players on Discord or a status page, without posting any new address.
- Write it down afterwards: what was hit, what worked, who knew the address. The next attack is easier with notes.
Never retaliate, and keep logs if you plan to report the attack.
FAQ
Can a firewall on the server stop a DDoS?
Not a volumetric one, because the link fills up before packets reach the firewall. A server firewall still matters: it closes unused ports, and application-level limits handle floods that look like players.
Does a web CDN protect a game server?
Only the parts that speak HTTP. In FiveM's setup, an HTTPS proxy or CDN can front the connect endpoint, but raw game traffic on UDP and TCP needs a proxy or filtering that handles those protocols.
Will online mode stop bot attacks on Minecraft?
It stops bots from joining with fake accounts. It does not stop floods of handshakes, status pings and login attempts, which is why rate limits, a proxy and lockdown modes still matter.
Why do attacks start right after I ban someone?
Because attack services are cheap and the banned player knows your address. Expect it after high-profile bans, keep the origin hidden behind a proxy, and have the lockdown steps ready before you need them.
Run it on CloudSat. Cloud VPS on AMD EPYC and NVMe from $1.98/mo in 13 regions, delivered in under 5 minutes and paid in crypto. See plans or deploy a server.




