Setup a private server on docker for my friends

Hi all!
First of all, i’m new to the server thing…
I want to host for my friends a server, so we can play like in the old days.
I’ve successfully installed the server on my linux box with docker.

System:

  • Ubuntu Server 22.04
  • Steam COD Client 1.8 (updated to 1.21)

On the LAN i can just connect to the IP with the console like:
connect 192.168.0.69

When i try to connect via internet like so:
connect 70.80.90.100:54321
I get Timeout

I’ve mapped the port 8000 to 54320 and port 28960 to 54321 on my router and forwarded this to my server
*:54320 → 192.168.0.69:8000
*.54321 → 192.168.0.69:28960

are there more ports to be forwarded? Do i missing something?

Also, when i want to protect my server with a password. Should i use the start command like so:

command: +set dedicated 2+set sv_cheats 1+set sv_maxclients 20+set ui_maxclients 20+exec server.cfg+map_rotate+set g_password "password+set rcon_password "password"

this is the server.cfg i use

Logs:

cod4  | 2023/12/12 15:12:10 INFO Can not register server on the masterserver. Server needs to provide a valid token in cvar sv_authtoken.

Thanks and cheers

Meanwhile:

  • I’ve installed latest Server from the release.
  • I got the sv_authtoken in the server.cfg
  • Server shows in the masterlist (but red)

on LAN i can connect and play without any problems. I can not connect from the internet with public ip and port.
The port i have forwarded to the server is 28961.

I higly apreciate your help and time!
Cheers

futhermore investigations:

  • On windows 11 hosting the game LAN seems to be OK
  • Forwarding port 28961 to the 192.168.69.69
  • Connecting via internet no luck tho

starting command:

+set dedicated 2 +set net_port "28961" +set rcon_password "password" +set sv_cheats 1 +set sv_maxclients 32 +set ui_maxclients 40 +exec server.cfg +map_rotate

server.cfg

////////////////////////////////////////////////////////////
///      Call of Duty 4 X Standard Configuration         ///
////////////////////////////////////////////////////////////
// Colors Codes:
// ^0 = Black
// ^1 = Red
// ^2 = Green
// ^3 = Yellow
// ^4 = Navy Blue
// ^5 = Light Blue
// ^6 = Purple
// ^7 = White
// ^8 = Gray

set sv_authtoken "token here"

//////////////////////////////////
// Master servers
//////////////////////////////////
set sv_masterservers "cod4master.doszgep.cloud"
//set sv_master1 "cod2master.activision.com"
//set sv_master2 "cod2authorize.activision.com"
//set sv_master3 "cod2master.infinityward.com"
//set sv_master3 "cod2update.activision.com"
//set sv_master4 "master.gamespy.com:28960"
//set sv_master5 "master0.gamespy.com"
//set sv_master6 "master1.gamespy.com"
//set sv_master7 "clanservers.net"

//////////////////////////////////
// Meta Information
//////////////////////////////////
sets _Owner ""
sets _Email ""
sets _Website ""
sets _Host ""
sets _Location ""
sets _Maps "Stock"
sets _Gametype ""

//////////////////////////////////
// Basics
//////////////////////////////////
set sv_hostname "My COD4x Server"
//set g_motd "" // Message of the day, which getting shown to every player on his 1st spawn
set dedicated "2" // 0 = Listen, 1 = LAN, 2 = Internet ( you probably want 2 )
//set rcon_password ""  // password for remote access, leave empty to deactivate, min 8 characters
set g_password "Password"     // join password, leave empty to deactivate
//set sv_privateClients "2" //Private Clients, number of slots that can only be changed with a password
//set sv_privatePassword "23187asnd9-214"  // the password to join private slots
//set sv_authorizemode "0" // cdkey validation
//set sv_showasranked 0 // 0 = show modded server as not ranked, 1 = shows server as ranked altough it is modded

//////////////////////////////////
// Log File
//////////////////////////////////
set g_logsync "1" // 0=no log, 1=buffered, 2=continuous, 3=append
set logfile "1" // 0 = NO log, 1 = log file enabled
set g_log "cod4x.log" // Name of log file, default is games_mp.log
set sv_log_damage "1"
set sv_statusfile "" // writes an xml serverstatus to disc, leave empty to disable (serverstatus.xml)

//////////////////////////////////
// Networking
//////////////////////////////////
// set net_ip "" // not necessary to be set
set net_port 28961 // network port delete quotations after putting in port
//set sv_maxRate 2500
set sv_minPing "0" // minimal ping [ms] for a player to join the server
set sv_maxPing "350" // maximal ping [ms] for a player to join the server, raise if friends DC from Ping
set sv_timeout 60 // Seconds to keep a client on server without a new clientmessage
set sv_connectTimeout 120 // Seconds to wait for a client which is loading a map without a new clientmessage
set sv_zombieTime 2 // Seconds to keep a disconnected client on server to transmit the last message
set sv_reconnectlimit 5 // Seconds to disallow a prior connected client to reconnect to the server
// Floodprotection is enabled by default!
// sv_floodProtect, sv_maxRate,

//////////////////////////////////
// Variables you should not touch
//////////////////////////////////
// set sv_fps "20" //Server-FPS (do not change!)
// set sv_punkbuster "0" //Punkbuster, PB is not supported on CoD4x DO NOT ENABLE
// set sv_pure "0" //check IWD-data 0 = off, 1 = on
// set g_antilag "1" //0 = off, 1 = on // Anti lag checks for weapon hits
// set ModStats 1 // 1 = use player stats file for mods (normal behaviours), 0 = use player stats file of basegame (DANGEROUS!!! as it can overwrite your stats)
set sv_kickBanTime "3600"

//////////////////////////////////
// Gameplay
//////////////////////////////////
set scr_drawfriend "1" //show team mates //0 = off, 1 = on
set scr_enable_scoretext "1" //hit-message //0 = no, 1 = yes
set scr_game_allowkillcam "1" //Killcam //0 = no, 1 = yes // Allow to play killcam after you got killed
set scr_game_deathpointloss "1" //points-distraction when hit //0 = no, 1 = yes
set scr_game_suicidepointloss "1" //points-distraction suicide //0 = no, 1 = yes
set scr_game_matchstarttime "15" //time until match starts
set scr_game_playerwaittime "5" //respawn-delay
set scr_player_forcerespawn "1" //force respawn //0 = no, 1 = yes // forgot what -1 did but i believe it was different xD
set scr_player_healthregentime "5" //health regeneration (in seconds)
set scr_player_maxhealth "100" //Max health
set scr_player_sprinttime "9" //Sprint-time
set scr_game_onlyheadshots "0" //headshots only //0 = no, 1 = yes
set scr_teamKillPunishCount "3" //Teamkiller kick after x Teamkills
set scr_team_teamkillspawndelay "20" //teamkill spawn delay (in seconds)
set scr_team_teamkillpointloss "1" //pointloss after Teamkill //0 = no, 1 = yes
set scr_enable_hiticon "1" //Hit-Symbol //0 = off, 1 = on
set sv_allowAnonymous "0" // Anonymous //0 = off 1 = on
//set g_deadChat "1" // dead can chat // 0 = off, 1 = on
//set voice_deadChat "1" // dead can use voicechat //0 = off, 1 = on
//set sv_disableClientConsole "0" //deactivate console for clients //0 = no, 1 = yes
set scr_teambalance "0" //auto-teambalance //0 = no, 1 = yes
set scr_team_fftype "0" //friendly-fire //0 = off, 1 = on, //2 = reflect damage, 3 = shared damage
set scr_game_spectatetype "2" // spectator // 0 = off, 1 = only Team/player, 2 = free
set scr_hardcore 0 //Hardcore Mode //0 = off 1 = on
set scr_oldschool "0" //Oldschool Mode //0 = off, 1 = on // Old school for out of map glitches
set g_friendlyPlayerCanBlock 1 // 1 = player collision between friendly players, 0 = collision between friendly players is disabled
set g_FFAPlayerCanBlock 0 // same for FFA (non team based) gamemode
set g_allowvote 1 // Allows players to vote for Next map/to change to next map in rotation

////////////////////////////////////////////
// Setup for custom maps when running a mod
////////////////////////////////////////////
set sv_wwwDownload "1" // enable download redirection
set sv_wwwBaseURL "" // defines url to download from
set sv_wwwDlDisconnected "0" // disconnect clients while downloading

//////////////////////////////////
// Misc
//////////////////////////////////
//set sv_autodemorecord 1 // Records demos of players on the serverside, demos are stored in "demos" folder
//set sv_demoCompletedCmd "" // program to execute when a demo has been saved
//set sv_screenshotArrivedCmd "" // program to execute when a screenshot was taken
//set sv_legacyguidmode 0 // 1 = old 32 character guids are used, 0 = new cod4x guid format is used ( like steamids )
set sv_nosteamnames 0 // 1 = Use names from steam if steam is available
seta sv_contellname "console[^5PM^7]: "
seta sv_consayname "console: "

//////////////////////////////////
//Game-Modes
//////////////////////////////////

//Death Match (dm)
set scr_dm_scorelimit "0"
set scr_dm_timelimit "2"
set scr_dm_roundlimit "1"
set scr_dm_numlives "0"
set scr_dm_playerrespawndelay "-1"
set scr_dm_waverespawndelay "0"

//Team Death Match (war)
set scr_war_scorelimit "0"
set scr_war_timelimit "10"
set scr_war_roundlimit "1"
set scr_war_numlives "0"
set scr_war_playerrespawndelay "-1"
set scr_war_waverespawndelay "0"

//Domination (dom)
set scr_dom_scorelimit "0"
set scr_dom_timelimit "10"
set scr_dom_numlives "0"
set scr_dom_playerrespawndelay "-1"
set scr_dom_roundlimit "1"
set scr_dom_waverespawndelay "0"

//HQ (koth)
set scr_koth_scorelimit "250"
set scr_koth_timelimit "15"
set koth_kothmode "0" //Classic HQ-Mode 0 = off, 1 = on
set koth_capturetime "20"
set koth_spawntime "3" //0 = immediately, x = time in seconds
set scr_koth_numlives "0"
set scr_koth_playerrespawndelay "3"
set scr_koth_roundlimit "1"
set scr_koth_roundswitch "1"
set scr_koth_waverespawndelay "0"
set koth_autodestroytime "60"
set koth_delayPlayer "3"
set koth_destroytime "10"
set koth_spawnDelay "3"

//Sabotage (sab)
set scr_sab_scorelimit "2"
set scr_sab_timelimit "10"
set scr_sab_roundswitch "1"
set scr_sab_bombtimer "30"
set scr_sab_planttime "2.5"
set scr_sab_defusetime "5"
set scr_sab_hotpotato "0"
set scr_sab_numlives "0"
set scr_sab_playerrespawndelay "5"
set scr_sab_roundlimit "0"
set scr_sab_waverespawndelay "0"

//Search and destroy (sd)
set scr_sd_scorelimit "9"
set scr_sd_timelimit "2.5"
set scr_sd_roundswitch "4"
set scr_sd_bombtimer "45"
set scr_sd_planttime "5"
set scr_sd_defusetime "7"
set scr_sd_multibomb "0"
set scr_sd_numlives "1"
set scr_sd_playerrespawndelay "0"
set scr_sd_roundlimit "0"
set scr_sd_waverespawndelay "0"

//set g_gametype "war" // gamemode, one of [war, dm, sd, sab, koth]

//////////////////////////////////
// Stock Maps
//////////////////////////////////
//gametype war map mp_backlot
//gametype war map mp_bloc
//gametype war map mp_bog
//gametype war map mp_broadcast
//gametype war map mp_carentan (Chinatown)
//gametype war map mp_cargoship (Wet Work)
//gametype war map mp_citystreets (District)
//gametype war map mp_convoy (Ambush)
//gametype war map mp_countdown
//gametype war map mp_crash
//gametype war map mp_crash_snow (Winter Crash)
//gametype war map mp_creek
//gametype war map mp_crossfire
//gametype war map mp_farm (Downpour)
//gametype war map mp_killhouse
//gametype war map mp_overgrown
//gametype war map mp_pipeline
//gametype war map mp_shipment
//gametype war map mp_showdown
//gametype war map mp_strike
//gametype war map mp_vacant



//////////////////////////////////
// Map Rotation // - change gametype to change gamemode after editing gametype above
//////////////////////////////////

set sv_mapRotation "gametype war map mp_backlot gametype war map mp_vacant gametype war map mp_bloc gametype war map mp_bog gametype war map mp_broadcast gametype war map mp_carentan gametype war map mp_cargoship gametype war map mp_citystreets gametype war map mp_convoy gametype war map mp_crash_snow gametype war map mp_creek gametype war map mp_crossfire gametype war map mp_farm gametype war map mp_killhouse gametype war map mp_overgrown gametype war map mp_pipeline gametype war map mp_showdown gametype war map mp_strike gametype war map mp_shipment gametype war map mp_countdown"

set sv_randomMapRotation 1 // 1 = sv_mapRotation is randomized, 0 = sequential order of sv_mapRotation
map_rotate

//////////////////////////////////
// Load Banlist
//////////////////////////////////
loadplugin simplebanlist

one thing you only need map_rotate either in command line or config not both

I just have it in config, not got it in command line

Thanks for pointing this out!
Still no time out connecting via internet.

This is the Server btw:


[::ffff:79.117.29.155]:28961

double check that your port forward is done correctly

My fucking dislexia!
192.169 istead of 192.168…

Thanks! @MAD_DAD you the man!