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

149 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. Amit May 15, 2010
  45. Bhupesh May 16, 2010
  46. Kristina June 12, 2010
  47. Qome June 29, 2010
  48. monu August 7, 2010
  49. WebEye August 23, 2010
  50. Scott October 9, 2010
  51. Jerry October 14, 2010
  52. Scott October 14, 2010
  53. Yul October 18, 2010
  54. Rub October 19, 2010
  55. Rub October 19, 2010
  56. Rub October 19, 2010
  57. Jerry October 21, 2010
  58. Scott October 22, 2010
  59. Jerry October 22, 2010
  60. Rub October 22, 2010
  61. Rub October 22, 2010
  62. Scott October 22, 2010
  63. Jerry October 23, 2010
  64. mike October 24, 2010
  65. yul November 13, 2010
  66. Spawn November 22, 2010
  67. eson December 7, 2010
  68. linglom December 18, 2010
  69. Clyde February 16, 2011
  70. Urgen May 29, 2011
  71. Scott May 30, 2011
  72. Urgen May 30, 2011
  73. Urgen May 30, 2011
  74. Urgen May 30, 2011
  75. Scott May 30, 2011
  76. Scott June 3, 2011
  77. Scott June 3, 2011
  78. Tawsif August 17, 2011
  79. Ram August 22, 2011
  80. sudhir August 22, 2011
  81. sudhir August 22, 2011
  82. ram August 23, 2011
  83. ram August 23, 2011
  84. sudhir August 24, 2011
  85. Joyce September 19, 2011
  86. Joyce September 19, 2011
  87. linglom September 19, 2011
  88. Joyce September 19, 2011
  89. CHANDSANDHU September 20, 2011
  90. Ashraf October 1, 2011
  91. Alan October 5, 2011
  92. Jerome October 6, 2011
  93. sandy October 22, 2011
  94. Robert November 6, 2011
  95. linglom November 10, 2011
  96. linglom November 10, 2011
  97. linglom November 10, 2011
  98. Mayank November 25, 2011
  99. kamal December 4, 2011
  100. John December 7, 2011
  101. Jeanine December 15, 2011
  102. giobit January 7, 2012
  103. giobit January 7, 2012
  104. desar January 10, 2012
  105. chets January 30, 2012
  106. gilbert samuel February 29, 2012
  107. Adam March 29, 2012
  108. linglom March 30, 2012
  109. Darkknight April 5, 2012
  110. Khurram Safdar May 17, 2012
  111. Raghav Narang May 25, 2012
  112. Anum Khalid June 2, 2012
  113. Anum Khalid June 2, 2012
  114. Dada June 17, 2012
  115. newbie July 2, 2012
  116. linglom July 5, 2012
  117. eunan July 31, 2012
  118. kevin October 24, 2012
  119. kevin October 24, 2012
  120. pema Tenzin October 31, 2012
  121. Aboud92 November 9, 2012
  122. Jimmy December 18, 2012
  123. JP December 31, 2012
  124. Zette January 14, 2013
  125. Atha March 6, 2013
  126. Jacob March 9, 2013
  127. Kay May 10, 2013
  128. pop August 5, 2013
  129. Walter Mozol May 26, 2014
  130. newbe no cibie June 3, 2014
  131. nagalakshmaiah June 14, 2014
  132. sajjad sabri May 17, 2015
  133. ina June 13, 2015
  134. ann June 24, 2015
  135. linglom June 24, 2015
  136. dinesh September 26, 2015
  137. linglom September 29, 2015
  138. Kuti October 16, 2015
  139. Ambas January 1, 2016
  140. Jobert July 22, 2016
  141. Jay October 4, 2016
  142. Jay October 4, 2016
  143. san December 9, 2016
  144. lubna December 9, 2016
  145. sankalp April 12, 2017
  146. 10.0.0.0.1 comcast March 31, 2018
  147. James June 17, 2019
  148. janda dulnuan January 6, 2021
  149. kishni feran May 14, 2021

Leave a Reply