28960/UDPCall of Duty 4: Modern Warfare servers require specific ports to be open for proper operation:
| Port | Protocol | Purpose | Required |
|---|---|---|---|
| 28960 | UDP | Game port (default, configurable) | Yes |
| 28960 | TCP | RCON remote control | Optional |
| 20500-20510 | UDP | PunkBuster (if enabled) | Optional |
UFW (Ubuntu/Debian):
sudo ufw allow 28960/udp comment 'CoD4 Game Port'
sudo ufw allow 28960/tcp comment 'CoD4 RCON'
sudo ufw allow 20500:20510/udp comment 'CoD4 PunkBuster'
FirewallD (CentOS/RHEL/Fedora):
sudo firewall-cmd --permanent --add-port=28960/udp
sudo firewall-cmd --permanent --add-port=28960/tcp
sudo firewall-cmd --permanent --add-port=20500-20510/udp
sudo firewall-cmd --reload
iptables:
sudo iptables -A INPUT -p udp --dport 28960 -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 28960 -j ACCEPT
sudo iptables -A INPUT -p udp --dport 20500:20510 -j ACCEPT
mkdir -p ~/cod4server
cd ~/cod4serversudo apt-get install lib32gcc1 lib32stdc++6 # Debian/Ubuntu
sudo yum install glibc.i686 libstdc++.i686 # CentOS/RHELchmod +x cod4_lnxdedserver.cfg in the main directoryserver.cfg file in the main directoryiw3mp.exe with appropriate parameters// Server Name
set sv_hostname "My Call of Duty 4 Server"
// Network Settings
set net_ip "0.0.0.0"
set net_port 28960
// Server Type (1=LAN, 2=Internet)
set dedicated 2
// Player Limits
set sv_maxclients 32
// RCON Password
set rcon_password "your_secure_password_here"
// Game Settings
set g_gametype "war" // dm, war, sab, koth, sd, hq
set sv_maxPing 350
set sv_minPing 0
// PunkBuster (0=off, 1=on)
set sv_punkbuster 1
// Map Rotation
set sv_mapRotation "gametype war map mp_crash gametype war map mp_backlot gametype war map mp_strike"
// Password Protection (leave empty for public)
set g_password ""
// Friendly Fire
set scr_team_fftype 0 // 0=off, 1=on, 2=reflect
// Kill Cam
set scr_game_allowkillcam 1
// Hardcore Mode
set scr_hardcore 0
// Game Log
set g_log "games_mp.log"
set g_logsync 2
// Voice Chat
set sv_voice 1
set sv_voiceQuality 1
// Anti-Lag
set sv_fps 20
// Downloads
set sv_allowDownload 1
// Pure Server (verify client files)
set sv_pure 1
// Spectating
set scr_game_spectatetype 2 // 0=disabled, 1=team only, 2=free
// Auto-Balance
set scr_teambalance 1
// Anti-Cheat
set sv_cheats 0
| Parameter | Description | Example |
|---|---|---|
| +set dedicated | Server mode (1=LAN, 2=Internet) | +set dedicated 2 |
| +set net_ip | Bind to specific IP address | +set net_ip "0.0.0.0" |
| +set net_port | Server port (default: 28960) | +set net_port 28960 |
| +set fs_basepath | Base installation directory | +set fs_basepath "/home/user/cod4" |
| +set fs_homepath | Config and log directory (deprecated in CoD4) | +set fs_homepath "/home/user/.callofduty4" |
| +set fs_savepath | Save path for logs and user data | +set fs_savepath "/home/user/cod4data" |
| +set fs_game | Mod folder (if using mods) | +set fs_game "mods/pam4" |
| +set sv_punkbuster | Enable PunkBuster (0=off, 1=on) | +set sv_punkbuster 1 |
| +exec | Execute config file on startup | +exec server.cfg |
| +set rcon_password | RCON password for remote admin | +set rcon_password "secret123" |
| +set sv_maxclients | Maximum player slots | +set sv_maxclients 32 |
| +map_rotate | Start map rotation from server.cfg | +map_rotate |
| +map | Start with specific map | +map mp_crash |
./cod4_lnxded +set dedicated 2 +set net_ip "0.0.0.0" +set net_port 28960 +set sv_maxclients 32 +set sv_punkbuster 1 +set fs_savepath "/home/user/cod4data" +exec server.cfg +map_rotate
iw3mp.exe +set dedicated 2 +set net_ip "0.0.0.0" +set net_port 28960 +set sv_maxclients 32 +set sv_punkbuster 1 +exec server.cfg +map_rotate
Issue: Players cannot see the server in the in-game browser.
Solutions:
+set dedicated 2 is set (not 1 for LAN)sv_pure setting - some clients filter out non-pure serversps aux | grep cod4Issue: Dedicated server crashes immediately after launch.
Solutions:
games_mp.log in the fs_savepath directory for error messagesserver.cfg syntax is correct (no typos)chmod +x cod4_lnxded+map_rotate - specify a single map insteadIssue: Players cannot connect or timeout.
Solutions:
sv_maxPing setting (increase if players have high latency)sv_maxclients)set g_password ""sv_pure - if enabled, clients must have matching filesIssue: Players experience significant lag.
Solutions:
sv_fps setting (recommended: 20, max: 30)sv_maxclients if server is overloadedsv_maxPing to restrict high-ping playersset sv_voice 0Issue: Cannot connect via RCON.
Solutions:
rcon_password is set in server.cfg/rcon login password then /rcon commandIssue: Custom maps or mods not loading.
Solutions:
+set fs_game "mods/modname" parameter is set correctlyusermaps/mapname/set sv_allowDownload 1 for clients to auto-downloadCall of Duty 4: Modern Warfare supports the following game modes:
Call of Duty 4: Modern Warfare includes the following default multiplayer maps:
Popular server modifications compatible with Call of Duty 4: Modern Warfare:
fs_savepath instead of fs_homepath - the latter is deprecated in CoD4sv_pure setting enforces file verification - essential for competitive/anti-cheat serversusermaps/ folder