Multiple IPv6 Routers on Same Network – Configuration Guide

dhcpdipv6local-area-networkradvd

I have two ISPs for my home network. They are connected to two separate routers. If I run radvd and dhcpd on both routers at the same time, I get no IPv6 connectivity. My IPv6 connectivity only works if only one of the routers is running radvd and dhcpd. Why is that the case?

In contrast, for IPv4, I run dhcpd on both routers, and the other computers on the network opportunistically pick up IP and gateway settings base on which router responded first.

Best Answer

IPv4

The reason IPv4 behaves the way you have observed is that it wasn't originally intended to support more than one IP address on an interface. Hence the DHCP client will just wait for the first DHCP server to send an offer, and the client will pretty much assume that's the only DHCP server.

IPv6

IPv6 however is intended to support many addresses on an interface, so the machine can accept router advertisements from multiple routers and assign multiple IP addresses to the interface.

However unless you start using fancy setups such as policy routing, you will have a routing table which only consider the destination address for routing decisions and will have just one default route pointing to the one of the two routers.

So you can expect packets to be routed to the same of the two routers regardless of which source address the client is using. The choice of source address will consider a number of factors including whether the source address will be one of those assigned to the interface which the packet will eventually be routed through. That however doesn't help here since the client will use the same interface to reach both routers.

Thus it's possible that the client machine ends up choosing a source IP address in the range assigned by one router but will send the packets to the other router. This would have worked if it wasn't for packet filters on the way. Even if you can somehow find a solution for those packet filters, it still isn't an ideal setup as you wouldn't really get a redundant setup when outgoing traffic goes through one router and incoming traffic goes through the other.

There isn't enough information in your question to say for certain that this is why it fails for you. However given the information you have provided it does sound like the most likely explanation.

Simple solution

On the short term the simplest solution I can suggest for how you get this setup to work and give you redundancy is to configure one of the routers as IPv4-only and the other as IPv6-only.

Clients which implement RFC 6555 will automatically fail over between IPv4 and IPv6, so with IPv4 and IPv6 going through different routers it would fail over between those two routers.

This will work for reaching services which are dual stack. You can achieve the same failover for IPv4-only services by using DNS64+NAT64. If your ISP doesn't provide NAT64 for you, you could configure NAT64 on the router you choose to use for IPv6 connectivity.

Long term solution

On a long term you presumably want redundancy even when accessing IPv6-only services. The best way to achieve that is if the client machine will automatically choose between the two routers. That means logic similar to RFC 6555 need to choose between two IPv6 connections.

I haven't seen software supporting that today. Some parts of it can be done with policy routing, but that means you need to override routing tables otherwise produced by auto configuration on each client machine. A simpler and slightly worse solution is to only configure the policy routing on the routers at the cost of having outgoing traffic often being sent from client to the wrong router and then taking an extra hop between the two routers.

But to get the full benefit you need software which does all of this:

  • When receiving router advertisements from two routers configure policy routing (or equivalent) in a way that consult the source IP address to decide which of the two routers to use as gateway for the default route.
  • When applications do DNS lookups send the request to two DNS recursors (one from each router advertisement) and ensure the source IP of each DNS request is from the same router advertisement as the destination IP.
  • When receiving a DNS response bind to the same local IP the response was sent to and attempt to connect to one of the addresses in the response.
  • Use RFC 6555 equivalent logic to choose between two connections opened with different source and destination IPv6 address pairs.