By convention, each device on the LAN under IPv6 gets a /64 subnet, right? That's an obscene number of addresses per device! Why not make the addresses shorter, say, 72 bits, then each device would get 256 addresses in its subnet, which would save several bytes per packet during transmission (which is a Good Thing). Why the need for such insanely long addresses?
IPv6 – Why Are IPv6 Addresses So Long?
ipip addressipv6subnet
Related Solutions
After experimenting with this, I have made a few discoveries that end up dictating which path to choose.
Multiple subnet advertisements means multiple IPs in the same subnet
If you have multiple routers advertising the same prefix, you don't end up with redundancy, you end up with multiple IP addresses in the same prefix/subnet. This is like assigning yourself both 192.168.0.1 and 192.168.0.2 on the same NIC. It works, but it causes problems.
For example I was running a DNS server on one of these machines, and when clients were querying it through the primary IP, it was responding on the second one. Clients were ignoring this response assuming someone was trying to spoof them, instead waiting for a reply on the same IP they sent the query to, so DNS completely broke.
Static IPs and router advertisements don't mix (for the same prefix)
You might think, as I did, that assigning a static IP in the same subnet would prevent an automatic IP assignment from the same prefix. After all, in IPv4 if you have a static IP address, DHCP doesn't give you another one.
This is wrong. You get the static IP address alright, but you also get a second one in the same subnet/prefix thanks to the advertisement from the router.
The end result is two IPs in the same subnet, leading to the same problem as above.
Advertise a different prefix
In the end the only solution that works is this one. It requires letting go of a few IPv4 ideas though.
My goal was to mimic my IPv4 setup with IPv6. That is, assign a few machines fixed addresses, and have the rest dynamic, while having everything as robust as possible. And hopefully not having to run a DHCP server anymore.
By having a router advertise a ULA prefix, all hosts will self-assign their addresses, just like with DHCP. But you can't have multiple routers advertising that prefix. Maybe in some fancier setup you could have a backup router take over if it notices that the primary one has stopped advertising, but this isn't possible at present.
However, you don't have to be tied to placing fixed and dynamic IPs in the same subnet with IPv6. ULA addresses have the facility to specify a subnet (up to 65536 of them), so I ended up using that so that the /48 ULA prefix had two /64 subnets in it. The router advertises one for stateless config (equivalent to DHCP) while the other is not advertised anywhere and used for static IPs configured on each host. You can even use a third ULA subnet for a backup router in case the primary one stops advertising its ULA, just to be sure that your hosts always have a site-wide routable address, even when no global IPs are available.
Thanks to the magic of IPv6 there is no need to set up any routing rules when this all happens within the same LAN segment. Everyone gets a dynamic address, and the machines with fixed addresses get a static IP as well, but as they are in different /64 subnets, there is little confusion.
The only issue is that those hosts with fixed IPs should always used the fixed IPs to talk to each other. If a connection is made to the dynamic IP from a host who has lost its dynamic IP, it will make the connection out from the remaining static IP instead - which means the multi-homed server will reply back using its own static IP and you'll again have the mismatch.
But as long as hosts with static IPs always use the static subnet to talk to each other then there is never a problem. Multi-homed hosts can of course talk to those in the dynamic subnet without any problem as well.
Best Answer
No. Each network is almost always a
/64
network. Each host still gets one or more addresses on the network, but I don't know of any OS that will handle more than a few dozen addresses for an interface on a LAN.That is so that we don't get in the same position as we are with IPv4. IPv4 ran out of addresses a long time ago, but it was extended by breaking the IP end-to-end premise with kludges like NAT. IPv6 has enough addresses that we should not get into the same position for the foreseeable future, and it restores the IP foundation of end-to-end connectivity because each device can have a unique IP address.