How do I assign IPv6 addresses manually?
Emily Wong
So I'm still rather clueless with IPv6, but I wanted to try something with my network today. Currently, I assign IPv4 LAN addresses manually, so that my router is 192.168.0.1, then my first computer is 192.168.0.2, and so on.
So far, I haven't been able to figure out how to do this with IPv6. Or is the process completely different that this is not how it would work?
Router is an Archer C4000, and my main system runs Ubuntu 19.04
EDIT: To clarify with how I manually set network IP addresses, my router has a page where I can set an address of my choosing to a MAC address. No configuration is done outside of the router.
32 Answers
To clarify with how I manually set network IP addresses, my router has a page where I can set an address of my choosing to a MAC address. No configuration is done outside of the router
This usually isn't called "manual configuration" to avoid confusion (from the LAN hosts' point of view, it is still automatic configuration). The usual terms are "static DHCP lease" or "DHCP reservation".
Overall, the process in IPv6 is usually completely different.
In IPv6 primary address auto-configuration mechanism (SLAAC) is completely stateless: the router does not issue individual addresses; it only periodically advertises the subnet address prefix and each host just combines it with its own chosen suffix. The router cannot limit hosts to just a specific sub-range; in fact the router does not receive any feedback about hosts' chosen address at all.
(Depending on each device's OS, the suffix might be a MAC address in traditional RFC4862 SLAAC; it might be a static hash value in RFC7217; it might be completely random in RFC4941 "Privacy Extensions"; and it might even be a user-provided value if the OS allows that.)
For example, the router advertises 2001:db8:123:456::/64 as the LAN address prefix; client A combines it with its own MAC address and begins using 2001:db8:123:456:6af2:68fe:ff7c:e25c.
That said, DHCP does exist in the IPv6 world and handles address leases in much the same way as IPv4 DHCP does. That means you can create DHCPv6 address pools, you can configure static address leases in DHCPv6, and so on. But not all clients support DHCPv6 at all (e.g. Android does not), so having SLAAC alongside is almost unavoidable.
So if you have a DHCPv6-capable client on a DHCPv6-capable network, chances are it'll have both a nice DHCPv6-assigned address and a longer SLAAC-autoconfigured address.
If I'm setting the IP address manually on each device, is there any further configuration that needs to be done (apart from avoiding duplicates), or will the router just accept that device A is going to use its own configured address?
As you can see above, that's how IPv6 address configuration works anyway.
Your router's manual is found inUser Guideand contains for IPv6 only an option for entering a static IPv6 address for the router itself (as received from the ISP).
The section about specifying the IP addresses that the router assigns by MAC address does not say whether they are IPv4 or IPv6, but I think it is highly unlikely that this will work for IPv6. And here is why.
IPv6 is quite unlike IPv4 in the sense that the long IPv6 address is made up of two parts. The first (the prefix) is assigned by the ISP. The second is assigned locally by the router or by each computer and is usually a random value based on the MAC address.
This means that the router does not control the IPv6 prefix which the ISP can change whenever it likes. You can force your computer to use a static IPv6 address, but only if it agrees with the ISP. You may be able to ask the ISP for a static IPv6 address, but that is a bad idea.
The reason it's a bad idea, is that all your devices are visible to the entire Internet by their IPv6 address (unless the router intervenes). Therefore having a fixed IPv6 address just makes tracking you that much easier.
If you wish, you would in Windows set a computer's static IPv6 insideStart > Network > Network and Sharing Center > Change Adapter Setting, right-click on the Ethernet connection IPv6 and choose Properties, right-click "Internet Protocol Version 6 (TCP/IPv6)" and click on Properties, the set "Use the following IPv6 address".
But the fact you can does not mean you should. The only place that static IPv6 addresses makes sense is inside a local network which is not connected to the Internet.
2