How to find IP addresses and subnet number in a few seconds

How to find IP addresses and subnet number in a few seconds

When you know IP address and mask number, you sometimes want to know subnet number, subnet broadcast address and range of valid IP addresses. In common ways, you can find these by convert the IP address with mask number to binary and perform boolean AND but that takes too much time. So let see how to find these answers in a short time.Before I start, let see the general table which will used to describe IP address. In each column will be the IP address that separate by octet, dot-notation (x.x.x.x). In each row is the IP address.

Generic Subnet Table

Octet 1 2 3 4
Address
Subnet number
First Address
Broadcast Address
Last Address

Let’s start

I divide into 2 categories which depend on subnet mask:

  1. Do Maths with easy masks
    For the masks that contain only 255s and 0s. There are three masks which are 255.0.0.0, 255.255.0.0 and 255.255.255.0.
    I guess many people know this already, but l will explain a little bit to revise for someone.

    1. Find the subnet number
      • Copy first octet (mask 255.0.0.0), first two octets (mask 255.255.0.0) or first three octets (mask 255.255.255.0) from IP address
      • Put 0s in the remaining octets
    2. Find the broadcast the address
      • Copy first octet (mask 255.0.0.0), first two octets (mask 255.255.0.0) or first three octets (mask 255.255.255.0) from IP address. This is the same in ‘Find the subnet number’, step 1
      • Put 255s in the remaining octets
    3. Find range of valid IP addresses
      • To find the first valid IP address, copy the subnet number and add 1 to the fourth octet
      • To find the last valid IP address, copy the broadcast address and subtract 1 to the fourth octet
    4. Example
      • Mask 255.0.0.0
        Octet 1 2 3 4
        Address 10 110 140 1
        Subnet number 10 0 0 0
        First Address 10 0 0 1
        Broadcast Address 10 255 255 255
        Last Address 10 255 255 254
      • Mask 255.255.0.0
        Octet 1 2 3 4
        Address 10 110 140 1
        Subnet number 10 110 0 0
        First Address 10 110 0 1
        Broadcast Address 10 110 255 255
        Last Address 10 110 255 254
      • Mask 255.255.255.0
        Octet 1 2 3 4
        Address 10 110 140 1
        Subnet number 10 110 140 0
        First Address 10 110 140 1
        Broadcast Address 10 110 140 255
        Last Address 10 110 140 254
  2. Do Maths with difficult masks
    In this case, most people find it’s difficult to calculate and some has to do by binary math which is time consuming. Let see the way to figure out in few seconds.

    1. Find the subnet number
      • I will define the column that contain the difficult number(not 255s and 0s) as the interesting column. For any octets fully to the left of the interesting column, copy value(s) from the original IP Address into all addresses(subnet number, first-last address and broadcast address).
        Octet 1 2 3 4
        Address 130 4 102 1
        Mask 255 255 252 0
        Subnet number 130 4
        First Address 130 4
        Broadcast Address 130 4
        Last Address 130 4
      • For any octets fully to the right of the interesting column, put 0s in the subnet number.
        Octet 1 2 3 4
        Address 130 4 102 1
        Mask 255 255 252 0
        Subnet number 130 4 0
        First Address 130 4
        Broadcast Address 130 4
        Last Address 130 4
      • Now the tricky part, find a ‘magic number’ which is 256 minus mask’s interesting octet. In this example, it is 256 – 252 = 4.
      • Find the multiple of the magic number that is closest to, but not greater than the the interesting octet of original IP address. For this case, it is 100 (4*25) which also not greater than 102.
      • Put the result from previous step in subnet number of the interesting column.
        Octet 1 2 3 4
        Address 130 4 102 1
        Mask 255 255 252 0
        Subnet number 130 4 100 0
        First Address 130 4
        Broadcast Address 130 4
        Last Address 130 4
    2. Find the broadcast address
      • For any octets fully to the right of the interesting column, put 255s in the broadcast address. The left part should be filled already in Find subnet number, the upper.
      • Again, use the magic number. By adding the magic number to the interesting octet of subnet number and subtract 1. In this example, the magic number is 256 – 252 = 4, 100 + 4 – 1 = 103.
      • Put the result from previous step in broadcast number of the interesting column.
        Octet 1 2 3 4
        Address 130 4 102 1
        Mask 255 255 252 0
        Subnet number 130 4 100 0
        First Address 130 4
        Broadcast Address 130 4 103 255
        Last Address 130 4
    3. Find range of valid IP addresses
      The way used to find the first and last IP addresses are the same in easy mask.

      • To find the first valid IP address, copy the subnet number and add 1 to the fourth octet
      • To find the last valid IP address, copy the broadcast address and subtract 1 to the fourth octet
        Octet 1 2 3 4
        Address 130 4 102 1
        Mask 255 255 252 0
        Subnet number 130 4 100 0
        First Address 130 4 100 1
        Broadcast Address 130 4 103 255
        Last Address 130 4 103 254

Reference: CCNA Self-Study, CCNA ICND, Chapter 4: IP Addressing and Subnetting

145 Comments

  1. Ben February 22, 2007
  2. linglom February 22, 2007
  3. arvind July 30, 2007
  4. makhfud November 5, 2008
  5. xzyan December 24, 2008
  6. linglom December 24, 2008
  7. Matt January 6, 2009
  8. linglom January 7, 2009
  9. Matt January 8, 2009
  10. preet February 14, 2009
  11. linglom February 14, 2009
  12. Amon March 28, 2009
  13. kelvin emmanuel May 19, 2009
  14. Meraj June 5, 2009
  15. Luis August 14, 2009
  16. linglom August 15, 2009
  17. kevin August 19, 2009
  18. linglom August 19, 2009
  19. Ram December 18, 2009
  20. linglom January 6, 2010
  21. Hannah February 1, 2010
  22. Hannah February 1, 2010
  23. linglom February 3, 2010
  24. yogesh kapil February 12, 2010
  25. linglom February 16, 2010
  26. scott February 18, 2010
  27. scott February 19, 2010
  28. linglom February 23, 2010
  29. jeff March 2, 2010
  30. Larry March 9, 2010
  31. linglom March 12, 2010
  32. kulas March 15, 2010
  33. Ahmed March 17, 2010
  34. AA March 20, 2010
  35. scott March 22, 2010
  36. Ravi March 28, 2010
  37. scott March 28, 2010
  38. Ravi March 29, 2010
  39. scott March 29, 2010
  40. Ravi March 30, 2010
  41. Ravi March 30, 2010
  42. scott March 30, 2010
  43. Robin May 9, 2010
  44. Bhupesh May 16, 2010
  45. Kristina June 12, 2010
  46. Qome June 29, 2010
  47. monu August 7, 2010
  48. WebEye August 23, 2010
  49. Scott October 9, 2010
  50. Jerry October 14, 2010
  51. Scott October 14, 2010
  52. Yul October 18, 2010
  53. Rub October 19, 2010
  54. Rub October 19, 2010
  55. Rub October 19, 2010
  56. Jerry October 21, 2010
  57. Scott October 22, 2010
  58. Jerry October 22, 2010
  59. Rub October 22, 2010
  60. Rub October 22, 2010
  61. Scott October 22, 2010
  62. Jerry October 23, 2010
  63. mike October 24, 2010
  64. yul November 13, 2010
  65. Spawn November 22, 2010
  66. eson December 7, 2010
  67. linglom December 18, 2010
  68. Clyde February 16, 2011
  69. Urgen May 29, 2011
  70. Scott May 30, 2011
  71. Urgen May 30, 2011
  72. Urgen May 30, 2011
  73. Urgen May 30, 2011
  74. Scott May 30, 2011
  75. Scott June 3, 2011
  76. Scott June 3, 2011
  77. Tawsif August 17, 2011
  78. Ram August 22, 2011
  79. sudhir August 22, 2011
  80. sudhir August 22, 2011
  81. ram August 23, 2011
  82. ram August 23, 2011
  83. sudhir August 24, 2011
  84. Joyce September 19, 2011
  85. Joyce September 19, 2011
  86. linglom September 19, 2011
  87. Joyce September 19, 2011
  88. CHANDSANDHU September 20, 2011
  89. Ashraf October 1, 2011
  90. Alan October 5, 2011
  91. Jerome October 6, 2011
  92. sandy October 22, 2011
  93. Robert November 6, 2011
  94. linglom November 10, 2011
  95. linglom November 10, 2011
  96. linglom November 10, 2011
  97. Mayank November 25, 2011
  98. kamal December 4, 2011
  99. John December 7, 2011
  100. Jeanine December 15, 2011
  101. giobit January 7, 2012
  102. giobit January 7, 2012
  103. desar January 10, 2012
  104. chets January 30, 2012
  105. gilbert samuel February 29, 2012
  106. Adam March 29, 2012
  107. linglom March 30, 2012
  108. Darkknight April 5, 2012
  109. Khurram Safdar May 17, 2012
  110. Raghav Narang May 25, 2012
  111. Anum Khalid June 2, 2012
  112. Anum Khalid June 2, 2012
  113. Dada June 17, 2012
  114. newbie July 2, 2012
  115. linglom July 5, 2012
  116. eunan July 31, 2012
  117. kevin October 24, 2012
  118. kevin October 24, 2012
  119. pema Tenzin October 31, 2012
  120. Aboud92 November 9, 2012
  121. Jimmy December 18, 2012
  122. JP December 31, 2012
  123. Zette January 14, 2013
  124. Atha March 6, 2013
  125. Jacob March 9, 2013
  126. Kay May 10, 2013
  127. pop August 5, 2013
  128. Walter Mozol May 26, 2014
  129. newbe no cibie June 3, 2014
  130. nagalakshmaiah June 14, 2014
  131. sajjad sabri May 17, 2015
  132. ina June 13, 2015
  133. ann June 24, 2015
  134. linglom June 24, 2015
  135. dinesh September 26, 2015
  136. linglom September 29, 2015
  137. Kuti October 16, 2015
  138. Ambas January 1, 2016
  139. Jobert July 22, 2016
  140. Jay October 4, 2016
  141. Jay October 4, 2016
  142. san December 9, 2016
  143. lubna December 9, 2016
  144. sankalp April 12, 2017

Leave a Reply