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

I know that:

211.95.79.186/24, it would allow 211.95.79.0 all the way up to 211.95.79.255.

and

211.95.0.0/16, it would allow 211.95.0.0 all the way up to 211.95.255.255.

and

192.168.1.30-50, it would allow 192.168.1.30 all the way up to 192.168.1.50 ?? <-- is that correct ?

but how do I allow the following:

31.223.128.0 all the way up to 31.223.159.255 ?

share|improve this question

closed as off-topic by ceejayoz, Ward, voretaq7 Nov 11 '13 at 17:53

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions must demonstrate a minimal understanding of the problem being solved. Try including attempted solutions, why they didn't work, and the expected results. See How can I ask better questions on Server Fault? for further guidance." – ceejayoz, Ward, voretaq7
If this question can be reworded to fit the rules in the help center, please edit the question.

2  
subnet-calculator.com/cidr.php –  ceejayoz Nov 11 '13 at 15:59
    
Thanks for the link it's great. but how do I do the following ? Allow from: 31.223.128.0 all the way up to 31.223.159.255 ?? –  compcobalt Nov 11 '13 at 16:21
    
@compcobalt have you looked at the rules in my answer? --src-range X-Y should work for any arbitrary range of addresses. –  plasmid87 Nov 11 '13 at 16:23
    
@plasmid87 that would be super cool and easy to do if I had access to a config file for the firewall :( –  compcobalt Nov 11 '13 at 16:25
1  
@compcobalt If you don't have "access to a config file for the firewall" how do you expect to make ANY changes? Come now my good man, be reasonable! We're sysadmins, not magicians! –  voretaq7 Nov 11 '13 at 17:54

1 Answer 1

up vote 1 down vote accepted

Try the iprange module. e.g.,:

iptables -A INPUT -p tcp -m iprange --src-range 24.250.0.0-24.250.127.255 -j ACCEPT
iptables -A INPUT -p tcp -m iprange --src-range 119.165.128.0-119.165.255.255 -j ACCEPT

EDIT:

As this must be done through the Webmin interface, try 31.223.128.0/19. Confirm here with "Mask Bits" set to 19.

share|improve this answer
    
I'm using Webmin to insert the ip addresses, I cannot add this anywhere ? –  compcobalt Nov 11 '13 at 16:22
    
@compcobalt if webmin doesn't provide direct iptables editing, I suggest following their instructions for configuring the firewall and use the commands listed in my answer. –  plasmid87 Nov 11 '13 at 16:27
    
@compcobalt I've updated my answer to reflect the constraint of doing this via Webmin. –  plasmid87 Nov 11 '13 at 16:37

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