This guide connects a Rust PC dedicated server to X4B DDoS Protection. You maintain the game server, referred to below as the backend; players use your X4B filtered IP. Rust Console Edition is a separate hosting product and is outside this procedure.
Step 1: Prepare the backend
Follow Facepunch's server installation instructions for Windows or Linux. SteamCMD installs the dedicated server using app 258550. Use a maintained operating system and a separate, unprivileged service account. Keep installation files, persistent data and backups organised so an update does not replace your configuration.
Preserve your existing server.identity, world and save choices when editing the launcher. Add these explicit port settings to the existing launch arguments:
+server.port 28015 +server.queryport 28017
The table below uses these chosen values; inspect the installed server's listeners rather than relying on implicit defaults. Keep RCON on a private management path with a strong unique password. It is not a public gameplay requirement.
Start the backend and test with a trusted external player, limiting temporary direct access to that tester. On Linux, sudo ss -lunp helps identify UDP listeners. Size the host for your actual map, mods and player load; monitor memory, CPU, disk and network use rather than treating bandwidth as a cure for server lag.
Step 2: Choose the X4B service and create a tunnel
Use an active service or choose one on the DDoS protection page. Select a location with a suitable route to the backend and players, and a clean-bandwidth allowance for normal game traffic.
We recommend GRE for UDP compatibility and preservation of client source addresses. Review Port types and the tunnel requirements first. Your host and provider must support the selected tunnel protocol.
- Open Services, find your service and choose Action > Tunnels.
- Select Add Tunnel, choose GRE under Tunnel type, and enter the backend's public IP in Backend address.
- Save, reload and verify the tunnel. Retain the displayed key and MTU for the backend setup.
Step 3: Forward the game and query ports
Open the service's Action > Ports page. Under Single Port, choose Add port manually if the empty state is shown; otherwise choose Add Port. Add each entry below, select UDP, choose Encapsulated (NAT) as Backend method, and select your saved tunnel. Keep the backend port equal to the public port, then Save each entry.
| Port start | Protocol | Backend port | Purpose |
|---|---|---|---|
| 28015 | UDP | 28015 | Gameplay |
| 28017 | UDP | 28017 | Server queries and discovery |
Reload Ports to verify both entries. These are explicit recipe ports; change the launcher and forwarding together if you choose different values. The baseline uses ordinary UDP. Discuss the A2S query profile with support before applying it to this server's query listener; it is not a Rust gameplay preset. See Layer 7 protection modes.
Return to Tunnels, choose Action > Setup Tunnel, then Linux / BSD > Download Tunnel Script or Microsoft Windows > Download Application. A saved port must reference the tunnel before setup is usable. Review and install the generated configuration using the Linux tunnel instructions or Windows instructions.
Set server.ip to the assigned backend tunnel address when binding Rust to that interface. The filtered IP is not a local bind address on an Encapsulated (NAT) backend. Preserve the generated return-routing rules and start the tunnel before Rust at boot. Follow the Unified Tunnel requirements for outgoing connections on Anycast services.
Step 4: Secure and test the protected path
Keep host and provider firewalls enabled. Allow IP protocol 47 between the backend and the X4B tunnel endpoints, and allow the two game UDP listeners on the tunnel interface. Protocol 47 is GRE, not TCP or UDP port 47. Inner game packets retain player source addresses; an allowlist containing only X4B communication addresses will not match them. Preserve private management access and keep recovery-console access while changing rules.
Wait for Dashboard deployment to finish. From an outside network, open the Rust F1 console and connect to the filtered IP and game port:
connect 203.0.113.20:28015
Replace this documentation address with your service's filtered IP. Test joining, gameplay, disconnecting and reconnecting. Separately test finding and joining the server through its public listing. Inspect backend logs or packet captures to confirm both paths use X4B. Outgoing registration can still advertise the origin if its source routing is wrong; a working direct join does not prove the listing is protected.
After testing, remove temporary direct game access through the backend's public interface. Keep outbound Steam connectivity available and repeat the checks after reboot. A firewall restriction on game ports does not make a publicly known backend connection immune to volumetric attacks.
If using Reverse Proxy
For a separately tested RP setup, use the same two UDP entries with Backend method > Reverse Proxy, a reachable Backend address, and matching backend ports. Skip tunnel installation. Allow the game ports from the service's current Backend Communication IP Addresses, found under Services > Action > IP Addresses; see firewall exceptions.
RP presents X4B's source address to the backend and does not route Rust's outgoing registration through X4B. Check IP-based limits and moderation, public listing behaviour and any auxiliary services before using this method. Keep RCON private in either mode.
Optional: Rust+
Configure Rust+ separately using Facepunch's companion-server instructions. Choose app.port explicitly, for example 28082, and add a matching TCP forward through the selected backend method. The companion port must be at least 10000 and within your X4B service's permitted ports.
Use app.listenip for the appropriate local address and app.publicip for the filtered IP. Verify the effective values with app.info, then test actual app pairing and notifications. Keep the required outbound companion connectivity available. Preserve companion.id with the server's backups and keep it private. The game and query tests do not establish Rust+ connectivity.
Maintenance and troubleshooting
Use Rust's supported save and graceful shutdown procedure before updates; wait for saving and process exit. Back up the complete active server identity, configuration, world/player data and companion identity off-host, and test restoration in an isolated instance. Check update and wipe compatibility before restarting. Retest the filtered address, listing and optional Rust+ after updates.
| Symptom | Checks |
|---|---|
| Direct join works but listing does not | Query port, outgoing registration, advertised address and tunnel source routing |
| Server is reachable but lags | Map/mod load, CPU, memory, packet loss and tunnel MTU |
| Rust+ reports offline | Companion listener, advertised IP, TCP forward and outbound connectivity |
| Connection fails after reboot | Tunnel startup order, listener binding and persistent firewall/routing rules |
For support, provide the service, server version, filtered IP, configured ports, backend method, test time with timezone and relevant logs. Remove passwords and private identity material.
