IPv6 has more options for configuring addresses than IPv4. The process works as follows:
- A new client joins the network and sends a Router Solicitation (RS)
- Each router (can be multiple) sends a Router Advertisement (RA)
- This happens both on request (when receiving an RS) as well as periodically
- The RA contains a lot of information on how the network is run:
- If the router sending the RA can be a default gateway, and for how long
- Telling clients if there is a stateless (not giving out addresses, only providing extra information like DNS settings) DHCPv6 server on the network (the O=other flag)
- Telling clients if there is a stateful (like in IPv4) DHCPv6 server on the network (the M=managed flag)
- Telling clients about the prefixes in use on the network
- For each prefix: tell the clients if they can auto-configure an address by themselves (the A=autoconf flag)
- And possibly lots of other stuff
If you want to run a fully managed network where the DHCPv6 server manages all the addresses (and please think why you want this before choosing it, if you don't use the information in the DHCPv6 server then letting clients configure their own addresses is much easier) then the router has to turn off the A (autoconf) flag for every prefix it announces and turn on the M (managed) flag so that clients know that they are not allowed to choose their own addresses but that there is a DHCPv6 server available to help them.
This is how to do that on a Cisco router:
; Go to the interface configuration
interface FastEthernet0/0
; Tell clients that auto configuration is not allowed
; This changes the default parameters.
; You have to specify the timers, so I use the standard values
ipv6 nd prefix default 2592000 604800 no-autoconfig
;
; Tell the clients that there is a stateful DHCPv6 server available
ipv6 nd managed-config-flag
; Repeat this for every (sub)interface where you want to force clients to use DHCPv6.
Also note: You need those RA packets. DHCPv6 only provides information, and optionally addresses. It does not provide a default gateway. That is done using RA. The idea here is that routers usually have better information on routing and gateways than DHCP servers, with the added benefit that you can have multiple routers on one subnet acting as default gateways with clients load balancing between them etc.
"Nesting" (overlapping networks) requires proxy-arp and therefore SHOULD be avoided at all costs. No enterprise router will allow such a broken configuration -- each interface/subnet must be completely independent, which means out in the real world, where real IP addresses are routed, this method of "conservation" cannot be used. (aka: nonsense) [*]
It SHOULD not be attempted by anyone not thoroughly versed in networking. (i.e. if you haven't been designing, setting up, and maintaining large, complex networks for a decade or more, you shouldn't even be talking about this type of damage.)
(Full disclosure)
I'm doing this exact thing in an OpenStack development environment right now. 192.168.xx.0/24 has a /29 behind one of the machines in the larger /24. That machine has to have a number of specific, non-default setting changed to pretend to be hosts within the /29 slice. (aka proxy-arp) Yes, I can add a route for the /29 on the router, but the machines in the /24 still won't be able to talk to the /29 because their larger netmask means they're link-local; I'd have to add that /29 route to all the machines in the /24 for them to work.
All-0 and All-1
Those concepts haven't had any tangible meaning in modern networking for decades. Nothing you're likely to run into on the internet makes any assumptions about network size -- everything is classless now. Yes, there used to be issues using an all-0 (or 1) subnet -- say 199.72.0.0/24 (the first subnet from 199.72.0.0/16) (true story) -- because some random system on the internet (AIX) applied class logic to the range. Nothing does that today. So, with 199.72.0.0/16, the address range is 0.0 to 255.255 -- with the those too addresses being the /16's network and broadcast addresses. Those are always the /16's network and broadcast, even if a /24 were nested with it somewhere.
The active netmask ALWAYS defines the network and broadcast. Yes, that means a nested construct has multiple broadcast addresses, but due to different netmasks, nodes within different zones (sub-network, parent-network, ...) listen to different addresses. At layer-2 (ethernet), all hosts in the same domain (eg. vlan) see the same broadcasts but the host will filter out, at layer-3, the "foreign" broadcasts, unless they're sent to the "all nodes" broadcast address of 255.255.255.255.
[*] ISPs wanting to conserve space like this do it via bridging, but that has it's own problems.
[*] I warned my idiot ("we know more than you") coworkers not to use 199.72.0.0/24, but they did it anyway -- putting the webdev desktops in 0.0/25. A day later came the "What. Did. I. Tell. You." after complaints from every single person about random places on the internet they simply couldn't get. That was in 1997.
Best Answer
Basically, with IPv6, most subnets will just be /64. Using subnets of other sizes, with a couple of exceptions, will break features of IPv6. See RFC 5375, IPv6 Unicast Address Assignment Considerations, especially Section 3. Subnet Prefix Considerations:
The exceptions to this include loopback addresses (
/128
) and point-to-point links (/127
).There are other RFCs which discuss this, including RFC 7421, Analysis of the 64-bit Boundary in IPv6 Addressing, particularly Section 4. Effects of Varying the Interface Identifier Length:
In any case, if you want to use other subnet sizes, the subnet concept is exactly the same for IPv4 and IPv6. The only real difference is obvious: IPv4 addresses are 32 bits, and IPv6 addresses are 128 bits. The recommendation for IPv6 is that you use nibble boundaries, but that is not a requirement. If you need a subnet with 10,000 hosts, then you figure out the next larger power of 2 which can hold that many hosts (
14
, in this case, which gives you 16,384 hosts). Subtract14
bits from128
, and you get/114
. One other difference between IPv4 and IPv6 is that you do not need to subtract two from the number of hosts in the subnet since there is no broadcast in IPv6, you can use the all-zeroes and all-ones addresses.