[BNM] .htaccess question / blocking IP range
Richard Grimwood
richard.grimwood at moving-edge.net
Fri Apr 4 19:46:30 BST 2008
Jonathan Hirsch wrote:
>> http://en.wikipedia.org/wiki/Classless_Inter-Domain_Routing
>
> I think I'm going to have to read that a few times to get my head
> round it ;-)
>
> Thanks for the help everyone, anyway.
>
> Cheers,
>
> Jon
/32 means one ip address
/31 means 2
/30 means 4
/29 means 8
/28 means 16
The reason being that there are 32 binary digits to an ip address.
Subnets allocated by providers are always 2 to the power something. It
makes the maths of routing easier.
Because of the requirement to identify a subnet that isn't a single ip
address which takes the 1st address in any subnet and provide a
broadcast address which takes the last ip address a /31 is effectively
useless.
So when someone refers to a /20 subnet in you head you subtract 20 from
32 gives you 12 . This means 2 to power 12 ip addresses = 4096
contiguous ip address. If you had all the machines on a single lan
segment then using one gateway-router(one ip address) the subnet address
and the broadcast address not being assignable you could attach 4093
uniquely addressable computers.
This explains why if your ISP gives you an 8 ip address subnet ( a /29)
only 5 are assignable to your servers. And why netmasks which are the
long hand way of writing '/' notation in decimal tend to start
255.255.255 etc. After about year of doing this you will just know that
a 64 ip address subnet has a mask of 255.255.255.192
More information about the BNMlist
mailing list. Powered by Wessex Networks