To break sobak's answer down some more for you so you can figure out how he took the /28 and got 255.255.255.240 you do this. The IP/Subnet mask is broken down into 4 "octets" or 4 groupings of 8 digits. So an IP of 10.10.10.34 has 4 groups of numbers, 3 groups of 10 and 1 group with 34. The mask is doen the same way. Now to figure an IPaddress or subnet mask from Binary you figure each grouping like this.
192.168.1.0 > Binary 11000000.10101000.00000001.00000000
Now the inorder to understand the binary you must understand how it is broken down.
192 = 11000000
there are 8 digits in each octet. 1+1+0+0+0+0+0+0
That have a specific value assigned to it.
1 1 0 0 0 0 0 0
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
The binary numbers are given a vaue. In this case the binary 11000000 = 128+64+0+0+0+0+0+0 which = 192
The values are always the same.(128,64,32,16,8,4,2,1 in this order)
Another example would be: 186.154.100.1
186 = 10111010
1 0 1 1 1 0 1 0
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
Added up: 128+0+32+16+8+0+1+0 = 186
154 = 10011010
1 0 0 1 1 0 1 0
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
Added up: 128+0+0+16+8+0+2+0 = 154
100= 01100100
0 1 1 0 0 1 0 0
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
Added up: 0+64+32+0+0+4+0+0 = 100
and 1 would simply be 00000001
Once you understand how to break an IP address down to its binary and back then the other addresses will be easy to do. Subnet mask is the same way.
So when you see an address such as 10.10.10.34/28
You will know how to break the IP address down to binary
00001010.00001010.00001010.00100010
So what about the /28 for subnet mask? Just as stated above the /(number) would be the number of bits in an IP address. a bit is represented by 1. So 28 is
11111111.11111111.11111111.11110000
If it was /16 it would be 16 1's followed by 16 0's (there are 32 bits in an IP address (4 groups of 8)
11111111.11111111.00000000.00000000
Then you would just take that number and apply what I showed above to each section.
/28 = 11111111.11111111.11111111.11110000
Which in turn translates to = 255.255.255.240
1 1 1 1 1 1 1 1
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
Which = 128+64+32+16+8+4+2+1 = 255
And the last octet would be:
1 1 1 1 0 0 0 0
^ ^ ^ ^ ^ ^ ^ ^
128 64 32 16 8 4 2 1
Which = 128+64+32+16+0+0+0+0 = 240
Understand? If not let me know.
James Collins
Field Service Engineer
A+, MCP
email: butchrecon@skyenet.net
Please let us (Tek-tips members) know if the solutions we provide are helpful to you. Not only do they help you but they may help others.