Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

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

I already block some simple ip lighttpd but I want to block a whole network. I've problem to understand what is this network address for example and/or network? What is this /8 or /24 means? I use $HTTP["remoteip"] to add my ip I want to deny the access.

share|improve this question

The numbers after the slashes are subnet prefixes in CIDR notation (they're just another way to express subnet masks). Subnets and CIDR are a pretty fundamental concept in IP networking and you won't avoid learning how they work. denotes all addresses from to (the most significant 8 bits are specified, the rest can be anything) denotes all addresses from to

It even works with numbers that aren't multiples of eight: means to If you're not comfortable doing bit manipulations in your head, there are numerous calculators for this sort of stuff. netmask is a very useful CLI tool, and you can also find many web-based ones if you search for them. With netmask, if you want to block addresses to, you can say

netmask -c

and you'll get the best subnets that describe the range (there will likely be more than one, and they all have to be specified to describe the range).

If you just want to specify one address, you either leave out the /n, or specify /32. Which one is acceptable/preferred depends on the software that's parsing it.

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.