ipv6 subnetmask calculation

The relevant prefixes from BB2 are:

2001:205:
2001:200:
2001:222:

The first hexadezimal fields are the same. So you can at least use a mask of /16.
But let’s look for a more specific one and for bits to add.

The secound field also exists of 16 bits. So the full numbers would be:

1234 Fields
—-
0205
0200
0222

In binary format for this is:

0205 = 0000 0010 0000 0101
0200 = 0000 0010 0000 0000
0222 = 0000 0010 0010 0010

If you AND these numbers:

0000 0010 0000 0101
0000 0010 0000 0000
0000 0010 0010 0010
——————-
0000 0010 0000 0000

Thats: 2001:0200: then.

So get the right CIDR notation look what bits are needed for the subnet:

XOR
0000 0010 0000 0101
0000 0010 0000 0000
0000 0010 0010 0010
——————-
0000 0000 0010 0111

xxxx xxxx xx so the first 10 bits are all usable for the netmask.
16+10=26

So the mask is 2001:200::/26

Source:

http://www.internetworkexpert.com/resources/01700370.htm

Leave a Reply