Score:1

Iptables, Limit the number of IPs connected to a specific port per second

vn flag
A H

iptables can limit connections per ip at the same time with the --connlimit command .
but I want to know is there a way to limit connected IPs at the same time?
for example, if you limit connections to 30, then multiple IPs can connect to port, but any IP can create max 30 connections, but I want to create a rule that limits IPs, not every IP connections. for example, I want to set a rule that only 2 IPs can connect to the port at the same time with unlimited connections.

Nikita Kipriyanov avatar
za flag
Sorry it is unclear what is the difference between "limit connections per ip in seccond" and "to limit connected IPs per seccond". Please elaborate the question more.
A H avatar
vn flag
A H
for example, if you limit connections to 30T multiple IPs can connect to port but any IP can create max 30 connections per second, but I want to create a rule that limit IPs, not every IP connections. for example, I want to set a rule that only 2 IPs can connect to the port at the same time with unlimited connections. I hope I made my meaning clear
A.B avatar
cl flag
A.B
Actually connlimit limits the absolute number of connections, without notion of speed. The question talks about speed ("per second"), but your last comment doesn't appear to require handling of any speed. So the premise in the question needs reworking and examples should be added (in the question, not in comments).
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.