Guides

8 min readUpdated

FiveM DDoS protection: hide the endpoint, filter port 30120

Quick answer

FiveM DDoS protection means two things: keeping the address of the machine running FXServer out of the server list and out of players' hands, and putting the address players do see on a network that filters TCP and UDP on port 30120. Cfx.re's documented settings route the listing and player connections through proxies; a firewall that admits only those proxies stops attackers going around them. Settings hide the address; they do not absorb a flood.

01How does a FiveM client connect to a server?

A FiveM client talks to two endpoints, and both can be attacked. Per Cfx.re's proxy documentation, the client fetches /info.json from a connect endpoint over HTTP, sends initConnect to POST /client, receives a token and a list of server endpoints, downloads resources, then opens an ENet session over UDP to a server endpoint.

By default both endpoints are the same address and port, 30120, over TCP and UDP, and txAdmin listens on TCP 40120. One leaked address exposes the HTTP API, the game socket and the admin panel at once.

StepProtocolEndpointAttack surface
Server list and /info.jsonHTTP over TCPConnect endpointHTTP floods on public JSON endpoints
initConnect, token, getEndpointsHTTP over TCPConnect endpointRequest floods, connection exhaustion
Resource downloads (/files/*)HTTP over TCPServer endpoint or a file serverBandwidth exhaustion
Game sessionENet over UDP (the same endpoint also answers HTTP over TCP)Server endpointUDP floods, SYN floods on 30120
AdministrationHTTP over TCP 40120txAdminLogin brute force, floods

02Why does my FiveM server IP leak?

Because, out of the box, it is published. The server list advertises the real address unless told otherwise, and every player's client sends UDP straight to the server endpoint, so a packet capture reveals it. Hiding it means the address players see must belong to something other than the machine running FXServer.

  • Server listing: the real IP is advertised unless sv_forceIndirectListing is set
  • Server endpoint: every player can see the UDP address they are connected to
  • txAdmin and other panels on the same address
  • Old DNS records, websites and Discord bots that print the connect address
  • Resources making outbound HTTP requests, which reveal your egress address to whoever runs the URL

03Which FiveM settings hide the server address?

The documented convars that matter for exposure, summarised from Cfx.re's server command and proxy setup pages. Check the current documentation before relying on them; behaviour can change between builds.

SettingWhat it does (per Cfx.re docs)Use it when
sv_forceIndirectListingStops the server being advertised by its real IP; proxy or override settings are used insteadAlways, once something fronts the server
sv_listingHostOverrideHostname the listing backend uses, for example an HTTPS connect proxyYou run a connect proxy on your own domain
sv_listingIpOverrideIP sent to the listing backend; only needed if it cannot work out which address to queryThe host is firewalled to everything except a proxy
sv_endpointsSpace-separated UDP endpoints clients connect to; one is picked at randomPlayers should reach a protected relay, not the host
sv_proxyIPRangesCIDR ranges trusted to send X-Real-IP and exempt from the rate limiterSet it to exactly your proxy's addresses
sv_requestParanoia0 to 3: 1 blocks IPs sending a Via header, 2 also Upgrade-Insecure-Requests (which catches browsers requesting the .json endpoints), 3 also closes the socketHTTP floods via open proxies; test before going above level 1
sv_endpointPrivacyHides player IPs from public reportsAlways, for player privacy
server.cfg excerpt: convar names and syntax from Cfx.re documentation; addresses are examples and were not run against FXServer
endpoint_add_tcp "0.0.0.0:30120"
endpoint_add_udp "0.0.0.0:30120"

# never advertise the real address; list via the HTTPS connect proxy
set sv_forceIndirectListing true
set sv_listingHostOverride "connect.example.com"

# players' UDP goes to the protected relay, not to this host
set sv_endpoints "192.0.2.20:30120"

# trust X-Real-IP only from the connect proxy
set sv_proxyIPRanges "192.0.2.10/32"

# hide player IPs in public reports (does not hide the server)
sv_endpointPrivacy true

04Connect proxy, relay or tunnel: how to front FXServer

Cfx.re describes two proxy types that can be deployed independently. A connect proxy is an ordinary HTTPS reverse proxy on port 443 in front of the server's TCP port; it carries the listing, /info.json and initConnect, and can cache downloads. A server proxy is a raw TCP and UDP relay on the game port. The third option is a tunnel from a filtering provider that delivers protected addresses to your machine.

Connect proxy (HTTPS)Raw TCP/UDP relayGRE or IP tunnel
ProtectsListing, /info.json, initConnect, downloadsThe game portEvery port and protocol
Hides the hostOnly the HTTP sideYes, if sv_endpoints points at the relayYes, if the tunnel endpoint stays private
Player IP at the serverVia X-Real-IP from trusted proxy rangesUsually the relay's address for game trafficPreserved, because packets are encapsulated rather than re-sent
Absorbs floodsOnly if the proxy's network canOnly if the relay's network canYes, filtering happens at the provider
Typical setupDNS plus a web proxyA stream proxy on a separate machineA tunnel interface on the host plus a provider

05Firewall the real host

Once something else carries the public address, the host should answer only that something. Drop TCP and UDP to 30120 from everyone except your provider or relay, and keep txAdmin reachable only from your own addresses or over SSH or a VPN. The ruleset below was syntax-checked and load-tested in an isolated network namespace: the provider address reached both protocols on 30120, the admin address reached txAdmin only, and everything else was dropped.

  • Whichever public address Cfx.re's listing backend polls must accept the addresses in Cfx.re's published list; new entries are added at least a month before they start sending traffic
  • If the server log keeps reporting that it could not contact the server browser, check that allowlist before blaming an attack
  • Give the host a new address after moving it behind protection if the old one was ever public
  • Keep the database, web panel and SSH off the public interface, or firewalled the same way with a default-deny ruleset
nftables rules for the FXServer host (nft 1.0.6, Debian 12)
#!/usr/sbin/nft -f
# FXServer host: game port only from the protection provider,
# txAdmin only from your own admin addresses.
table inet fivem_host
delete table inet fivem_host

table inet fivem_host {
    set provider4 {
        type ipv4_addr
        flags interval
        elements = { 192.0.2.0/27 }
    }
    set admin4 {
        type ipv4_addr
        flags interval
        elements = { 203.0.113.7 }
    }

    chain input {
        type filter hook input priority filter; policy accept;

        iif "lo" accept
        meta l4proto { tcp, udp } th dport 30120 ip saddr @provider4 accept
        tcp dport 40120 ip saddr @admin4 accept

        meta l4proto { tcp, udp } th dport 30120 counter drop
        tcp dport 40120 counter drop
    }
}

06What UDP filtering must a FiveM provider offer?

The game session itself runs over UDP, so a provider is only useful if legitimate ENet traffic keeps flowing while the flood is dropped (the attack itself is explained in what a UDP flood is). Ask about:

  • Filtering, not null-routing: UDP to 30120 keeps passing during a flood
  • Session awareness: game traffic from addresses that completed the HTTP connect step can be treated differently from UDP that appears from nowhere
  • Reflection traffic dropped upstream: replies from DNS, NTP, memcached and similar services are never FiveM traffic (see amplification attacks)
  • TCP protection on the same port against SYN floods and connection floods
  • HTTP-level filtering for the connect endpoint, because /info.json and /players.json are public and cheap to flood
  • IPv6 either protected or deliberately disabled
  • Measured latency from your players' region, and capacity in packets per second as well as gigabits

07How to recognise an attack on a FiveM server

Match the symptom to the layer before reacting, and rule out lag first with the signs of a DDoS on a game server. The matrix below covers the common cases; the commands after it are read-only, and the filters were compiled and the top-talkers count run against a crafted capture.

SymptomLikely causeWhat to check
Everyone times out at once, console looks healthyUDP flood filling the linkCapture UDP on 30120; ask your provider what they see
Listed in the browser, but connecting hangsHTTP or connection flood on the connect endpointCount GET requests and SYNs on 30120
Server drops out of the list, no loadA firewall blocking Cfx.re's polling addressesCompare your allowlist with ips.txt
txAdmin unreachable, game fineAttack on 40120, or the panel is exposedFirewall txAdmin to admin addresses
High CPU with few playersEvent spam or a resource bug, not DDoSProfile resources before blaming the network
Capture filters and a top-talkers count (tcpdump 4.99.3, Debian 12)
# game traffic
tcpdump -nni eth0 'udp dst port 30120'

# new TCP connections to the game port
tcpdump -nni eth0 'tcp dst port 30120 and tcp[tcpflags] & (tcp-syn|tcp-ack) == tcp-syn'

# plain-HTTP GET requests, e.g. a flood on /info.json
tcpdump -nni eth0 -A 'tcp dst port 30120 and tcp[((tcp[12:1] & 0xf0) >> 2):4] = 0x47455420'

# top 10 UDP sources in a 20,000-packet sample (IPv4)
tcpdump -nni eth0 -c 20000 'udp dst port 30120' 2>/dev/null \
  | awk '{print $3}' | cut -d. -f1-4 | sort | uniq -c | sort -rn | head

08What a proxy or tunnel can and cannot do for FiveM

A proxy or tunnel on a filtering network absorbs floods aimed at the address players know and keeps the host unreachable. That covers most of what people mean by a FiveM DDoS.

It cannot fix problems that arrive as legitimate traffic. A modified client spamming server events or an exploitable script passes through exactly like a real player, because it is a real connection; that needs server-side validation and anticheat. Protection also fails if the host's address leaks through another service, or if the provider null-routes the address once an attack grows.

Your community website, forum or store is a separate target with different needs: a web reverse proxy covers it, while the game needs Layer 3/4 filtering, as explained in Layer 3/4 vs Layer 7. For that web side, GuardX's DDoS protection for websites is available today; GRE transit for game traffic is marked coming soon.

Questions

Frequently asked questions

By default FXServer listens on port 30120 for both TCP and UDP: TCP carries HTTP endpoints such as /info.json and the connection handshake, and UDP carries the ENet game session. txAdmin listens on TCP 40120. Both can be changed, but moving ports hides nothing from an attacker who can see where players connect.

No. Cfx.re documents it as hiding player IP addresses from the public reports the server outputs. It protects your players' privacy and is worth enabling, but the server's own address is unaffected. Hiding the server takes sv_forceIndirectListing, a proxy or tunnel carrying the public address, and a firewall on the real host that only admits that proxy.

Its standard web proxy can front the connect endpoint, because that part is ordinary HTTPS, and Cfx.re's own proxy guide uses this pattern. It does not carry the UDP game session. The game port needs a raw TCP and UDP relay or a tunnel on a network that filters UDP; otherwise the server endpoint remains exposed to anyone who joins.

Usually a firewall or protection service is blocking Cfx.re's infrastructure, which polls servers from the addresses published in its ips.txt file. Allow every address in that list on whichever public endpoint the listing backend reaches. Cfx.re adds new addresses at least a month before using them, so syncing the list regularly avoids sudden delisting.

Only if you also remove the reason it leaked. If players connect directly, the new address is visible to every client the moment they join. Put the public endpoint on a protected relay or tunnel first, point sv_endpoints at it, then move the host to a new address that nothing publishes and firewall it to the relay.

Sources

Sources and verification

nftables ruleset syntax-checked with nft 1.0.6 and load-tested, unchanged, between two isolated network namespaces over a veth pair (provider address reached TCP and UDP 30120 but not 40120, admin address reached 40120 only, other sources dropped); tcpdump filters compiled with tcpdump 4.99.3 and the top-talkers pipeline run against a crafted capture. Debian 12, October 2026. The server.cfg lines follow Cfx.re's documentation and were not run against FXServer.

  1. 01Proxy Setup · Cfx.re documentation
  2. 02Server Commands (sv_forceIndirectListing, sv_endpoints, sv_proxyIPRanges, sv_requestParanoia, sv_endpointPrivacy) · Cfx.re documentation
  3. 03Static IPs (ips.txt) · Cfx.re documentation
  4. 04Setting up a server: example server.cfg · Cfx.re documentation
  5. 05txAdmin environment configuration (TXHOST_TXA_PORT default 40120) · citizenfx on GitHub
  6. 06Cfx.re infrastructure addresses · Cfx.re

Last updated