IPv6 Subnetting

I was making an IPv6 exercise in which I had to configure two Router Interface: `G0/0` and `G0/1`

`G0/0` uses `2001:DB8:FADE:00FF::/64` and I have to use to next subnet for `G0/1`

This is the answer, but What I don't get to understand is, how to move the bits:

``````G0/0 2001:DB8:FADE:00FF::1/64

00FF - 0000 0000 1111 1111
0100 - 0000 0001 0000 0000
``````

Let's say:

``````000F - 0000 0000 0000 1111
``````

What is going on after? The last bits back to zero, while I increment +1 on third part? Like `0000 0000 0001 0000 = 0010 (Hex)`.

Update:

I would like to know how develop this binaries until the Hex value gets `FFFF`

Example:

``````00FF - 0000 0000 1111 1111
0000 0001 0000 0000
0000 0001 0000 0001
0000 0001 0000 0010
``````

Trying to simplify, the fourth part reaches `1111` while previous parts keep the values, after

``````  0000 0001 0001 1111
0000 0001 0010 1111
``````

Now, the third part starts to build until `1111`, the next is second part and etc..

Am I correct? I'm not getting to develop that values :\

• You are going to need a long document to count up to `ffff` since that is `65,535` in decimal. If you have a spreadsheet, like Excel, you can do this. Excel won't do binary numbers with that many digits (maybe 10 digits), but it does have formulae for converting between the different number bases (`BIN2DEC`, `BIN2HEX`, `DEC2BIN`, `DEC2HEX`, etc.). You could easily create a list of `0` to `65,535` in once column, and the binary (up to 10 digits) in another column, and the hexadecimal in another column, to see how it works. Mar 6, 2016 at 18:09
• You seem to be on the right track with the binary counting. When using number bases, `10` is the number base. Binary `10` is `2`, octal `10` is `8`, hexadecimal `10` is `16`, and so on. Number bases larger than `10` don't have enough numeric digits, so we use letters. Number bases smaller than `10` have more digits so you don't use them all. Base 2 (binary) is really the smallest number base you can represent; you just increment the next-higher digit as you increment by `1` when the lower digit reaches `1`, the same way you do it in decimal when the lower digit reaches `9`. Mar 6, 2016 at 18:25

IPv6 is easy when it comes to this since you aren't really doing subnetting the way IPv4 does. Under normal circumstances, with very few exceptions, you have one subnet size (`/64`). All you need to do is be able to count in hexadecimal.

An IPv6 address is just a single 128-bit number. There are two parts: the Network ID, and the Interface ID. Each is 64-bits. You only need to concentrate in the Network ID for what you want to do. The text representation of IPv6 is broken into words separated by colons for ease of reading. Some would call this oxymoronic when it comes to big, ugly IPv6 addresses, but try to read one without the colons.

In Decimal, you count `0` to `9`. When you get to `9`, the next step is to increment the next higher digit and start over at `0` (`9` goes to `10`). The same applies to Hexadecimal, except that you count `0` to `f` (`f` goes to `10`). If you want to throw Binary into the mix, each four Binary digits equal one Hexadecimal digit. Hexadecimal <-> Binary is much, much easier than throwing Decimal into the mix the way IPv4 does.

I think you are confusing yourself by thinking about blocks. In your example:

``````000F = 0000 0000 0000 1111
``````

you ask what comes next. What happens when you look at it like this:

``````000F = 0000000000001111
``````

Binary counts the same way as Decimal or Hexadecimal:

``````Binary  Decimal Hexadecimal
0       0        0
1       1        1
10       2        2
11       3        3
100       4        4
101       5        5
110       6        6
111       7        7
1000       8        8
1001       9        9
1010      10        a
1011      11        b
1100      12        c
1101      13        d
1110      14        e
1111      15        f
10000      16       10
10001      17       11
10010      18       12
10011      19       13
``````

and so on...

It's really all simple counting. You should just get comfortable with doing it in Hexadecimal. One big reason you do IPv4 in Binary is that you need to do bitwise operations to figure out where the boundaries are, but with IPv6, you are really just given a single 64-bit boundary. There is far less bit manipulation.

• @TMoraes, people get freaked out about the size of IPv6 addresses, but it is really easier than IPv4 subnetting. Mar 6, 2016 at 1:37
• I agree, but the interesting I've never seen or worried me about values after `F`, I had in mind was "If I see any letter after "F", example: "G,H.." I should consider that address is invalid". My doubt was about "zero's reset". Mar 6, 2016 at 14:11
• in practice IPv6 uses a 64-bit boundary. How about in relation to certification questions? (bit off topic...but...) Feb 26, 2018 at 18:38
• Subnetting works exactly the same way for IPv4 and IPv6, except that IPv4 has 32 bits and IPv6 has 128 bits. Subtract the number of bits needed for the number of hosts from the address size (128 for IPv6), and you have the number of bits for the network. Feb 26, 2018 at 18:41