Advertisement
GoodiesHQ

IPv6 Subnetting

Jan 26th, 2014
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.89 KB | None | 0 0
  1. Basic IPv6 Addresses and Subnetting
  2.  
  3. Key:
  4. Nibble = 4 bits
  5. Byte = 8 bits
  6. WORD = 16 bits
  7. DWORD = 32 bits
  8. QWORD = 64 bits
  9. H(ex) = 1 Nibble
  10. :HHHH: = 1 WORD
  11.  
  12. 0000: 0000: 0000: 0000: 0000: 0000: 0000: 0000
  13. |||/12 |||/28 |||/44 |||/60 |||/76 |||/92 |||/108 |||/124
  14. ||/8 ||/24 ||/40 ||/56 ||/72 ||/88 ||/104 ||/120
  15. |/4 |/20 |/36 |/52 |/68 |/84 |/100 |/116
  16. /0? /16 /32 /48 /64 /80 /96 /112
  17. ---------------------------------------------------------------
  18. ---------------------------------------------------------------
  19. Number of Addresses in each subnet [2^(128-CIDR)]:
  20. /0? = 340,282,366,920,938,463,463,374,607,431,768,211,456
  21. /4 = 21,267,647,932,558,653,966,460,912,964,485,513,216
  22. /8 = 1,329,227,995,784,915,872,903,807,060,280,344,576
  23. /12 = 83,076,749,736,557,242,056,487,941,267,521,536
  24. /16 = 5,192,296,858,534,827,628,530,496,329,220,096
  25. /20 = 324,518,553,658,426,726,783,156,020,576,256
  26. /24 = 20,282,409,603,651,670,423,947,251,286,016
  27. /28 = 1,267,650,600,228,229,401,496,703,205,376
  28. /32 = 79,228,162,514,264,337,593,543,950,336
  29. /36 = 4,951,760,157,141,521,099,596,496,896
  30. /40 = 309,485,009,821,345,068,724,781,056
  31. /44 = 19,342,813,113,834,066,795,298,816
  32. /48 = 1,208,925,819,614,629,174,706,176
  33. /52 = 75,557,863,725,914,323,419,136
  34. /56 = 4,722,366,482,869,645,213,696
  35. /60 = 295,147,905,179,352,825,856
  36. /64 = 18,446,744,073,709,551,616
  37. /68 = 115,2921,504,606,846,976
  38. /72 = 72,057,594,037,927,936
  39. /76 = 4,503,599,627,370,496
  40. /80 = 281,474,976,710,656
  41. /84 = 17,592,186,044,416
  42. /88 = 1,099,511,627,776
  43. /92 = 68,719,476,736
  44. /96 = 4,294,967,296 <- # of IPv4's
  45. /100 = 268,435,456
  46. /104 = 16,777,216
  47. /108 = 1,048,576
  48. /112 = 65,536
  49. /116 = 4,096
  50. /120 = 256
  51. /124 = 16
  52. /128 = 1
  53.  
  54.  
  55. IPv6 Formatting (not required):
  56. Leading 0's = :0025: --> :25:
  57. Trailing 0's = :2500: --> :2500:
  58. WORD All 0's = :0000: --> ::
  59. DWORD All 0's = :0000:0000: --> ::
  60. Any Group 0's = :0000: x N --> ::
  61.  
  62.  
  63. Only ONE group of 0's can be represented at a time.
  64. New IPv6:
  65. 2001:c0de:0000:0000:beef:0000:0000:0001
  66.  
  67. Same IPs:
  68. Right) 2001:c0de::beef:0000:0000:1
  69. Right) 2001:c0de:0000:0000:beef::1
  70.  
  71. Wrong) 2001:c0de::beef::1
  72. Arbitrary number of 0's could be 1:3, 2:2, or 3:1...
  73. ---------------------------------------------------------------
  74. ---------------------------------------------------------------
  75. Example:
  76. You are given an IP address of:
  77. 2001:c0de:def:c0::/60
  78.  
  79. ##################### Problem 1 #####################
  80.  
  81. You want to split this into 6 different sites. Let's subnet this.
  82.  
  83. Step 1: Lengthen the IPv6
  84. 2001:c0de:0def:00c0:0000:0000:0000:0000
  85.  
  86. Alright, the "0" in "00c0" is where we are subnetting.
  87.  
  88. Range:
  89. 2001:c0de:0def:00c0:0000:0000:0000:0000
  90. to
  91. 2001:c0de:0def:00cF:FFFF:FFFF:FFFF:FFFF
  92.  
  93.  
  94. Step 2: Some Maths
  95. We want to break it into 6 sites. 2 ^ N >= 6
  96. 2 ^ 1 = 1 nope
  97. 2 ^ 2 = 4 nope
  98. 2 ^ 3 = 8 YES
  99.  
  100. So we will have 8 subnets. Our prefix is /60+3 = /63
  101. Hex divided into 8 groups: 0, 2, 4, 6, 8, a, c, e
  102.  
  103. Step 3: Make it an address
  104. 2001:c0de:0def:00c0:/63
  105. 2001:c0de:0def:00c2:/63
  106. 2001:c0de:0def:00c4:/63
  107. 2001:c0de:0def:00c6:/63
  108. 2001:c0de:0def:00c8:/63
  109. 2001:c0de:0def:00ca:/63
  110. 2001:c0de:0def:00cc:/63
  111. 2001:c0de:0def:00ce:/63
  112.  
  113. ##################### Problem 2 #####################
  114.  
  115. You have to break it into 5 sites. However, each sites have 5 subsites.
  116.  
  117. Step 1: SAME AS BEFORE
  118.  
  119. Step 2:
  120. Break it into 25 seperate subnets. 2 ^ N >= 25
  121.  
  122. 2 ^ 1 = 1 nope
  123. 2 ^ 2 = 4 nope
  124. 2 ^ 3 = 8 nope
  125. 2 ^ 4 = 16 nope
  126. 2 ^ 5 = 32 YES
  127.  
  128. 32 subnets. Our prefix is /60 + 5 = /65
  129. Hex divided into 32 groups. We have to use 2 Hex digits, not 1.
  130. 00, 10, 20, 30, 40, 50, 60, 70, 80, 90, a0, b0, c0, d0, e0, f0
  131. 08, 18, 28, 38, 48, 58, 68, 78, 88, 98, a8, b8, c8, d8, e8, f8
  132.  
  133. You can do that with a calculator in HEX mode, or if you're like me you can
  134. try and do it in your head.
  135. 256 bits (2 hex digits) / 32 groups = 8 bits per group. Incremement: (+= 0x8)
  136.  
  137. Step 3: Make it an address (the second hex digit leaks into the next WORD)
  138. 2001:c0de:0def:00c0:0000::/65
  139. 2001:c0de:0def:00c0:8000::/65
  140. 2001:c0de:0def:00c1:0000::/65
  141. 2001:c0de:0def:00c1:8000::/65
  142. 2001:c0de:0def:00c2:0000::/65
  143. 2001:c0de:0def:00c2:8000::/65
  144. 2001:c0de:0def:00c3:0000::/65
  145. 2001:c0de:0def:00c3:8000::/65
  146. 2001:c0de:0def:00c4:0000::/65
  147. 2001:c0de:0def:00c4:8000::/65
  148. 2001:c0de:0def:00c5:0000::/65
  149. 2001:c0de:0def:00c5:8000::/65
  150. 2001:c0de:0def:00c6:0000::/65
  151. 2001:c0de:0def:00c6:8000::/65
  152. 2001:c0de:0def:00c7:0000::/65
  153. 2001:c0de:0def:00c7:8000::/65
  154. 2001:c0de:0def:00c8:0000::/65
  155. 2001:c0de:0def:00c8:8000::/65
  156. 2001:c0de:0def:00c9:0000::/65
  157. 2001:c0de:0def:00c9:8000::/65
  158. 2001:c0de:0def:00ca:0000::/65
  159. 2001:c0de:0def:00ca:8000::/65
  160. 2001:c0de:0def:00cb:0000::/65
  161. 2001:c0de:0def:00cb:8000::/65
  162. 2001:c0de:0def:00cc:0000::/65
  163. 2001:c0de:0def:00cc:8000::/65
  164. 2001:c0de:0def:00cd:0000::/65
  165. 2001:c0de:0def:00cd:8000::/65
  166. 2001:c0de:0def:00ce:0000::/65
  167. 2001:c0de:0def:00ce:8000::/65
  168. 2001:c0de:0def:00cf:0000::/65
  169. 2001:c0de:0def:00cf:8000::/65
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement