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.

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.

2 Answers 2

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.