IP addressing issue

I am not bad with networks, however, I am doing badly in IP addressing. It is affecting me very much. For example, while working on access lists on a Cisco router, I had to assign a serial port the IP address 24.17.2.2 and a subnet 255.255.255.240. I thought the corresponding subnet would be 255.0.0.0, because 24.17.2.2 is a Class A IP address.

How may I improve my IP addressing skills?


Solution 1:

When you are using a custom subnet you are using classless ip addressing. This allows a large block of IP addresses, like those in a class a network to be sliced up into smaller networks. You do this for a variety of reasons. Do a Google search for Subnetting Tutorial and you will find a ton of resources. Cisco's site has some very good games on how to perform subnetting as well.

Solution 2:

255.255.255.240 is an example of a variable length subnet mask, which is used with CIDR, or classless inter-domain routing. CIDR is a way to split Class-A/B/C networks into smaller subnetworks where you don't need say, a full 254 addresses (or 16 million, in the case of a Class-A).

In this case, 255.255.255.240 is a mask for a network of 14 hosts. A tool like whatmask is very helpful here:

$ whatmask 24.17.2.2/28

------------------------------------------------
           TCP/IP NETWORK INFORMATION
------------------------------------------------
IP Entered = ..................: 24.17.2.2
CIDR = ........................: /28
Netmask = .....................: 255.255.255.240
Netmask (hex) = ...............: 0xfffffff0
Wildcard Bits = ...............: 0.0.0.15
------------------------------------------------
Network Address = .............: 24.17.2.0
Broadcast Address = ...........: 24.17.2.15
Usable IP Addresses = .........: 14
First Usable IP Address = .....: 24.17.2.1
Last Usable IP Address = ......: 24.17.2.14

CIDR is useful in cases where you don't need a full Class-C network (254 addresses) (or something even larger). If you only have a network of a dozen or so hosts it's a more efficient use of IP address space.

Hope that helps.