Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If i wanted to block consecutive ip addresses from through i could issue this command 12 times blocking each ip individually:

iptables -A INPUT -s -j DROP

Is there a way to revise the syntax so that it will block all 12 addresses with one command?

share|improve this question

migrated from Sep 4 '11 at 0:00

This question came from our site for professional and enthusiast programmers.

up vote 3 down vote accepted
iptables -A INPUT -m iprange --src-range -j DROP
share|improve this answer

This will work.

iptables -A INPUT -m iprange --src-range -j DROP

share|improve this answer

Your Answer


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.