How can I figure out what IPv6 to use if I want to set a static IP for my computer?
I recently installed Windows Server 2012 on my desktop. I changed my connection settings to hardcode my internal IP address as 192.168.0.99 (IPv4). Windows Server 2012 warned me that I should also set my IPv6 address to a static address, but I'm not sure what the equivalent address is in IPv6 format. I've attempted to google this, however after visiting a few websites that "convert IPv4 to IPv6" they each give me different values. I'm not sure which one is the correct one.
How does one go about translating an IPv4 address to and IPv6 address appropriately? Specifically, I'd like to know what 192.168.0.99 is in IPv6 format. Thanks!
Solution 1:
IPv6 has an equivalent of IPv4 "private range" addresses – called Unique Local Address (RFC 4193) – it uses the fd00::/8
range. Pick a random /48 or /64 prefix within that range (see Wikipedia article for examples) and use it for your network.
A direct translation of your internal IPv4 addresses wouldn't make much sense, however. (If you did that, you'd also have the same limits as with IPv4, don't you think?)
However, with IPv6 it is not necessary to use local addresses. There are several ways you can get a global address range for yourself, even if your ISP doesn't offer native IPv6 yet:
-
You can sign up at Tunnelbroker or similar services; most of them will give you a globally-reachable
/64
block – that's one subnet – and many will even provide/48
or/56
blocks upon request (64k and 256 subnets respectively). The same tunnel also lets you access the global IPv6 internet. -
Or you can use the 6to4 address range based on your global IP address. For example, if your ISP assigns you
192.0.123.234
(C0 00 7B EA in hexadecimal), then you're allowed to use2002:c000:7bea::/48
. Such addresses are reachable from the Internet as well.
Solution 2:
To expand grawity's answer (the equivalent to private ranges are Unique Local Addresses, RFC 4913), here is how to pick the actual address to use.
With IPv4 private ranges like 192.168.X., you randomly pick the value for X, but only get a few values to choose from (you picked 192.168.0.), and then pick a random number for the machine (you picked 99). You can have multiple networks, e.g. 192.168.1., but can't really combine two existing sets of networks together as they will likely clash. Using the private range 10.X.Y. gives you more options, but is still limited.
With IPv6, start with 'fd', followed by ten hex digits for your unique allocation (x), and four hex digits for your network (y). Each machine then have a number up to 16 hex digits (z).
This will give you a value like 'fdxx:xxxx:xxxx:yyyy:zzzz:zzzz:zzzz:zzzz', although if you put a lot of zeros in it will be a lot shorter to write out.
e.g. Pick '12:3456:789a' as your first random ten (x), and then use network '0001' inside that (y), then for your machine pick '0000:0000:0000:0063' (because hex 63 is the same as decimal 99).
This would give your machine the IPv6 address 'fd12:3456:789a:0001:0000:0000:0000:0063'. (For your specific network use different, random, values for the 12:3456:789a part.)
As you can collapse zeros in shorthand notation, this becomes just 'fd12:3456:789a:1::63'.
Your entire allocation would be 'fd12:3456:789a::/48', and subnet you are using would be 'fd12:3456:789a:1::/64'.
Note that the above examples happen to have the same number (99 decimal, 0x0063 hex) for the machine in both the IPv4 and IPv6 ranges, but they don't have to match (it just might be easier).