I understand that IP colisions are incredibly rare under IPv6. Most subnets are at least 64bit, meaning that the risk of true random collision is neglegable.
However there are circumstances where sources of real entropy are so limited (or broken) that the risk can rise significantly.
I read somewhere that on assigning an IP address, the host is supposed to use the neighbour discovery protocol to check whether the address exists and if so refuse to use it.
So my question is what does Linux do in this situation? If I have some software that wants to add an IP to the host, how could that software discover that the IP is taken? E.g. using the ip CLI?
There are two angles of this question that are not instinctually obvious to me and lead me to shy away from "works on my machine" approaches to discover an answer:
- Syntax stability and parsing the output.
- Timing and knowing how long to wait.