Battlefield 2

DragonBe shows you how to install, configure and run a dedicated linux Battlefield 2 server.

Getting the Battlefield 2 files

Battlefield 2 dedicated linux server

New updated patch available v1.4 !

bf2-linuxded-1.1.2963-795-installer.sh.gz (310 MB)
This is the Battlefield 2 linux dedicated server

Installation of Battlefield 2

Unpacking bf2-linuxded-1.1.2963-795-installer.sh.gz
$ cd /tmp
$ unzip /tmp/bf2-linuxded-1.1.2963-795-installer.sh.gz
Run the binary
$ chmod +x ./bf2-linuxded-1.1.2963-795-installer.sh
$ ./bf2-linuxded-1.1.2963-795-installer.sh

You'll have to accept the EA Games EULA and the PunkBuster Licence.
The binary will create the Battlefield 2 directory itself, so just point to the location where you keep all your games (i.e. /usr/local/games).

Configuration of Battlefield 2

Before you start up your Battlefield 2 server, you can modify the default server config file
$ cd /usr/local/games/bf2
$ vi ./mods/bf2/settings/serversettings.con

Example battlefield 2 configuration file

Customize your server

sv.serverName "DragonBe Battlefield2 Demo Server"
sv.password ""
sv.internet 1
sv.bandwidthChoke 0

For servers behind NAT/Firewalls

sv.serverIP ""
sv.serverPort 16567

Further detailed configuration

sv.welcomeMessage "Who wants to live forever !?!"
sv.punkBuster 1
sv.allowFreeCam 0
sv.allowExternalViews 1
sv.allowNoseCam 1
sv.hitIndicator 0
sv.maxPlayers 64
sv.numPlayersNeededToStart 2
sv.notEnoughPlayersRestartDelay 15
sv.startDelay 15
sv.endDelay 15
sv.spawnTime 15
sv.manDownTime 15
sv.endOfRoundDelay 15
sv.ticketRatio 100
sv.roundsPerMap 3
sv.timeLimit 0
sv.scoreLimit 0
sv.soldierFriendlyFire 100
sv.vehicleFriendlyFire 100
sv.soldierSplashFriendlyFire 100
sv.vehicleSplashFriendlyFire 100
sv.tkPunishEnabled 1
sv.tkNumPunishToKick 3
sv.tkPunishByDefault 0
sv.votingEnabled 1
sv.voteTime 90
sv.minPlayersForVoting 2
sv.gameSpyPort 29900
sv.allowNATNegotiation 0
sv.interfaceIP ""
sv.autoRecord 0
sv.demoIndexURL http://
sv.demoDownloadURL http://
sv.autoDemoHook "adminutils/demo/rotate_demo.py"
sv.demoQuality 1
sv.adminScript "default"
sv.timeBeforeRestartMap 30
sv.autoBalanceTeam 0
sv.teamRatioPercent 100

Battlefield 2 VoIP settings.
For better performance, you'd better set up a seperate system to handle voice connections.

sv.voipEnabled 1
sv.voipQuality 3
sv.voipServerRemote 0
sv.voipServerRemoteIP ""
sv.voipServerPort 55125
sv.voipBFClientPort 55123
sv.voipBFServerPort 55124
sv.voipSharedPassword ""

Other Battlefield 2 settings

sv.useGlobalRank 1
sv.useGlobalUnlocks 1
sv.sponsorText "Empowered by DragonBe ;-)"
sv.sponsorLogoURL "http://www.dragonbe.be/bin/gfx/dragonbe_logo.gif"
sv.communityLogoURL ""
sv.radioSpamInterval 6
sv.radioMaxSpamFlagCount 6
sv.radioBlockedDurationTime 30

Battlefield 2 Remote Console Access

The following steps are necessary for remote access on your Battlefield 2 server:

Create a default server config file
$ vi ./admin/default.cfg

Example contents of the default Battlefield 2 admin config

port=4711
password=XXXXXXXX

Battlefield 2 Commandline

Starting up the Battlefield 2 server.
$ cd /usr/local/games/bf2
$ ./start.sh

Battlefield 2 Firewall Settings

The following ports are used by Battlefield 2:

  • UDP 16567: Default Battlefield 2 server port
  • UDP 29900: Default GameSpy port
  • UDP 55125: Standard VoIP port
  • UDP 55124: Default VoIP server port
  • UDP 55123: Default VoIP client port