Score:0

How to exclude 1 ip from iptable rules?

tf flag

I want to block all ip's with > 200 connections to access my server with this rule:

iptables -A INPUT -p udp --dport 100:65535 -m connlimit --connlimit-above 200 -j REJECT

but at the same time I want to allow 1 IP to have unlimited connections.

So rule would be: If connections more then 200, block all ip's, except 1 IP: xxx

how do i do it?

thanks

Score:1
gn flag

You just need to bypass the block rule by preceding it with an ACCEPT rule for the special IP address. Something like (using the IP address from your other question):

iptables -A INPUT -p udp -s 87.91.143.119 -j ACCEPT
iptables -A INPUT -p udp --dport 100:65535 -m connlimit --connlimit-above 200 -j REJECT
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.