L4DNation

Left 4 Dead Series => Left 4 Dead 2 => Topic started by: Sir on August 02, 2013, 07:36:15 am

Title: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on August 02, 2013, 07:36:15 am
Introduction:
I've been getting increasingly more questions regarding L4D2 Server setup for Linux as well as on how to protect them from simple DoS attacks. Seeing as most Server Install guides have not been updated to work with SteamCMD, a lot of people are left with confusion and I was hoping I could help a few people out.

This guide is intended to help Linux VPS/Dedicated Server owners out, I'm aware that there are still a few people using Windows as their Server OS and that they'd like some guidance as well, but I'm afraid that Linux is the "weapon of choice" for L4D2 Servers as they don't have "unfix-able" crashes related to confoglcompmod and are just much easier to protect against DoS. (I have a gut feeling the crashes could possibly be resolved with the arrival of lgofnoc though, I might add Windows to this guide later on)
Chapter 2 will of course also work for Windows.

Note: Regular GameServer owners can only make use of the server.cfg in this guide, you could possibly make use of DoS protection, but there's also only a handful of providers that will help you setup your IPTables.
Most Providers simply don't care and will let your server get attacked over and over again.
This is why running a VPS/VDS/Dedicated Machine is always better than a simple GameServer.
Full Control with little knowledge is always better than Limited Control and no support.

Chapters

VPS/VDS/Dedicated Machine Setup
- 1. Setting Up
- 2. DoS Protection

1. Setting up your Machine:

Alright so you've either purchased a VPS/VDS/Dedicated Machine, are ordering one right now or are thinking of purchasing one.
The first choice you will have to make is picking the Linux Distribution.
My personal recommendation would always be Debian, as it's probably the easiest to use and it seems to have the most benefits for Gaming Servers in terms of performance, due to its lightweight and efficiency.

This guide might contain several bits that are handled differently by other Distributions, I will make notes on parts that might require a different setup. You can either google for the answer or contact me on Steam if you need help on those.
----

After setting up the Linux distribution and logging into your Server by the use of (Putty - Click Me! (http://www.putty.org/)) it is recommended to install screen before you begin your Install.
Screen is a full-screen window manager that multiplexes a physical terminal between several processes (This basically means that it will run processes in the background, while also allowing you to keep processes running when you log off)
Code: [Select]
apt-get install screen
After installing screen, it is advised to create a separate user where you will run your L4D2 Server(s) on. Running servers on Root is never a good thing as it increases security risks.

Code: [Select]
// This will setup a user called l4d2 and allow you to set a password for it.
adduser l4d2

// This will switch from the root user to the l4d2 user
su - l4d2

// This will retrieve SteamCMD, which is used to get the L4D2 Files.
wget http://media.steampowered.com/client/steamcmd_linux.tar.gz

// This will extract the package to the current folder.
tar -xvzf steamcmd_linux.tar.gz

// This will start SteamCMD
./steamcmd.sh

// Time to log in with the anonymous account, you don't need your own.
login anonymous

// This one is optional, you can choose a folder to install to or it will create a default structure (Steam/Steamapps/Common/..)
force_install_dir <path>

// Download and Validate L4D2 Files!
app_update 222860 validate

// After you're done, you might want to leave this crazy SteamCMD Thing
quit

Voila, you have now aquired all the server files on your separate user.
Depending on how many servers you wish to run, you will have to setup your server.cfg now

Single Server (Only need server.cfg):
Code: [Select]
//Left 4 Dead 2 Server.cfg
//This file goes inside your L4D2 Server's "cfg" folder
 
//This is the name for your Left 4 Dead 2 Server
hostname "This Server is Cakey"

//Use this to prevent your custom hostfile and motdfile to be overwritten (rename the files accordingly)
hostfile host.txt // default, rename if custom.
motdfile motd.txt // default, rename if custom.

//Steam group # to assign to server & making server private
sv_steamgroup 13377331
sv_steamgroup_exclusive 1  // 1 = Restrict Server to SteamGroup (ID Above)
sv_search_key serveryolo
 
//Gametypes sets the gametypes you want your server to run
//----> Versus Only: sv_gametypes "versus"
//----> Survival Only: sv_gametypes "survival"
//----> Coop Only: sv_gametypes "coop"
//----> Realism Only: sv_gametypes "realism"
//----> Team Versus Only: sv_gametypes "teamversus"
//----> Scavenge Only: sv_gametypes "teamscavenge"
sv_gametypes "versus,realism,teamversus"

// No Tips from Game & Timeout
sm_cvar sv_gameinstructor_disable 1            // Disable Game Instructor?
sm_cvar sv_timeout 15                                  // Time players out after this many seconds after losing connection.

//Stableness and Networking stuff.
sm_cvar fps_max 0                                        // Forces Server to perform the best it can.
sm_cvar net_splitpacket_maxrate 30000      // Set Value to: (Tickrate / 2) * 1000
sm_cvar nb_update_frequency 0.024           // Lowest possible value before noticing stuttering common.
sm_cvar sv_minrate 30000                           // Should never change this.
sm_cvar sv_maxrate 60000                          // Set Value to: Tickrate * 1000
sm_cvar sv_mincmdrate 30                           // Should never change this.
sm_cvar sv_maxcmdrate 60                          // Set Value to Tickrate.
sm_cvar sv_minupdaterate 30                      // Should never change this.
sm_cvar sv_maxupdaterate 60                    // Set Value to Tickrate.
sm_cvar sv_client_min_interp_ratio -1
sm_cvar sv_client_max_interp_ratio 2

//Rcon password - Sets the password for remote rcon admin
rcon_password "passwordisfornibs"

//Allow connections without creating lobby. Set to 1 to allow lobby connections only
sv_allow_lobby_connect_only 0
 
//Region - This sets the lobby in which your server will be part of
//You will want to set this to the closest location to your server
//eastcoast - sv_region 0
//westcoast - sv_region 1
//south america - sv_region 2
//europe - sv_region 3
//asia - sv_region 4
//australia - sv_region 5
//middle east - sv_region 6
//africa - sv_region 7
//world - sv_region 255
sv_region 255
 
// Server Logging
sv_log_onefile 0 //Log server information to only one file.
sv_logbans 1 //Log server bans in the server logs.
sv_logecho 0 //Echo log information to the console.
sv_logfile 1 //Log server information in the log file.
sv_logflush 0 //Flush the log file to disk on each write (slow).
sv_logsdir logs //Folder in the game directory where server logs will be stored.
exec banned_user.cfg //List of banned steam ids.
exec banned_ip.cfg //List of banned IP addresses.
writeid
writeip
 
//Allow use of cheats
//0 = Off
//1 = On
sv_cheats 0
 
//All talk - Allow both teams to use audio chat to speak with each other
//0 = Off
//1 = On
sv_alltalk 0

Multiple Servers:
Most people will go for forking, this should be okay for pure basics, but can be quite problematic if you wish to have different launch parameters per server. (For example; Different Tickrates or wanting to run specific servers on constant ports)

Quote from: Valve
As part of the forking functionality mentioned below, the server parameters support substitution. For instance, if you specify +exec autoexec##.cfg, then the first server will execute autoexec01.cfg, the second autoexec02.cfg, and so on.

-fork <number> - Starts up the specified number of servers at once. They will each use the first available port number at 27015 or above.


I personally use the following approach;

Server.cfg contents
Code: [Select]
// This will be used as an alias to tell the server which server##.cfg to load
loadservercfg

For every server you're going to run, create a server.cfg and a run.cfg
Name the first one server01.cfg and run01.cfg, the next server02.cfg and run02.cfg and so on.
Setup the Server##.cfgs with the same data as you would setup a Single Server, but adjust the rates, hostname and the like to match the server's needs (Explained in the server.cfg above)

The run##.cfgs are setup like this
Code: [Select]
// Run01 will work with Server01, Run02 with Server02, etc
alias loadservercfg "exec server01"

// Hostport for the Server mentioned above, 27016 for the next server, etc.
hostport 27015

Now that we have everything setup for our Single or Multiple Servers, we're ready to setup a starting script to start/stop the servers.
I recommend using Notepad++ (http://notepad-plus-plus.org/) if you want to write Scripts for Linux without running into errors after uploading them to your server. (Standard Notepad editors will save everything in a DOS format, which makes Linux sad)

Start up Notepad++ and set the format to UNIX (Edit -> EOL Conversions -> Unix)
Save the following code as serverS.sh;
Code: [Select]
#### Define your Server's External IP
SERVER_IP="xxx.xxx.xxx.xxx"

#### Define the path for your L4D2 Server Files
#### Change if needed!
SERVER_PATH="/home/l4d2/Steam/SteamApps/common/left 4 dead 2/srcds_run"

#### Add/Remove/Change lines if needed, I'm sure you get the basic idea now
#### I personally remove "-tickrate" when using a 30 Tick Server, leaving it in shouldn't cause any harm if you have the tickrate enabler installed.
#### Taskset is to assign a Server to a certain CPU Core, if you don't define it the server will pick the least busy core. (0 = Core 1, 1 = Core 2, etc)
screen -mdS server01 taskset -c 0 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run01.cfg
screen -mdS server02 taskset -c 1 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run02.cfg
screen -mdS server03 taskset -c 2 "$SERVER_PATH" -game left4dead2 -tickrate 100 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run03.cfg
screen -mdS server04 taskset -c 3 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run04.cfg
screen -mdS server05 taskset -c 4 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run05.cfg
screen -mdS server06 taskset -c 5 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run06.cfg

Next, create another file and name it serverQ.sh, this will serve as your Server Quit script.
Code: [Select]
#### Only kill existing ones, if you remove/added/renamed "screens" you'll have to edit this too.
screen -r server01 -X quit
screen -r server02 -X quit
screen -r server03 -X quit
screen -r server04 -X quit
screen -r server05 -X quit
screen -r server06 -X quit

Once you're done, upload the files to your user's main folder, which is /home/<yourusername>
This way it'll be easy to launch the scripts directly after logging in.

Make sure you can run them though!
Code: [Select]
chmod +x /home/<yourusername>/serverS.sh
chmod +x /home/<yourusername>/serverQ.sh

2. DoS Protection (VPS/VDS/Dedicated):

Seeing as lately a lot more people think it's funny or cool to attack servers with whatever they find on Google's first result, I think more server owners should be aware on how to protect their Linux Servers.
I've spent a bit of time on testing/tweaking IPTables (http://en.wikipedia.org/wiki/Iptables), which is Linux's main line of defense against kids.

Luckily, I won't have to write an entire paragraph on this, as I've already done that! Phew!
I've uploaded and commented everything on my Github, which you can find here (https://github.com/SirPlease/IPTables)

Don't forget that not every dropped/flood packet is a DoS attempt, a lot of people (including me) have made that mistake in the past.
I've had several reports of Flooding Packets being caused by HLSW packets, adjusting the rules to prevent HLSW packets from being dropped results into allowing some DoS attacks coming through, so we'll just have to live with a few dropped packets because of HLSW. It should be easy to make a difference between a serious flood and HLSW being silly though.

----------------------------------------------------------------------------------------------------------------------

< FAQ >
Q: If I'm interested in getting a VPS/VDS/Dedicated Machine, what should I look for?
A: CPU Speed and Model as well as Location (Where are most of your players located?) and checking out Reviews isn't a bad idea either, as this will likely give you a better picture of Customer support, Network Quality and Server Performance.
Most providers also have public IPs/Servers available which you can ping to get an idea of average Pings

Personally, I have (had) pleasant experiences with the following;
US Based: NFO Servers (http://www.nfoservers.com) (VPS)
EU/US Based: SingleHop (http://www.singlehop.com/) (Full Dedicated Machine)

Q: I have issues with permission when trying to download the files!
A: Logging into the User directly when starting up PuTTy should resolve your problem.

Q: How can I see the servers that are currently active?
A: Use the command "screen -ls", this will list all the active screens, each has its own server inside.
Switch to a specific screen by typing "screen -r <screenname>"
If you wish to leave the screen and go back to where you were, press Ctrl + A +D

Q: Wouldn't it be better to quit the servers instead of killing the process?
A: Nobody's stopping you from writing up your own script!
I can safely assure you that it won't make a difference though, nothing will be harmed.

< Changelog >
August 2nd, Friday, 12:36PM GMT:
Published

August 5th, Monday, 12:26PM GMT:
Fixed $SERVER_PATH being useless on directories with spaces/symbols
Added some additional entries on the FAQ

August 14th, Wednesday 12:02PM GMT
Cut the guide a bit, my intention was to add a Promod Install guide to it, but I've decided to split it up into another Guide for readability.
Renamed Thread accordingly.

< Contribution/Testing >

fig newtons
Canadarox
ZenDigital
Title: Re: L4D2 Server Guide
Post by: CanadaRox on August 02, 2013, 02:05:16 pm
If you are using Debian you may want to check out the iptables-persistent (http://packages.debian.org/wheezy/iptables-persistent) package (it also exists for Ubuntu (http://packages.ubuntu.com/lucid/iptables-persistent)).  It is just an official init.d script for automatically restoring the IPTables rules.  When you first install it, it should save your current rules so you can get away with running Sir's script once and having it saved.  Another thing people should probably be installing is fail2ban (http://packages.debian.org/wheezy/fail2ban) (or something similar) which helps prevent brute force attacks over SSH.

If anyone is just running a single server you might want to try out this bash script I wrote: http://sprunge.us/MFYO?bash (http://sprunge.us/MFYO?bash).  Just edit lines 4-17 to set what you want and you can use it to start/stop/restart the server easily from the command line.
Title: Re: L4D2 Server Guide
Post by: Sir on August 02, 2013, 02:50:20 pm
If you are using Debian you may want to check out the iptables-persistent ([url]http://packages.debian.org/wheezy/iptables-persistent[/url]) package (it also exists for Ubuntu ([url]http://packages.ubuntu.com/lucid/iptables-persistent[/url])).  It is just an official init.d script for automatically restoring the IPTables rules.  When you first install it, it should save your current rules so you can get away with running Sir's script once and having it saved.


Ah cool, I've already went into depth on how to make sure the IPTables are saved after Server Reboots, but I guess a package like that could work, I'll add it in, thanks :)

Edit:
The only thing that's a bit bothersome is that it comes without a configuration wizard as it's aimed at experienced administrators.
I haven't actually gotten to check it out yet as I don't have time at the moment, but it sounds like it'd require additional explanation, which I've already given on the method I'm using in my IPTables setup.

Quote from: CanadaRox
Another thing people should probably be installing is fail2ban ([url]http://packages.debian.org/wheezy/fail2ban[/url]) (or something similar) which helps prevent brute force attacks over SSH.


Fail2Ban, I kind of have mixed feelings with this one. In theory it's a pretty cool tool and it sounds like a big plus.
Unfortunately in action, I have to say I am kind of disappointed with it. I've personally decided to drop them and let the IPTables I've got setup in that script protect SSH instead.
Title: Re: L4D2 Server Guide
Post by: fig newtons on August 02, 2013, 10:30:41 pm
Use rsa keys and disable passworded login
Title: Re: L4D2 Server Guide
Post by: ZenDigital on August 04, 2013, 05:06:12 am
Use rsa keys and disable passworded login

Explain plz, for those like myself who are completely new to this.
Title: Re: L4D2 Server Guide
Post by: Sir on August 04, 2013, 06:00:06 am
Explain plz, for those like myself who are completely new to this.


Same kind of method can be used for github (I believe bitbucket has something like this as well, can't remember)
It takes a little bit of an extra push, but if you suffer from a lot of bruteforce attacks it's definitely something to consider.

All in all, I'm pretty sure you'll be fine without it (while running just L4D2/most other Gameservers)
Here's a bit more info if you're still interested; RSA SSH Authentication (http://news.softpedia.com/news/How-to-Use-RSA-Key-for-SSH-Authentication-38599.shtml)
--

It's definitely very useful if you manage multiple machines though, as you don't have to remember the passwords.
Title: Re: L4D2 Server Guide
Post by: fig newtons on August 04, 2013, 08:03:19 pm
Quote
screen -mdS server01 taskset -c 0 $SERVER_PATH -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run01.cfg
screen -mdS server02 taskset -c 1 $SERVER_PATH -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run02.cfg
screen -mdS server03 taskset -c 2 $SERVER_PATH -game left4dead2 -tickrate 100 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run03.cfg
screen -mdS server04 taskset -c 3 $SERVER_PATH -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run04.cfg
screen -mdS server05 taskset -c 4 $SERVER_PATH -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run05.cfg
screen -mdS server06 taskset -c 5 $SERVER_PATH -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run06.cfg
Quote all your substitutions in bash. Otherwise this will choke if $SERVER_PATH has whitespace or special characters in it. Like this:

Quote
screen -mdS server01 taskset -c 0 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip "$SERVER_IP" +map c5m1_waterfront +exec run01.cfg
Title: Re: L4D2 Server Guide
Post by: fig newtons on August 04, 2013, 08:28:36 pm
Quote
Next, create another file and name it serverQ.sh, this will serve as your Server Quit script.
I don't know if this is an issue for the server but I'm pretty sure this just terminates the screen session rather than giving the server a chance to quit gracefully.
Title: Re: L4D2 Server Guide
Post by: Sir on August 04, 2013, 10:18:43 pm
Quote all your substitutions in bash. Otherwise this will choke if $SERVER_PATH has whitespace or special characters in it. Like this:

Hehe, I've never used whitespaces in my directories in Linux.
ZenDigital came to me with the server path not being recognized and I was hoping I could make it until today to edit that in without getting sniped here. xD

Need to make a few changes to the guide, which I will do when I come back home later this afternoon, thanks for pointing it out though :)

I don't know if this is an issue for the server but I'm pretty sure this just terminates the screen session rather than giving the server a chance to quit gracefully.

That's true, but it's not an issue at all :)
Title: Re: L4D2 Server Guide
Post by: CanadaRox on August 04, 2013, 10:34:56 pm
I don't know if this is an issue for the server but I'm pretty sure this just terminates the screen session rather than giving the server a chance to quit gracefully.

Half the time when I run 'quit' from the console the server segfaults anyways so I wouldn't be too worried about it closing gracefully.
Title: Re: L4D2 Server Guide
Post by: World of Noise on August 08, 2013, 12:35:55 am
Can we sticky this thread?  :D
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: S-Server on August 15, 2013, 09:19:08 am
Great guide thanks a lot , but you can get DDoS protected l4d2 servers for as little as £2.50 a month in europe
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Visor on August 15, 2013, 11:51:02 am
Great guide thanks a lot , but you can get DDoS protected l4d2 servers for as little as £2.50 a month in europe

Lol nope, best that can do is protect against 10 mb farts. Aside from that, anything lower than 1 gbps can't really be labelled as a 'distributed' denial of service. No fool is gonna lend you gigabit channels and raw horsepower for 5 bucks a month.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on August 15, 2013, 02:41:32 pm
Great guide thanks a lot , but you can get DDoS protected l4d2 servers for as little as £2.50 a month in europe

As Visor pointed out, don't believe everything your hosts claim, at least be realistic about it.
Most Providers will actually take your server down if it gets DDoSed. (Null route)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: S-Server on September 07, 2013, 03:08:22 pm
As Visor pointed out, don't believe everything your hosts claim, at least be realistic about it.
Most Providers will actually take your server down if it gets DDoSed. (Null route)

OVH in europe offer 450Gbit DDoS protection for free on all servers , and it works well , but OVH support is another story
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 07, 2013, 04:54:09 pm
OVH in europe offer 450Gbit DDoS protection for free on all servers , and it works well , but OVH support is another story

Sorry to dissapoint, but OVH is known to null-route very quickly.
Their DDoS protection is a joke and it definitely doesn't work well as apparently you're still null-routed if you have a 100mbps "DDoS" inc on your 2gbps connection.
"The attack was causing other machines to suffer from lag" was their response.
This was back in 2011 and they offered the same kind of stuff.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: winged_box on September 08, 2013, 02:55:12 am
Hi Sir,

Was hoping if you could help me on this one.

We were playing at 10VS10 server and at the end of the Dead Center stage after the scores was shown suddenly everyone just go back to their main game menu.

This is the 2nd time I encountered this.

Whenever the error message 'invalid counterterrorist spawn point' appear in my server console this problem will happen.

http://i.imgur.com/SQtSAY5.png (http://i.imgur.com/SQtSAY5.png)

What could be causing this error?

I'm using Force mission changer with sappy fix installed, L4DToolz and LEFT12DEAD.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 08, 2013, 05:32:50 am
I have a problem where the file is there but it isn't there. I had the frequently rename configs with numbers 2vs2 3vs3 to twotwo threethree for it to be read. Also happens to cvars sometimes when I copy and paste them in. Had to erase matchmode and type it all in. Using linux mint vm.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 08, 2013, 05:56:07 am
Ok this is getting really frustrating. In matchmode the line is there (hunters44) and it's not showing up. Everything else does.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 08, 2013, 07:48:17 am
Hi Sir,

Was hoping if you could help me on this one.

We were playing at 10VS10 server and at the end of the Dead Center stage after the scores was shown suddenly everyone just go back to their main game menu.

This is the 2nd time I encountered this.

Whenever the error message 'invalid counterterrorist spawn point' appear in my server console this problem will happen.

[url]http://i.imgur.com/SQtSAY5.png[/url] ([url]http://i.imgur.com/SQtSAY5.png[/url])

What could be causing this error?

I'm using Force mission changer with sappy fix installed, L4DToolz and LEFT12DEAD.


The "error" you see isn't uncommon on server start-up, you're looking at the wrong data as this clearly shows that the server.cfg is being executed. The error lies somewhere else.

You're a bit unclear on what exactly happens when the server sends everyone back to lobby, does it only ever happen on Dead Center Finale? Does it happen half-time or after the game is finished?

I have a problem where the file is there but it isn't there. I had the frequently rename configs with numbers 2vs2 3vs3 to twotwo threethree for it to be read. Also happens to cvars sometimes when I copy and paste them in. Had to erase matchmode and type it all in. Using linux mint vm.

Ok this is getting really frustrating. In matchmode the line is there (hunters44) and it's not showing up. Everything else does.


This is not related to your Linux Distro, I'd say it's a bad case of corrupted or lacking files/permissions.
Are you uploading everything through (S)FTP after setting everything up locally?
If you want to make sure your matchmodes.txt is okay, have a look at Epi's Matchmode Config Generator here (http://buttsecs.org/mmgen/)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 08, 2013, 07:55:54 am
Not just matchmodes it happens to other files with numbers in it. 1vs1 2vs2 3vs3. Also matchmodes is perfectly fine if it was missing anything it wouldn't load. Using linux on vmware. I would have to rename configs with numbers to like twotwo threethree etc. I'm thinking of reinstalling linux. If I am going to reinstall linux what distro would you recommend?
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 08, 2013, 09:40:33 am
Not just matchmodes it happens to other files with numbers in it. 1vs1 2vs2 3vs3. Also matchmodes is perfectly fine if it was missing anything it wouldn't load. Using linux on vmware. I would have to rename configs with numbers to like twotwo threethree etc. I'm thinking of reinstalling linux. If I am going to reinstall linux what distro would you recommend?

From what I recall the only issues I've ever seen with numbers in the name was when the folder/config started with a number, it's always best to do it at the end.

Debian 7 is the best one, hands down.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 08, 2013, 10:19:56 am
Why is debian the best? I googled debian 7 and I get a 'A so so distro not worth switching for' below. Also just moving the server files to the new distro wouldn't be a problem right?
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Visor on September 08, 2013, 11:11:54 am
I don't think there is any best or worst Linux distributions, unless either of these adjectives is succeeded by a contextual specification. As in, best for an ex-Windows user, best from LTS, stability or flexibility perspectives etc.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 08, 2013, 11:18:46 am
Why is debian the best? I googled debian 7 and I get a 'A so so distro not worth switching for' below. Also just moving the server files to the new distro wouldn't be a problem right?


There will always be haters, there's a difference between a justified opinion and one that has no arguments whatsoever.

http://www.debian.org/intro/why_debian (http://www.debian.org/intro/why_debian) :D
I've been running Debian 6 and now 7 for a year now and I've never had any complaints, everything is pretty easy to setup and configure (when needed), guides can be found everywhere.

As Visor pointed out, there's a lot of things that some distros really shine in.
For Debian that'd be flexibility, stability and easy-to-use.

It depends on how you set things over, but hey you can always make it a copy-paste back-up kind of thing. :)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: winged_box on September 08, 2013, 11:42:14 am
The "error" you see isn't uncommon on server start-up, you're looking at the wrong data as this clearly shows that the server.cfg is being executed. The error lies somewhere else.

You're a bit unclear on what exactly happens when the server sends everyone back to lobby, does it only ever happen on Dead Center Finale? Does it happen half-time or after the game is finished? here ([url]http://buttsecs.org/mmgen/[/url])


Now I recalled, the previous time it happened also at Dead Center map but is during the final stage. This time round is only at the alarm stage where players need to rush up and turn off the alarm.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: CanadaRox on September 08, 2013, 12:59:25 pm
Why is debian the best? I googled debian 7 and I get a 'A so so distro not worth switching for' below. Also just moving the server files to the new distro wouldn't be a problem right?

I checked out that review and it is pretty poorly done.  The few points he makes seem to be: he doesn't like GNOME 3, he couldn't find his wireless drivers, an "aging" kernel, not a huge selection of software in the repo, and not having enough software pre-installed.

The first point doesn't matter since you shouldn't be installing a desktop environment on a server.  (And for anyone that wants to argue this, you can easily replace GNOME 3 with something you like).  The wireless drivers are likely because Debian disables the non-free/contrib repositories by default so if the driver relies on any non-free software, you must enable the correct repo(s).  A non-issue since most non-obscure server hardware will be well supported, as will any virtual hardware in a virtual machine.  The "aging" kernel isn't aging at all, it is a longterm support kernel that was last updated a bit over a month ago (https://www.kernel.org/, (https://www.kernel.org/,) 3.2.50 at the time of this post).  Debian usually has their own patches they apply as well.  The goal is to give you the important new features but not give up any stability.  Exactly what you want on a server.  Enabling the contrib/non-free repos fixes not having a huge selection of software if you can't find what you need in the free repos.  And finally, not having a ton of bloat initially is great for a server.  No background services to disable, just set up what you need and nothing more.

(Non-free doesn't mean it costs money, it means it doesn't fit FSF's definition of free software, which essentially is software that you can edit and redistribute (https://en.wikipedia.org/wiki/Free_software, (https://en.wikipedia.org/wiki/Free_software,) https://www.fsf.org/ (https://www.fsf.org/)))

tl;dr: the author of that review didn't consider the demographic that Debian is aiming at, people that want a distro that is very stable or offers maximum freedom with the software.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 16, 2013, 10:03:53 am
This distro was tiring... I found it lacking lots of dependencies. Trying to fix ./steamcmd.sh not being found. apt-get install ia32-libs 7-8 dependencies.... Spent alot of time going through the internet why i couldn't find some software.. Turned out to be sources.list missing some deb... Not happy :(
This was 7.1 stable.

I'm going to use another distro and i'll start on debian again when i have lots of free time.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 16, 2013, 11:52:41 am
This distro was tiring... I found it lacking lots of dependencies. Trying to fix ./steamcmd.sh not being found. apt-get install ia32-libs 7-8 dependencies.... Spent alot of time going through the internet why i couldn't find some software.. Turned out to be sources.list missing some deb... Not happy :(
This was 7.1 stable.

I'm going to use another distro and i'll start on debian again when i have lots of free time.

This is not due to a missing deb.

Code: [Select]
dpkg --add-architecture i386 # enable multi-arch
apt-get update
apt-get install libc6:i386 # install base 32bit libraries
apt-get install lib32z1

This will resolve all your issues and only takes less than a minute!
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 16, 2013, 05:31:01 pm
What do you do when you finish installing debian (commands etc)?
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 16, 2013, 11:24:28 pm
What do you do when you finish installing debian (commands etc)?

Then you happily follow this guide.. :D
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 17, 2013, 01:06:38 am
No i mean if you do any other commands... if you reinstalled debian what do you install/update? like apt-get update.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on September 17, 2013, 02:20:24 am
No i mean if you do any other commands... if you reinstalled debian what do you install/update? like apt-get update.

If you reinstall debian fresh you should already be fine, after following the notes I posted earlier any outdated files will be updated anyway.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on September 17, 2013, 03:59:24 am
I guess it was because I downloaded the full package. I installed with the network version and it downloaded everything :|
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: S-Server on October 04, 2013, 01:42:07 pm
Sorry to dissapoint, but OVH is known to null-route very quickly.
Their DDoS protection is a joke and it definitely doesn't work well as apparently you're still null-routed if you have a 100mbps "DDoS" inc on your 2gbps connection.
"The attack was causing other machines to suffer from lag" was their response.
This was back in 2011 and they offered the same kind of stuff.

 , check out the hack forums you will see OVH is protected 100% and a reseller is selling l4d2 servers 8 slots for 3£ a month

Quote
I've tried to take down some OVH Roubaix servers using some rooted linux servers. I think I might had over 20 gbps in total the server was hosting a website and other crap so I've took a look at the website at the start which was running perfectly fine and fast afterward I've hit it with my linux servers and I've cleared my cache and loaded the page again and It was as fast as it was before.. It pisses me off


http://www.hackforums.net/showthread.php?tid=3641627&page=17 (http://www.hackforums.net/showthread.php?tid=3641627&page=17)

these guys are the experts on hacking ;D and they cant do it =D
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on October 04, 2013, 01:43:36 pm
, check out the hack forums you will see OVH is protected 100% and a reseller is selling l4d2 servers 8 slots for 3£ a month

[url]http://www.hackforums.net/showthread.php?tid=3641627&page=17[/url] ([url]http://www.hackforums.net/showthread.php?tid=3641627&page=17[/url])

these guys are the experts on hacking ;D and they cant do it =D


I had a look at them recently and yeah, it's good to see they've stepped up their game majorly.
OVH was severely lacking back in the day, from what I heard they took a 190M Loan and did some work.
Too bad they're all sold out though. :)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: S-Server on October 04, 2013, 01:45:50 pm
I had a look at them recently and yeah, it's good to see they've stepped up their game majorly.
OVH was severely lacking back in the day, from what I heard they took a 190M Loan and did some work.
Too bad they're all sold out though. :)

yes true and there support is pretty bad , but this is a start to DDoS free hosting which is what we all want , and those little mad kiddies will have to find some spiders to dismember instead ;)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on October 04, 2013, 01:55:33 pm
yes true and there support is pretty bad , but this is a start to DDoS free hosting which is what we all want , and those little mad kiddies will have to find some spiders to dismember instead ;)

Definitely agree, I'm protected by Staminus atm.
Getting pretty bored of seeing these silly attempts

Code: [Select]
72.20.56.150        Oct 4 10:52:22 PDT 2013        Oct 4 11:22:45 PDT 2013        4.59 Gbps        442,121 pps
72.20.56.150        Oct 4 09:05:22 PDT 2013        Oct 4 10:03:26 PDT 2013        7.61 Gbps        728,168 pps
72.20.56.150        Oct 4 00:36:24 PDT 2013        Oct 4 04:07:59 PDT 2013        23.89 Gbps        2,250,663 pps
72.20.56.150        Oct 3 15:27:23 PDT 2013        Oct 3 16:37:27 PDT 2013        1.77 Gbps        225,918 pps
72.20.56.150        Oct 3 11:52:21 PDT 2013        Oct 3 13:02:19 PDT 2013        7.24 Gbps        693,637 pps
72.20.56.150        Oct 3 08:26:23 PDT 2013        Oct 3 08:56:21 PDT 2013        814.15 Mbps        82,117 pps
72.20.56.150        Oct 3 07:14:16 PDT 2013        Oct 3 08:25:23 PDT 2013        15.02 Gbps        1,431,365 pps
72.20.56.150        Oct 3 05:57:51 PDT 2013        Oct 3 07:07:52 PDT 2013        11.61 Gbps        1,106,112 pps
72.20.56.150        Oct 3 03:42:25 PDT 2013        Oct 3 05:17:17 PDT 2013        15.57 Gbps        1,477,455 pps
72.20.56.150        Oct 2 10:25:11 PDT 2013        Oct 2 10:38:07 PDT 2013        529.63 Mbps        61,607 pps
72.20.56.150        Oct 2 05:25:07 PDT 2013        Oct 2 06:14:28 PDT 2013        14.23 Gbps        1,360,748 pps
72.20.56.150        Oct 1 11:11:20 PDT 2013        Oct 1 14:38:54 PDT 2013        18.62 Gbps        1,747,462 pps
72.20.56.150        Oct 1 08:56:23 PDT 2013        Oct 1 09:48:04 PDT 2013        6.79 Gbps        645,158 pps
72.20.56.150        Oct 1 06:49:01 PDT 2013        Oct 1 07:59:04 PDT 2013        5.74 Gbps        545,837 pps
72.20.56.150        Oct 1 04:14:32 PDT 2013        Oct 1 05:11:45 PDT 2013        9.90 Gbps        930,615 pps
72.20.56.150        Oct 1 02:11:51 PDT 2013        Oct 1 03:34:12 PDT 2013        22.99 Gbps        2,151,333 pps
72.20.56.150        Sep 30 12:25:37 PDT 2013        Sep 30 13:35:34 PDT 2013        3.10 Gbps        299,621 pps
72.20.56.150        Sep 30 11:09:36 PDT 2013        Sep 30 12:12:05 PDT 2013        2.37 Gbps        608,240 pps
72.20.56.150        Sep 30 09:21:27 PDT 2013        Sep 30 09:51:33 PDT 2013        1.08 Gbps        108,545 pps
72.20.56.150        Sep 30 08:00:06 PDT 2013        Sep 30 08:22:23 PDT 2013        3.20 Gbps        368,729 pps
72.20.56.150        Sep 30 01:28:35 PDT 2013        Sep 30 01:58:35 PDT 2013        21.04 Gbps        1,919,618 pps
72.20.56.150        Sep 29 23:51:21 PDT 2013        Sep 30 01:01:20 PDT 2013        22.68 Gbps        2,055,322 pps
72.20.56.150        Sep 29 16:05:28 PDT 2013        Sep 29 18:12:40 PDT 2013        16.84 Gbps        1,567,411 pps
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: ZenDigital on October 25, 2013, 08:20:40 pm
I've discovered a few neat tricks in regards to the start/stop scripts you have on here.

First, and Epi gets credit for showing me this one...

Instead of saving the scripts as .sh files, just format them for unix and save them as the "All (*.*)" file type under the file type drop down menu.

And second,

In addition to your Start and Stop scripts, you can also create a Restart script by combining the contents of both the Start and Stop scripts. This is accomplished by Creating a file and inserting the Stop script contents above the Start script contents.

For Example:
Code: [Select]
#### Only kill existing ones, if you remove/added/renamed "screens" you'll have to edit this too.
screen -r server01 -X quit
screen -r server02 -X quit
screen -r server03 -X quit
screen -r server04 -X quit
screen -r server05 -X quit
screen -r server06 -X quit

#### Define your Server's External IP
SERVER_IP="xxx.xxx.xxx.xxx"

#### Define the path for your L4D2 Server Files
#### Change if needed!
SERVER_PATH="/home/l4d2/Steam/SteamApps/common/left 4 dead 2/srcds_run"

#### Add/Remove/Change lines if needed, I'm sure you get the basic idea now
#### I personally remove "-tickrate" when using a 30 Tick Server, leaving it in shouldn't cause any harm if you have the tickrate enabler installed.
#### Taskset is to assign a Server to a certain CPU Core, if you don't define it the server will pick the least busy core. (0 = Core 1, 1 = Core 2, etc)
screen -mdS server01 taskset -c 0 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run01.cfg
screen -mdS server02 taskset -c 1 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run02.cfg
screen -mdS server03 taskset -c 2 "$SERVER_PATH" -game left4dead2 -tickrate 100 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run03.cfg
screen -mdS server04 taskset -c 3 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run04.cfg
screen -mdS server05 taskset -c 4 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run05.cfg
screen -mdS server06 taskset -c 5 "$SERVER_PATH" -game left4dead2 -tickrate 60 -maxplayers 16 -ip $SERVER_IP +map c5m1_waterfront +exec run06.cfg

you can name the file "restart" or just "rs" like I do. so when I want to do a quick restart I just login to putty and enter "./rs".

For those of you who run multiple sockets, I.E. multiple game servers on the same VDS, I highly suggest creating Start, Stop, and Restart scripts for each individual server, this will avoid interrupting any servers in use should you only want to start, stop, or restart one of them.

For example, I have 2 L4d2 servers running on a dual core VDS, so my scripts (in command form) are listed as so:


Granted this might seem a bit overboard but it makes things a lot easier and quicker especially if you happen to be in the middle of a game and someone requests a restart for a server.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: fig newtons on October 26, 2013, 06:00:19 pm
The extension shouldn't matter with any of this. It's a good idea to get in the habit of including a shebang in every script though:

Code: [Select]
#!/bin/bash
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: winged_box on November 30, 2013, 02:20:13 pm
I managed to set-up my VPS with a L4D2 dedicated server and it was running fine.

However, it always start in coop mode even though I already set sv_gametype "versus" in my server.cfg

Any idea why is it so?
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on November 30, 2013, 03:08:59 pm
I managed to set-up my VPS with a L4D2 dedicated server and it was running fine.

However, it always start in coop mode even though I already set sv_gametype "versus" in my server.cfg

Any idea why is it so?

sv_gametypes is used to prevent random lobbies from creating gametypes you don't allow on your server.
It can be overwritten at any time by forcing the server as a lobby leader or by a simple server start-up, if you want your server to start in versus you should install Sourcemod and add "sm_cvar mp_gamemode versus" to your server.cfg
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: winged_box on December 01, 2013, 08:18:54 am
sv_gametypes is used to prevent random lobbies from creating gametypes you don't allow on your server.
It can be overwritten at any time by forcing the server as a lobby leader or by a simple server start-up, if you want your server to start in versus you should install Sourcemod and add "sm_cvar mp_gamemode versus" to your server.cfg

Already did that in my server.cfg

Anyway, it's solved now.

I add a command "+map c8m1_apartment versus' when launching and now it always start in versus mode.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on January 16, 2014, 06:51:18 am
@sir
I have a problem with your iptabes. Can't connect and doesn't show the server on lan.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on January 16, 2014, 07:02:30 am
@sir
I have a problem with your iptabes. Can't connect and doesn't show the server on lan.

Did you actually adjust the file or did you just throw it in and execute it?
It has loads of comments in it to help people understand what every line does, just follow those and you should be good to go. :)
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on January 16, 2014, 09:04:22 am
Code: [Select]
#!/bin/sh
 
####################################################
############# Customize Stuff HERE #################
####################################################
 
############################## IMPORTANT - WARNING! #################################################
######                                                                                         ######
###### If you're not using some of these definitions, put a # in front of it                   ######
###### Also, don't forget the lines in the actual IPTables down below, block them with #!      ######
######                                                                                         ######
############################## IMPORTANT - WARNING! #################################################
 
#### Your default SSH Port (Can also be used for FTP)
SSH_PORT="22:23"
 
#### Your GameServer Ports (This will take care of RCON Blocks and Invalid Packets.
GAMESERVERPORTS="27020:27050:27080:27110"
 
#### Your home IP, this is only for remote RCON through HLSW, as you can use the !rcon command on the server as admin. (http://www.whatismyip.com/)
YOUR_HOME_IP="tried external and internal ip"
 
#### Any additional Machines/Users you'd like to allow unlimited access to the Machine the server is hosted on.
#### I personally allow the Machine that controls Sourcebans, this prevents the need to open and rate limit MySQL ports.\
#### Remove "#" here and also in the IPTable rules below
# WHITELISTED_IPS="733.1.13.337"
 
#### UDP Ports you want to protect, feel free to remove 3306 (MySQL) and 64738 (Mumble) if you don't use them.
#### Add GameServers too, in case a flood of valid packets comes in
 
#### To add a Port Range use ":", Example; "27015:27022"
#### You can add port ranges and single Ports together as well, Example; "27015:27022,80"
UDP_PORTS_PROTECTION="27020:27050:27080:27110"
 
#### TCP Ports you want to protect (Remove the # if you wish to protect a few Ports, also remove the # in the actual IPTables below.
 
#### To add a Port Range use ":", Example; "27015:27022"
#### You can add port ranges and single Ports together as well, Example; "27015:27022,80"
# TCP_PORTS_PROTECTION=""
 
##########################################################
############# Customization Stuff ENDS HERE ##############
##########################################################
 
###################################################################################################################
# _|___|___|___|___|___|___|___|___|___|___|___|___|                                                             ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__        IPTables: Linux's Main line of Defense               ##
# _|___|___|___|___|___|___|___|___|___|___|___|___|        IPTables: Linux's way of saying no to DoS kids       ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__                                                             ##   
# _|___|___|___|___|___|___|___|___|___|___|___|___|        Version 1.0.1 -                                      ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__        IPTables Script created by Sir                       ##
# _|___|___|___|___|___|___|___|___|___|___|___|___|                                                             ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__        Sources used and Studied;                            ##
# _|___|___|___|___|___|___|___|___|___|___|___|___|                                                             ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__  http://ipset.netfilter.org/iptables.man.html               ##
# _|___|___|___|___|___|___|___|___|___|___|___|___|  [url]https://forums.alliedmods.net/showthread.php?t=151551[/url]      ##
# ___|___|___|___|___|___|___|___|___|___|___|___|__  http://www.cyberciti.biz/tips/linux-iptables-examples.html ##
###################################################################################################################
 
## Cleanup Rules First!
##--------------------
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -F
iptables -X
##--------------------
 
## Policies
##--------------------
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT
##--------------------
 
## Create Filter
##---------------------
iptables -N filter
iptables -N LOGINVALID
iptables -N LOGFLOOD
##---------------------
 
## Create Filter Rules
##---------------------
iptables -A filter -m state --state NEW -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 5 --hashlimit-mode srcip,dstport --hashlimit-name DOSPROTECT --hashlimit-htable-expire 60000 -j ACCEPT
iptables -A LOGINVALID -m limit --limit 60/min -j LOG --log-prefix "Invalid Packets Dropped: " --log-level 4
iptables -A LOGFLOOD -m limit --limit 60/min -j LOG --log-prefix "Valid Packets (Flood) Dropped: " --log-level 4
iptables -A LOGINVALID -j DROP
iptables -A LOGFLOOD -j DROP
 
 
# Allow Self
iptables -A INPUT -i lo -j ACCEPT
 
# Allow Whitelisted IPs
# iptables -A INPUT -s $WHITELISTED_IPS
 
# Accept Established Connections
iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
 
# Block Packets ranging from 0:28, 30:32, 46 and 2521:65535 (Never Used, thus Invalid Packets) - This will catch all DoS attempts and Invalid Packet (weak) DDoS attacks as well.
iptables -A INPUT -p udp -m multiport --dports $GAMESERVERPORTS -m length --length 0:28 -j LOGINVALID
iptables -A INPUT -p udp -m multiport --dports $GAMESERVERPORTS -m length --length 30:32 -j LOGINVALID
iptables -A INPUT -p udp -m multiport --dports $GAMESERVERPORTS -m length --length 46 -j LOGINVALID
iptables -A INPUT -p udp -m multiport --dports $GAMESERVERPORTS -m length --length 2521:65535 -j LOGINVALID
 
# Rate Limit
iptables -A INPUT -p udp -m multiport --dports $UDP_PORTS_PROTECTION -j filter
iptables -A INPUT -p udp -m multiport --dports $UDP_PORTS_PROTECTION -j LOGFLOOD
# iptables -A INPUT -p tcp -m multiport --dports $TCP_PORTS_PROTECTION -j filter
 
 
#
# Rcon Usage - Only allow your own IP!
# Whitelisting is much more effective than limiting it, as it can still be abused, so please get yourself a Static IP.
# Admins can use !rcon on the server, so this is mainly for remote managing (HLSW)
 
iptables -A INPUT -p tcp -m multiport --dports $GAMESERVERPORTS -s $YOUR_HOME_IP -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports $GAMESERVERPORTS -j DROP
 
# SSH
iptables -A INPUT -p tcp --dport $SSH_PORT -s $YOUR_HOME_IP -j ACCEPT
iptables -A INPUT -p tcp --dport $SSH_PORT -m state --state NEW -m hashlimit --hashlimit-upto 1/sec --hashlimit-burst 20 --hashlimit-mode srcip,dstport --hashlimit-name SSHPROTECT --hashlimit-htable-expire 60000 -j ACCEPT
 
## Drop everything else!
##--------------------
iptables -A INPUT -j DROP
iptables -A FORWARD -j DROP
iptables -A OUTPUT -j ACCEPT
##--------------------
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: Sir on January 16, 2014, 10:59:00 am
Change Gameserverports to "27020:27050,27080:27110"

Also, are you really running 60 servers? Impressive.
If not, you're supposed to use commas: "27020,27050,27080,27110"
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on January 16, 2014, 09:07:42 pm
Lol only 4 thanks.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: sethrow on January 30, 2014, 12:32:27 am
You should update the post telling users that they should get distros with glibc over 2.13.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: MINEX on October 31, 2014, 04:14:50 am
i've set up a VPS with NFOServers. However I  notice infected appear closer then they should be. Especially hunter's jump reg is nearly instant when he jumps near to me. Any idea guys? Some server tricks or is this a nature of VPS?
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: IMGunnaHurl on January 15, 2017, 10:15:53 pm
I am having trouble at the chmod command. I run it from the user l4d2 root and from the dir that the startS.sh is in but when I run
./startS it says file /dir does not exist etc etc. My dir structure is user:l4d2 /l4d2-server/startS.sh

i got it to work once but I don't remember if I used a different path or what.

Yes I am 2 days as a linux user. I am running ubuntu 16.04 btw.
Title: Re: L4D2 Server Guide (VPS/Dedicated Machine)
Post by: volarium on January 17, 2017, 04:19:17 pm
I am having trouble at the chmod command. I run it from the user l4d2 root and from the dir that the startS.sh is in but when I run
./startS it says file /dir does not exist etc etc. My dir structure is user:l4d2 /l4d2-server/startS.sh

i got it to work once but I don't remember if I used a different path or what.

Yes I am 2 days as a linux user. I am running ubuntu 16.04 btw.

If you haven't figured this out on your own yet, I think you will need to post the contents of the script and the specific error message.