Hi -
On Tue, 20 Dec 2005 23:29:31 -0600, Bit Twister
<(E-Mail Removed)> wrote:
>I do not understand x.x.x.x/N notation.
>
>Could someone reply with a url or discription of how it works.
>Browsing through network HowTos has not helped.
>
>I am trying to use it in my firewall rules to block some networks.
>
>I thought it was number of bits but that did not pan out when looking
>at the following
N is the number of bits, starting from the left, that don't change. It
defines a range where the bits following the first N bits range from
all zeros to all ones.
>124.0.0.0/7
124.0.0.0 as bits = 01111100 00000000 00000000 00000000
First seven bits = ^^^^^^^
7 fixed, rest 0s = 01111100 00000000 00000000 00000000
7 fixed, rest 1s = 01111101 11111111 11111111 11111111
01111100 00000000 00000000 00000000 = 124.0.0.0
01111101 11111111 11111111 11111111 = 125.255.255.255
So 124.0.0.0/7 defines the range of 124.0.0.0 to 125.255.255.255.
125.255.255.255/7 also defines that same range as does any IP address
in that range with /7, but it is traditional (and easier to follow)
when all bits after the first N bits are zero. And some software
insists on it being that way.
Since there are 32 bits in an IPv4 IP address, N must be 0 to 32.
/0 defines the entire range of IPv4 IP addresses.
/32 defines a single IP address.
--
Ken
http://www.ke9nr.net/