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'm not sure if this is the right place to ask this but I'm currently trying to get an Ubuntu 10.10 server up and running for the first time and I'm using Webmin for administration. I'm stuck on the setting up the firewall. What I need to do is to ONLY allow a range of IPs (e.g 128.171.21.1 - 128.171.21.100) to access the HTTP server and Webmin. I've seen a lot of tutorials but none of them fits what I needed.

Thanks in advance!

share|improve this question
    
@eggman20: You do not have to delete it. If people feel it should be closed, they will vote to do so. If people feel it's a valid question it will remain open. –  Peter van der Heijden Dec 22 '10 at 13:00
add comment

migrated from stackoverflow.com Dec 22 '10 at 19:58

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

1 Answer

It won't be exactly your range but you can use a format like 128.171.21.0/24 to allow all 255 addresses access. The number after the slash is the number of bits to keep the same so by increasing this to 25 you can narrow it further to 128 addresses (128.171.21.0 - 128.171.21.127). If you are creating a private network you should really use a dedicated private range like 192.168.x.x. Here is a reference: http://en.wikipedia.org/wiki/Private_network

share|improve this answer
    
Thanks for the reply. I got the same answer from serverfault.com. I will be allowing the whole subnet instead of just the range of IPs. Below are the commands that were given to me. I will be trying it once I get to work. $ sudo iptables -A INPUT -i lo -j ACCEPT $ sudo iptables -A OUTOUT -i lo -j ACCEPT $ sudo iptables -A INPUT -s 128.171.21.0/24 -p tcp -m tcp --dport 80 -j ACCEPT $ sudo iptables -A OUTPUT -p tcp --sport 80 -m state --state ESTABLISHED -j ACCEPT –  eggman20 Dec 22 '10 at 18:52
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.