IP Routing Advanced Info

Howto by jmke @ 2003-01-23

This guide will be updated with more info now & then! Want to know what makes the internet work? Here you can find some info at least :)
  • prev
  • next

IP Subnetting

Subnetting explained by use of an example

10.80.80.0/21

count 21 bits binary = 1111 1111 . 1111 1111 . 1111 1000 . 0000 0000
>-----------------------------------------------------^^^^^^^^

Calculate IP ranges: it takes 3 bits more to get a full byte.
Rule of thumb: 2N where N = number of bits to obtain a full byte in the binary representation
In this case 23 = 8, the 1st range of IP addresses for the subnet /21 is:
IP range: 10.80.80.1 -> 10.80.87.254 (not included: 10.80.80.0 network mask & 10.80.87.255 broadcast address)
in this range, 10.80.84.0 and 10.80.83.255 are valid IP addresses, as it is only the first and the last IP address of the subnet that is reserved.
Calculate Subnet mask: calculate in binary what they are worth 1111 1000 = 128 + 64 + 32 + 16 + 8

So the subnet mask for these IP ranges is 255.255.248.0

the next ranges are:
10.80.88.1 -> 10.80.95.254
10.80.96.1 -> 10.80.103.254
10.80.104.1 -> 10.80.121.254
10.80.122.1 -> 10.80.129.254
10.80.130.1 -> 10.80.137.254
10.80.138.1 -> 10.80.145.254
10.80.146.1 -> 10.80.153.254
etc..etc..etc..

Other examples:

200.0.0.0/8

IP address range: 200.0.0.1 - 200.255.255.254
Subnetmask: 255.0.0.0

192.168.0.0/24

some IP ranges:
192.168.0.1 -> 192.168.0.254
192.168.1.1 -> 192.168.1.254
192.168.2.1 -> 192.168.2.254
192.168.3.1 -> 192.168.3.254
192.168.4.1 -> 192.168.4.254
....
Subnet mask: 255.255.255.0

192.168.0.0/16

IP range: 192.168.0.1 -> 192.168.255.254
Subnet mask 255.255.0.0

192.168.0.0/20

IP ranges:

192.168.0.1 -> 192.168.15.254
192.168.16.1 -> 192.168.31.254
192.168.32.1 -> 192.168.47.254
192.168.48.1 -> 192.168.63.254
...
Subnet mask: 255.255.240.0
  • prev
  • next