I'm going to start running a gameserver soon and I want a way to reduce the the damage of a denial of service attack.
I want to make it so when someone joins the game their ip adress is added to a textfile (can already do this) and In the event of an attack I can simply use the text file as a whitelist and only allow connections to the server from the IPS that have joined the game in the past. Therefore allowing any user that has played before to join during an attack.
The server is running centOS. Is there anyway I can create a script that I can execute during and after an attack to enable/disable protection?
Or could anyone provide me with a command that uses iptables or whatever it is to whitelist a specified IP and a command that can pipe lines from a text file for use in this situation.
I am not very experienced at all with this kind of thing.
Thanks in advance.