After calculating your /48 prefix, you have 16 bits left for creating subnets.
Here is the breakdown of the 128-bit IPv6 address structure for 6to4:
- 6to4 Prefix (16 bits):
2002 - Public IPv4 (32 bits): Converted to hex (e.g.,
c000:0201)- Total so far: 48 bits.
- Subnet ID (16 bits): This is the space you own to create internal networks.
- Total so far: 64 bits.
- Interface ID (64 bits): The "Host" part of the address (e.g.,
::1).
Why 16 bits?
In IPv6, the standard size for a single network segment (like a LAN or a VLAN) is a /64. Since the 6to4 transition mechanism gives you a /48:
64 \text{ (Standard Subnet)} - 48 \text{ (Your 6to4 Prefix)} = \mathbf{16 \text{ bits}}
What does this mean in practice?
With 16 bits for subnets, you can create 65,536 individual subnets (2^{16}), and each of those subnets can hold billion of billions of devices!
In the command you just ran:
sudo ip -6 addr add 2002:c000:0201::1/64 dev tun6to4
- The
2002:c000:0201is your/48prefix. - The
0000(which is hidden between the colons0201::1) is the first of your 65,536 available subnets.
You are now ready to bring the interface up if you haven't already