F
F
FataLeeer2015-12-07 15:47:36
linux
FataLeeer, 2015-12-07 15:47:36

How to restrict calls with ip?

Whether it is possible by means of iptables to limit calls to the server from one IP?
For example:
Calls to port 25565. If more than three calls per minute = ban for 3 minutes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2015-12-07
@FataLeeer

iptables -A INPUT -p tcp --dport 25565 -m conntrack --ctstate RELATED,ESTABLISHED -m limit --limit 3/s -j ACCEPT
iptables -A INPUT -p tcp --dport 25565 -m conntrack --ctstate RELATED,ESTABLISHED -j LOG

Write a script that will look at LOG and ban/unban.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question