IPv6 ULA Prefix Distribution Without a Router

ipv6linuxrouter

I have a network which has no ipv6 connectivity to the internet. But I'd like to play a little with private networking.

So I want to use ULAs for my devices and automatically distribute the prefix.

I know that ipv6 uses router advertisement to do so. But (hence the name…) it advertises a router, too. In my case using dnsmasq it's the address of the server running it. So it ends up in my clients as a default route.

Since I don't have a router and don't want my clients to have a default route is there a way to dynamically assign ula prefixes without a router?

And even more "advanced": Is there a way to use dhcpv6 without a router?

Best Answer

This is possible.

According to RFC 4861 (Neighbor Discovery in IPv6) Section 4.2. Router Advertisement Message Format:

Router Lifetime
[...]
A Lifetime of 0 indicates that the router is not a
default router and SHOULD NOT appear on the default
router list.  The Router Lifetime applies only to
the router's usefulness as a default router; it
does not apply to information contained in other
message fields or options.  Options that need time
limits for their information include their own
lifetime fields.

Using radvd this can be done with e.g.:

interface eth0
{
    AdvSendAdvert on;
    AdvDefaultLifetime 0;
    prefix fd10:1::/64
    {
    };
};

With dnsmasq this is what it could look like:

enable-ra
ra-param=eth0,0,0
dhcp-range=::,constructor:eth0,ra-stateless

(note the ra-param. The second zero is the router's lifetime) (although note that eth0 is configured to have fd10:1::XX/64)

Both result in an assigned prefix on the client used for stateless autoconfiguration which results in addresses like fd10:1::c00l:cafe:baad:food. No default route is set.