Steam Game Server Ports, Autostart, and Update Script
Steam Game Server Ports
These are mostly for steam to communicate with other services when the server is running. (Ex. Friends, Group Servers [ l4d2 ], etc.) Additional rules may need to be added if running multiple servers on one dedicated server (ex. 27016, 27017, etc [what ever port a particular server is running on] ).
iptables -N SteamServers iptables -I INPUT -j SteamServers iptables -A SteamServers -p tcp -m tcp –dport 25565 -j ACCEPT iptables -A SteamServers -p udp -m udp –dport 27000:27014 -j ACCEPT iptables -A SteamServers -p tcp -m tcp –dport 27000:27014 -j ACCEPT iptables -A SteamServers -p tcp -m tcp –dport 27016 -j ACCEPT iptables -A SteamServers -p tcp -m tcp –dport 27030:27039 -j ACCEPT iptables -A SteamServers -p udp -m udp –dport 27020 -j ACCEPT iptables -A SteamServers -p udp -m udp –dport 27000:27015 -j ACCEPT iptables -A SteamServers -p udp -m udp –dport 27015 -j ACCEPT iptables -A SteamServers -p tcp -m tcp –dport 27015 -j ACCEPT service iptables save
Unfortunately most of the below is out-dated as valve has switched to SteamCMD.
Custom Script (Update.sh)
Script I use for updating all servers in a row (run and let it go). This information will eventually change as Valve is planning on moving away from HLDSUpdateTool and moving towards using SteamCMD for game server management.
#!/bin/bash clear echo -e "\nUpdating all HLDS Servers\n" ./steam -command update -game "Counter-Strike Source" -dir folder-name ./steam -command update -game "Counter-Strike Source" -dir folder-name ./steam -command update -game "Counter-Strike Source" -dir folder-name echo -e "Done\nDone\nDone\n\n"
Custom Script (# /etc/rc3.d/S99gameservers)
Script created for starting game servers when the server boots up. The /bin/su - <USER> runs the server under the specified user instead of running the servers as the root user. This also keeps things organized and secure among other things.:
#!/bin/bash echo -e "Starting CSS Servers" /bin/su - USER -c /path/to/startscript /bin/su - USER -c /path/to/startscript /bin/su - USER -c /path/to/startscript /bin/su - USER -c /path/to/startscript /bin/su - USER -c /path/to/startscript echo "Done!"
Popular Script / Customized (start-game.sh)
Server Startup Script Example. The "export RDTSC_FREQUENCY=2660.000000" line sets the server speed identical to the CPU and gives the server a quicker start.:
#!/bin/bash clear sleep 2 echo -e "\nStarting Server\n" export RDTSC_FREQUENCY=2660.000000 screen -A -m -d -S SCREEN-NAME /absolute/path/to/srcds_run -console -game cstrike +map aim_ag_texture2 +maxplayers 14 +fps_max 2000 -autoupdate +ip +port -debug +autoupdate echo -e "Server Started\n\n"