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 000.00.000.26 through 000.00.000.37 i could issue this command 12 times blocking each ip individually:

iptables -A INPUT -s 000.00.000.26 -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 stackoverflow.com 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 000.00.000.26-000.00.000.37 -j DROP
share|improve this answer

This will work.

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

share|improve this answer

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.