Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I've set up limitations with command:

iptables -A INPUT -p tcp -i venet0 --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT

How can I exclude one subnet from this limitation? I want to unlimited connections from subnet.

share|improve this question
    
Insert a rule before this one where you specify the subnet and jump to ACCEPT. Life can be that easy. –  ott-- Aug 14 '13 at 17:37
add comment

1 Answer

You could try 2 things, to exclude subnet 192.168.0.0/16 execute the following command

# iptables -I INPUT -p tcp -i venet0 ! -s 192.168.0.0/16 --dport 80 -m limit --limit 25/minute --limit-burst 100 -j ACCEPT

the second one if you need exclude more then one subnets

# iptables -I INPUT -p tcp -i venet0 -s 192.168.0.0/16 --dport 80 -j ACCEPT
# iptables -I INPUT -p tcp -i venet0 -s 172.16.0.0/12 --dport 80 -j ACCEPT
# iptables -I INPUT -p tcp -i venet0 -s 10.0.0.0/8 --dport 80 -j ACCEPT

Also you could use RETURN instead of ACCEPT. It would be depend on your policy.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.