IW4x Updated April 28, 2026

Setting Up and Using RCON on Your IW4x Server

How to configure RCON on an IW4x server and send commands remotely from the IW4x client console or external tools.

IW4xMW2RCONAdminRemote Console

Setting Up and Using RCON on Your IW4x Server

RCON (Remote Console) lets you execute server commands from outside the server process — from an IW4x game client, a third-party admin tool like IW4MAdmin, or a custom script. It's the primary interface for live server management.

Enabling RCON on the Server

RCON is controlled by a single cvar in userraw/server.cfg:

set rcon_password "YourSecurePassword"

Rules for the password:

  • It must be a non-empty string. An empty rcon_password disables RCON entirely.
  • Avoid spaces in the password (use underscores or mixed case instead).
  • Change the default from anything like "changeme" or "password" — RCON allows full server control.

Restart the server after setting this. RCON uses the same port as game traffic (UDP 28960 by default), so no additional firewall rules are needed.

Using RCON from the IW4x Game Client

You can send RCON commands directly from the IW4x console while connected to your server or even from the main menu.

  1. Open the console with the tilde key (~).
  2. Authenticate with your RCON password:
    rcon_password YourSecurePassword
    
  3. Send a command by prefixing it with rcon:
    rcon status
    rcon map mp_rust
    rcon g_gametype dom
    

The rcon_password is stored in your client config for the session. You don't need to re-enter it for subsequent commands until you restart the game.

Common RCON Commands

Command Effect
status Shows all connected players with their slot numbers, ping, and GUID
map mp_rust Immediately loads the specified map
g_gametype dom Changes gametype (takes effect on next map load)
map_rotate Advances to the next map in the rotation
fast_restart Restarts the current map without a full reload
kick [slot or name] Kicks a player by slot number or partial name
clientkick [slot] Kicks by slot number (more reliable than kick)
banclient [slot] Bans a player by slot number
unbanuser [GUID] Unbans a player by their GUID
say [message] Sends a message to all players as "console"
tell [slot] [message] Sends a private message to one player
set sv_hostname "New Name" Changes the server name live
set sv_maxclients "12" Changes max player count
set g_password "secret" Password-protects the server
set g_password "" Removes server password
killserver Gracefully shuts down the server

To find a player's slot number, run rcon status first and read the numbers from the left column.

Using RCON with IW4MAdmin

If you're running IW4MAdmin, it handles RCON authentication automatically using the rcon_password you provide in its configuration. You generally don't need to use raw RCON when IW4MAdmin is running — use IW4MAdmin's chat commands (!kick, !ban, !map, etc.) instead.

See the IW4MAdmin setup guide and the IW4MAdmin commands reference for details.

Using RCON with External Scripts

IW4x RCON is UDP-based. You can send commands from any scripting language that supports UDP sockets. Here's a Python example:

import socket
import struct
import hashlib

def send_rcon(host, port, password, command):
    header = b"\xff\xff\xff\xff"
    packet = header + f"rcon {password} {command}".encode("ascii")
    sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    sock.settimeout(2)
    sock.sendto(packet, (host, port))
    try:
        response, _ = sock.recvfrom(4096)
        return response[10:].decode("ascii", errors="replace")
    except socket.timeout:
        return "(no response)"
    finally:
        sock.close()

# Example usage:
print(send_rcon("127.0.0.1", 28960, "YourSecurePassword", "status"))

This uses the standard Quake-style RCON packet format that IW4x inherits from the IW4 engine.

IW4x Safe RCON (Encrypted)

Standard RCON sends the password in plaintext over UDP, which is a known security concern on public networks. IW4x supports an enhanced "safe RCON" mode that uses RSA key pairs for authentication, preventing password sniffing.

To enable safe RCON:

  1. Both the server and client must be running a sufficiently recent version of IW4x (post-2021 builds support it).
  2. The server generates an RSA key pair on first start; the public key is broadcast in server info packets.
  3. Clients that support safe RCON use the server's public key to encrypt the RCON challenge response.

For most server operators using IW4MAdmin on the same machine (localhost RCON), the standard RCON mode is acceptable. Safe RCON matters most when you're administering a remote server from a different network.

Troubleshooting RCON

Problem Likely Cause Fix
No response to RCON commands Wrong password or RCON disabled Verify rcon_password in server.cfg matches what you're using
"Bad rcon_password" Password mismatch Re-check for typos, spaces, or encoding issues
Commands work but no output Firewall blocking UDP responses Ensure UDP 28960 is open both inbound and outbound
IW4MAdmin shows RCON errors Mismatched password or wrong port Check IW4MAdminSettings.json for correct IP, port, and password