Left 4 Dead server setup
From Www.FreeNerd.net
This guide is provided for informational purposes only. If you choose to use this guide for anything more than information, you do so "At Your Own Risk".
Contents |
Left 4 Dead server setup
Recently I have been playing quite a bit of Left 4 Dead and found that hosting a server must more difficult that with Day of Defeat Source or Counter Strike. I believe the culprit is the new lobbying system introduced with the game. I am not a huge fan of this system in it's current condition, but it brings with it some interesting options for online gaming.
Firewall Configuration
If you do not know anything about firewalls, you will be in for some hair pulling here. Below is a list of the default ports you need to allow through your firewall to your game server. I use inbound NAT to forward all of these ports to my server.
- UDP Ports
- 27015 - 27020
- 27005
- 1200
- TCP Ports
- 27015
NOTE:If you run your game server on a port other than the default 27015, you need to allow UDP and TCP inbound for that port. RCON commands run on your servers game port using TCP, the rest of the traffic should be UDP on the port.
Launching the Game
This example is for a Linux server, however it should work for a Windows host as well with minimal modification. Run this from the /home/<user>/l4d directory, or the directory that contains your L4D srcds_run file if different.
./srcds_run -game left4dead -ip <server.ip.goes.here> -hostport 27015 -secure -update
- To change your default game port, add the command -steamport xxxxx to this string. I would keep the port you run the game on inside the 27015 to 27020 range or you will need to adjust your rules. Don't forget to add a TCP inbound rule to your firewall for the port your game is on.
This is the command I use to launch the game, it's the result of quite a bit of trial and error and works great for me. You can use the Linux SRCDS server guide to setup your server, and replace the default "params" line this line in the service file.
Server.cfg file
Your need to create your server.cfg file. Create it in the /home/<user>/l4d/left4dead/cfg/ directory. Use the template below and modify the fields needed to customize your server.
//This configuration file provided my www.freenerd.net //Server setup and options hostname servername rcon_password rconpassword sv_lan 0 //Disable LAN option mp_disable_autokick 1 //Prevents a userid from being auto-kicked //Privatize your server //sv_allow_lobby_connect_only 0 //Only allow lobbies to connect to your server. //sv_steamgroup 123456 //sv_steamgroup_exclusive 1 sv_search_key "searchkey" //Set the search key to find your server // Server Rates and Bandwidth sv_minrate 5000 sv_maxrate 25000 sv_mincmdrate 10 sv_maxcmdrate 33 //Server Settings sv_cheats 0 // allow cheats to be used by the client. 0 is off 1 is on sv_consistency 1 // Force clients to pass a consistency check for critical files before joining server. 0 is off 1 is on sv_pausable 0 // enables or disables whether the server can be paused. 0 is off 1 is on sv_voiceenable 1 // Set Region sv_region 2 // Region Codes: 0 - US East coast, 1 - US West coast, 2 - South America, 3 - Europe, 4 - Asia, 5 - Australia, 6 - Middle East, 7 - Africa, 255 - world
Once the server.cfg file is in place, launch your server and check for it online. From the L4D console type in 'openserverbrowser' and you'll get the old Steam server browser window. Check the favorites tab and search by your public IP address. If you do not see a server responding from your public IP address it's probably a firewall or NAT issue.
