IP Subnetting
Performing IP Subnetting is part art and mostly science (at least maths). You need somewhere to start and an understanding of what and how you are going to break up the address space, that is the art part, the science comes with calculating out all the address break points.
For a reference on how to do IP address subnetting, check out IP Addressing and Subnetting for New Users
These are tables to help in the understanding and generation of VLSM (Variable Length Subnet Masks) networks and CIDR (Classless Inter Domain Routing) which is what the Internet currently uses to route packets on the Internet Backbone. It makes it possible to represent the millions of networks which form the Internet to be represented by less than 100,000 routes.
For a WAN link you would use 255.255.255.252, which would give you for example 203.8.7.248 for a subnet address and 203.8.7.249 and 203.8.7.250 for each end and 203.8.7.251 as the broadcast address. The next subnet would be 203.8.7.252.
To calculate the number of address in a subnet mask you would subtract the final byte from 255 and add 1, ie 255 - 252 + 1 = 4 which is the number of address for that subnet mask. The reason for adding one is because the numbering range is 0 to 255 which actually gives you 256, hence the add 1. This works for all masks to. Then you get to reverse bit masking too. I have been meaning to write some simple rules to help with this but have been quite busy.
IP Subnet Mask, Bits and Wildcard for CIDR (Classless Inter Domain Routing) Addressing
A handy table to translate the subnet mask to the number of bits and the wildcard for OSPF and ACL's and Firewalls.
| Subnet Mask | Bits | Wildcard Mask |
| 255.0.0.0 | 8 | 0.255.255.255 |
| 255.128.0.0 | 9 | 0.127.255.255 |
| 255.192.0.0 | 10 | 0.63.255.255 |
| 255.224.0.0 | 11 | 0.31.255.255 |
| 255.240.0.0 | 12 | 0.15.255.255 |
| 255.248.0.0 | 13 | 0.7.255.255 |
| 255.252.0.0 | 14 | 0.3.255.255 |
| 255.254.0.0 | 15 | 0.1.255.255 |
| 255.255.0.0 | 16 | 0.0.255.255 |
| 255.255.128.0 | 17 | 0.0.127.255 |
| 255.255.192.0 | 18 | 0.0.63.255 |
| 255.255.224.0 | 19 | 0.0.31.255 |
| 255.255.240.0 | 20 | 0.0.15.255 |
| 255.255.248.0 | 21 | 0.0.7.255 |
| 255.255.252.0 | 22 | 0.0.3.255 |
| 255.255.254.0 | 23 | 0.0.1.255 |
| 255.255.255.0 | 24 | 0.0.0.255 |
| 255.255.255.128 | 25 | 0.0.0.127 |
| 255.255.255.192 | 26 | 0.0.0.63 |
| 255.255.255.224 | 27 | 0.0.0.31 |
| 255.255.255.240 | 28 | 0.0.0.15 |
| 255.255.255.248 | 29 | 0.0.0.7 |
| 255.255.255.252 | 30 | 0.0.0.3 |
| 255.255.255.254 | 31 | 0.0.0.1 |
| 255.255.255.255 | 32 | 0.0.0.0 |
IP Subnetting Breakpoints
This table pretty much makes IP subnetting easy, once you get your head around it.
IP Addressing History
The following tables are not really relevant any more, if anyone says to you, thats a Class C address, the correct response is, not that is a 24 bit address. If they want to argue about it, tell them to send me an email. However it is always important to consider our history and this was how it started, these large chunks of address space.
Network Address Ranges by Class
IP network addresses are issued as follows:
| Class | Range | Default Mask |
| Class A | 1-127 | 255.0.0.0 |
| Class B | 128-191 | 255.255.0.0 |
| Class C | 192-223 | 255.255.255.0 |
Maximum Number of Hosts by Class
| Class | No. of Addresses | |
| Class A | 2^24 | 16,777,216 |
| Class B | 2^16 | 65,536 |
| Class C | 2^8 | 256 |
Subnet Masks - Binary Representations
Useful if you need to do some IP Subnetting using binary (not sure why you would). For each byte in a subnet mask the following applies.
| Decimal | Binary | |
| .192 | 11000000 | 2 bits |
| .224 | 11100000 | 3 bits |
| .240 | 11110000 | 4 bits |
| .248 | 11111000 | 5 bits |
| .252 | 11111100 | 6 bits |
| .254 | 11111110 | 7 bits |
| .255 | 11111111 | 8 bits |
