# How to figure out and define a netwok range?

## MoonWalker

Numbers and mathematics have never been my strong side and have never been able to logically figure out this how to define a IP range in form of nnn.nnn.nnn.nnn/nn I "own" or have been delegated a part of a C net from my ISP starting with nnn.nnn.nnn.144 and ending nnn.nnn.nnn.159 and been said its range is defined by adding /240 - but how come? As when I put that info into Postfix for my network it errors.

Would be nice if someone could confirm the /240 and maybe supply a simple explanation on how it comes to /240 - maybe even a simple math example, or if this is not easy done a link to good reasing about it. I have some books that trys to explain but not to my understanding...

/Joakim

----------

## rac

There are two ways to define network masks, and you are mixing them, which is causing your problem.

Way #1: Verbose netmask

a.b.c.d/255.255.255.240 in your case.  Here all the bits in the mask are '1' in the parts of an address that are outside your network, and '0' in the parts of an address that are inside your network.  The 240 can be calculated by subtracting the number of addresses on your network (16) from 256.  A router can make routing decisions by paying attention only to the bits in an address that have corresponding '1' bits in the mask.

Other examples:

10.0.0.0/255.0.0.0 - a typical internal class A

192.168.0.0/255.255.255.0 - a typical internal class C

Way #2: Compact netmask

a.b.c.d/28 in your case.  Here the /28 refers to the number of contiguous bits at the start of a simple netmask.  The correct number can be calculated by subtracting the number of bits required to count all the addresses on your network (4 in your case) from 32.

Again for comparison:

10.0.0.0/8 - class A

192.168.0.0/24 - class C

----------

## MoonWalker

Ok thanks.

Way1# I knows about, it was more way2# that puzzled me. So as my network address is 212.3.10.144 and my broadcast address is 212.3.10.159 this range is then "compacted" as 212.3.10.144/28 right?

/Joakim

----------

## rac

 *MoonWalker wrote:*   

> this range is then "compacted" as 212.3.10.144/28 right?

 

Bingo.

----------

