Answer the question
In order to leave comments, you need to log in
Need help with iptables. Who can help?
How can 701 ports the first two undefined IP addresses allow access the rest are blocked.
And 1 minutes later this rule is automatically deleted and again 3 and the rest of the IP address is blocked. How to do this please help!
This is done by iptables.
701 port only allows two connections. This is needed for shadowsock vpn server. I created one vpn server on port 701 and it only needs two connections, the others are not needed. I create a server there 20 connections. I only wanted 2. This two should be the first 2 connected.
It should be such only 2 user.
Not like this:
Rules should automatically block 3 and the rest.
I can even pay money for a solution. Write to telegram @ShadowsockTM
Answer the question
In order to leave comments, you need to log in
Please rewrite the question more correctly. most likely you need something more "smart", like fail2ban, or something of your own on a shell script + regular scheduler
More or less like this:
iptables -A INPUT -m limit --limit 2/min -p tcp --dport 701 --syn -j ACCEPT
iptables -I INPUT 1 -m tcp --syn --dport 701 -m connlimit --connlimit-mask 0 --connlimit-above 2 -j REJECT
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question