Forum

> > CS2D > Servers > Blocking an IP from connecting
Forums overviewCS2D overview Servers overviewLog in to reply

English Blocking an IP from connecting

14 replies
To the start Previous 1 Next To the start

old Blocking an IP from connecting

Rapidgame7
User Off Offline

Quote
Well, I banned a player for breaking my server rules, and after that the player just tries to connect every half second. These connection attemps makes the console get filled by "FAILED JOIN".

Is there any way I can make the server be "invisible" to a specific client after a few tries?

With "invisible" I mean "stop allowing the player to try to connect, as if the server didn't exist to the connecting one"



Did I explain myself right?

old Re: Blocking an IP from connecting

Rapidgame7
User Off Offline

Quote
I'm aware about that, but it's the same thing.
If I ban an IP, a name or an USGN, the banned can still continue trying to connect and flood my console.

old Re: Blocking an IP from connecting

G3tWr3ck3d
User Off Offline

Quote
Thats a normal thing, whenever a banned player tries to join your console will print that. So lets say that I spam the join button, it will also spam your console with that message

old Re: Blocking an IP from connecting

BcY
Reviewer Playing CS2D

Quote
1
iptables -A INPUT -s IP -j DROP

It's not only about DDos.If you use the code(if you're using linux to host your server) the blocked player wont be able to join or see your server in the server list,got it?

old Re: Blocking an IP from connecting

Rapidgame7
User Off Offline

Quote
Thanks to you all for your help, I'm going to reply to a few things:

user G3tWr3ck3d has written
Thats a normal thing, whenever a banned player tries to join your console will print that. So lets say that I spam the join button, it will also spam your console with that message

That's the exact reason I want to make the game ignore the connecting banned player, so the console stops getting filled by failed connections.

user BcY has written
1
iptables -A INPUT -s IP -j DROP

It's not only about DDos.If you use the code(if you're using linux to host your server) the blocked player wont be able to join or see your server in the server list,got it?

I do not use Linux and I'm not being DDoSed.
Plus, that only prevents empty packets. Someone connecting is not an empty packet as far as I know, and because of that the mesage will still appear and he can still see my server.




Apart from that, I wanted to mention that the player apparently did get bored and stopped trying. But he might come back sometime, and I would still need help, that is, unless it's inevitable.

old Re: Blocking an IP from connecting

_Yank
User Off Offline

Quote
@user Rapidgame7: No you're wrong, that command blocks every packet the specified IP sends (it does not apply to ddosers only). It would be enough if you were on linux.
Well, I'm almost sure there's a way to block an IP on windows, check your firewall settings.

old Re: Blocking an IP from connecting

GeoB99
Moderator Off Offline

Quote
In addition to what user _Yank said: to block an IP in order to prevent inbound traffic connection with your server, you must add a rule for that. A rule is just a set-up of instructions which the firewall must do (allowing incoming traffic connections, blocking, allow other programs to access to the Internet, etc.).

Note that when you add a rule, your rule must be specified as a Inbound rule and not vice-versa! Furthermore, when you begin to add a rule, firstly, you have to specify it as a Custom rule and nothing else!

If you don't have any idea in how to add a rule, maybe this tutorial is helpful for you (the link below):
http://www.howtogeek.com/112564/how-to-create-advanced-firewall-rules-in-the-windows-firewall/?PageSpeed=noscript

When you finished all steps, you will notice the specific IP is not able to connect to the your server.

EDIT

In general, you don't have to read all the parts of this tutorial, you just need to read the "Example Rule: Restricting Access" part in the below of the tutorial, unless you're a total newbie at configuring and setting up rules in Windows Firewall but I think that's not the case for this.
edited 2×, last 18.08.15 06:28:15 pm

old Re: Blocking an IP from connecting

Rapidgame7
User Off Offline

Quote
user GeoB99 has written
[...] To block an IP in order to prevent inbound traffic connection with your server, you must add a rule for that. [...] When you finished all steps, you will notice the specific IP is not able to connect to the your server.


I never knew that the advanced rules can block incoming IPs in first place, that's pretty neat.
But aside from that, what if the user has a dynamic IP?

With that said,
Is there a way for the server to check if the connecting user is actually banned and ignore the player?
Or I should add the rules by myself

EDIT:
A quick explanation with what I am thinking:
Instead of the routine of checking the connecting player for banned IPs/names/USGNs, finding it and logging it, the game sends a request to the firewall to block the incoming connection, as if the client requested a forbidden packet as a reason, possibly?

old Re: Blocking an IP from connecting

GeoB99
Moderator Off Offline

Quote
@user Rapidgame7: As for the dynamic IPs, the only way to prevent incoming traffic with them is by setting an IP range. Although, is not a pretty good idea because you can prevent also innocent people to join your server. An IP range is just a set of IPs that you don't want to connect to your server. For example:
1
87.137.*.*.*
If I want to add this IP range, every user that has an IP started with 87.137 won't be able to join in your server. May sound effective but actually it's not 100%, because as said you will prevent even innocent people.

user Rapidgame7 has written
Is there a way for the server to check if the connecting user is actually banned and ignore the player?
Or I should add the rules by myself

You just need to add the rule by yourself, until you finished, the windows firewall itself will handle the situation for you.

Oh and by the way: In the rule, also, you have to specify which program you want to apply for the rule. Let's say for example, if you host your server with the dedicated server binary file on your PC, then you should apply for that program in the rule.
To the start Previous 1 Next To the start
Log in to reply Servers overviewCS2D overviewForums overview