Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Basic IPv6 Addresses and Subnetting
- Key:
- Nibble = 4 bits
- Byte = 8 bits
- WORD = 16 bits
- DWORD = 32 bits
- QWORD = 64 bits
- H(ex) = 1 Nibble
- :HHHH: = 1 WORD
- 0000: 0000: 0000: 0000: 0000: 0000: 0000: 0000
- |||/12 |||/28 |||/44 |||/60 |||/76 |||/92 |||/108 |||/124
- ||/8 ||/24 ||/40 ||/56 ||/72 ||/88 ||/104 ||/120
- |/4 |/20 |/36 |/52 |/68 |/84 |/100 |/116
- /0? /16 /32 /48 /64 /80 /96 /112
- ---------------------------------------------------------------
- ---------------------------------------------------------------
- Number of Addresses in each subnet [2^(128-CIDR)]:
- /0? = 340,282,366,920,938,463,463,374,607,431,768,211,456
- /4 = 21,267,647,932,558,653,966,460,912,964,485,513,216
- /8 = 1,329,227,995,784,915,872,903,807,060,280,344,576
- /12 = 83,076,749,736,557,242,056,487,941,267,521,536
- /16 = 5,192,296,858,534,827,628,530,496,329,220,096
- /20 = 324,518,553,658,426,726,783,156,020,576,256
- /24 = 20,282,409,603,651,670,423,947,251,286,016
- /28 = 1,267,650,600,228,229,401,496,703,205,376
- /32 = 79,228,162,514,264,337,593,543,950,336
- /36 = 4,951,760,157,141,521,099,596,496,896
- /40 = 309,485,009,821,345,068,724,781,056
- /44 = 19,342,813,113,834,066,795,298,816
- /48 = 1,208,925,819,614,629,174,706,176
- /52 = 75,557,863,725,914,323,419,136
- /56 = 4,722,366,482,869,645,213,696
- /60 = 295,147,905,179,352,825,856
- /64 = 18,446,744,073,709,551,616
- /68 = 115,2921,504,606,846,976
- /72 = 72,057,594,037,927,936
- /76 = 4,503,599,627,370,496
- /80 = 281,474,976,710,656
- /84 = 17,592,186,044,416
- /88 = 1,099,511,627,776
- /92 = 68,719,476,736
- /96 = 4,294,967,296 <- # of IPv4's
- /100 = 268,435,456
- /104 = 16,777,216
- /108 = 1,048,576
- /112 = 65,536
- /116 = 4,096
- /120 = 256
- /124 = 16
- /128 = 1
- IPv6 Formatting (not required):
- Leading 0's = :0025: --> :25:
- Trailing 0's = :2500: --> :2500:
- WORD All 0's = :0000: --> ::
- DWORD All 0's = :0000:0000: --> ::
- Any Group 0's = :0000: x N --> ::
- Only ONE group of 0's can be represented at a time.
- New IPv6:
- 2001:c0de:0000:0000:beef:0000:0000:0001
- Same IPs:
- Right) 2001:c0de::beef:0000:0000:1
- Right) 2001:c0de:0000:0000:beef::1
- Wrong) 2001:c0de::beef::1
- Arbitrary number of 0's could be 1:3, 2:2, or 3:1...
- ---------------------------------------------------------------
- ---------------------------------------------------------------
- Example:
- You are given an IP address of:
- 2001:c0de:def:c0::/60
- ##################### Problem 1 #####################
- You want to split this into 6 different sites. Let's subnet this.
- Step 1: Lengthen the IPv6
- 2001:c0de:0def:00c0:0000:0000:0000:0000
- Alright, the "0" in "00c0" is where we are subnetting.
- Range:
- 2001:c0de:0def:00c0:0000:0000:0000:0000
- to
- 2001:c0de:0def:00cF:FFFF:FFFF:FFFF:FFFF
- Step 2: Some Maths
- We want to break it into 6 sites. 2 ^ N >= 6
- 2 ^ 1 = 1 nope
- 2 ^ 2 = 4 nope
- 2 ^ 3 = 8 YES
- So we will have 8 subnets. Our prefix is /60+3 = /63
- Hex divided into 8 groups: 0, 2, 4, 6, 8, a, c, e
- Step 3: Make it an address
- 2001:c0de:0def:00c0:/63
- 2001:c0de:0def:00c2:/63
- 2001:c0de:0def:00c4:/63
- 2001:c0de:0def:00c6:/63
- 2001:c0de:0def:00c8:/63
- 2001:c0de:0def:00ca:/63
- 2001:c0de:0def:00cc:/63
- 2001:c0de:0def:00ce:/63
- ##################### Problem 2 #####################
- You have to break it into 5 sites. However, each sites have 5 subsites.
- Step 1: SAME AS BEFORE
- Step 2:
- Break it into 25 seperate subnets. 2 ^ N >= 25
- 2 ^ 1 = 1 nope
- 2 ^ 2 = 4 nope
- 2 ^ 3 = 8 nope
- 2 ^ 4 = 16 nope
- 2 ^ 5 = 32 YES
- 32 subnets. Our prefix is /60 + 5 = /65
- Hex divided into 32 groups. We have to use 2 Hex digits, not 1.
- 00, 10, 20, 30, 40, 50, 60, 70, 80, 90, a0, b0, c0, d0, e0, f0
- 08, 18, 28, 38, 48, 58, 68, 78, 88, 98, a8, b8, c8, d8, e8, f8
- You can do that with a calculator in HEX mode, or if you're like me you can
- try and do it in your head.
- 256 bits (2 hex digits) / 32 groups = 8 bits per group. Incremement: (+= 0x8)
- Step 3: Make it an address (the second hex digit leaks into the next WORD)
- 2001:c0de:0def:00c0:0000::/65
- 2001:c0de:0def:00c0:8000::/65
- 2001:c0de:0def:00c1:0000::/65
- 2001:c0de:0def:00c1:8000::/65
- 2001:c0de:0def:00c2:0000::/65
- 2001:c0de:0def:00c2:8000::/65
- 2001:c0de:0def:00c3:0000::/65
- 2001:c0de:0def:00c3:8000::/65
- 2001:c0de:0def:00c4:0000::/65
- 2001:c0de:0def:00c4:8000::/65
- 2001:c0de:0def:00c5:0000::/65
- 2001:c0de:0def:00c5:8000::/65
- 2001:c0de:0def:00c6:0000::/65
- 2001:c0de:0def:00c6:8000::/65
- 2001:c0de:0def:00c7:0000::/65
- 2001:c0de:0def:00c7:8000::/65
- 2001:c0de:0def:00c8:0000::/65
- 2001:c0de:0def:00c8:8000::/65
- 2001:c0de:0def:00c9:0000::/65
- 2001:c0de:0def:00c9:8000::/65
- 2001:c0de:0def:00ca:0000::/65
- 2001:c0de:0def:00ca:8000::/65
- 2001:c0de:0def:00cb:0000::/65
- 2001:c0de:0def:00cb:8000::/65
- 2001:c0de:0def:00cc:0000::/65
- 2001:c0de:0def:00cc:8000::/65
- 2001:c0de:0def:00cd:0000::/65
- 2001:c0de:0def:00cd:8000::/65
- 2001:c0de:0def:00ce:0000::/65
- 2001:c0de:0def:00ce:8000::/65
- 2001:c0de:0def:00cf:0000::/65
- 2001:c0de:0def:00cf:8000::/65
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement