think of 255.255.255.0 = 11111111.11111111.11111111.00000000
all the bits that are 'on' have to be identical - (which is why in the 255 examples the numbers must be exactly the same as all bits are on)
Think of it like so:
My home network has a subnet of 255.255.255.248 to allow for only 5 network devices (not counting the router at .1)
11111000=248
so regardless of what my IP is everything above the 1s must be the same, so lets take your example 192.168.2.1
192.168.2 must all be the same because 255 is all 1s. so we will isolate the subnet .248
1=00000001
248=11111000
so the first 5 bits are locked in just like the 192.168.2 was. Leaving us the last 3 to play with.
00000000=all 0s network address - unusable
00000001=router
00000010=2
00000011=3
00000100=4
00000101=5
00000110=6
00000111=broadcast address - unusable
same subnet of .248 with a more complex final IP octet like .166 and determining the available IPs in the network
10100000=network address
10100001=161
10100010=162
10100011=163
10100100=164
10100101=165
10100110=166
10100111=167=broadcast
This post has been edited by iamtheky: 10 February 2009 - 02:06 PM