Tuesday, March 1, 2011

IPv4 Subnetting made easy

Ok, subnetting seems to be the topic everyone has issues with.  Why not use the subnet calculator at bitcricket?  Do you want to do it by hand ... then continue

First some reminders.  Lets look closely at the IPv4 address.  IPv4 addresses are broken up into 3 classes. Look at the first number closely since that determines the class of the IPv4 address and the default subnet mask. Use the following to help guide you:

Class A 1-126 - 255.0.0.0 or /8
Class B 128-191 - 255.255.0.0 or /16
Class C 192-223 - 255.255.255.0 or /24
Note: If the number is 127 it is a special class A address used for testing.  127.0.0.1 is our local lookback address and the only address in the range that I have seen used.

Note the size of the network is important and if the default size is not good then you can change is my modifying the subnet mask. If you are using /8 then the first 8 bits are used for network and the remaining bits are used for the host portion of the address.  You can find hundreds of tables in the web but you don't need them.  Just remember that N (network) and H (host) must equal 32 bits since IPv4 uses 32 bits.  Therefore if I have a default class A address the N=8 and H=24 or N + H = 32 or 8 + 24 = 32. So for example ...


10.3.4.1 - Class A - 255.0.0.0 or /8 or N=8 H=24
172.16.1.1 - Class B - 255.255.0.0 or /16 or N=16 H=16
192.168.1.1 - Class C - 255.255.255.0 or /24 or N=24 H=8


more later ...