Community discussions

MikroTik App
 
OlofL
Member Candidate
Member Candidate
Topic Author
Posts: 113
Joined: Mon Oct 12, 2015 2:37 pm

Feature request: DHCPv6 server leases sync between two routers? (HA setup)

Sun Feb 20, 2022 8:22 pm

How can I sync DHCPv6 server leases between two routers?

What I like about RouterOS is that it does install a dynamic special route in its route table for the PrefixDelegation. Which means I dont need to use a routing protocol on the clients for my upstream router to reach the prefixes.

But, how do I make this kind of setup HA? How can I sync DHCPv6 leases? (and install the dynamic route)
 
chewie198
just joined
Posts: 9
Joined: Mon Feb 14, 2022 5:17 pm

Re: Feature request: DHCPv6 server leases sync between two routers? (HA setup)

Fri Feb 25, 2022 2:51 pm

Why not setup both routers in your HA stack behind a VRRP interface and setup the DHCP client on that? I haven't completed testing yet but I'm currently building such a configuration right now. The DHCP lease itself isn't directly synced by ROS, but you can configure the DHCP client to use the DUID and MAC address of the VRRP interface so that when it fails over to the backup router, it will obtain the same lease as it had before. Using the new ROS 7 synchronization features you can also configure firewall state failover and a VRRP group master interface so that the failover happens fairly seamlessly. I also have most of the timeouts set fairly low so that most failovers happen in under five seconds and dynamic IP address changes happen in less than thirty seconds. In fact, the ability to failover like this is the primary reason I've spent the last month or so switching my entire routing stack over from a pfSense VM. That and the extra reliability, simplicity, and performance of running a hardware firewall vs depending on the hypervisor cluster.
 
chewie198
just joined
Posts: 9
Joined: Mon Feb 14, 2022 5:17 pm

Re: Feature request: DHCPv6 server leases sync between two routers? (HA setup)

Fri Feb 25, 2022 3:04 pm

Just realized I might have been misunderstanding you. Are you talking about syncing client leases? Since that's not currently possibly to do in ROS. On the other hand, I just enabled SLAAC so that I can avoid that problem altogether. The IPv6 address space is so large that as long as you're randomly generating address suffixes, you can forgo the DHCP6 server entirely and not have to worry about address conflicts. With DHCP4 I resorted to using split pools and simultaneously running two DHCP servers per subnet.

If you really do want to use DHCP6 with synchronized lease failover then you can look at alternative software like KEA or Windows Server. For my home lab/small business use case that's less advantageous than being able to run the DHCP server directly on the router, but it might make sense if you were a larger enterprise that already had dedicated HA hardware on which to run such software. Personally, I think that stateless config is a better solution overall.
 
JimKusz
just joined
Posts: 20
Joined: Sat Apr 23, 2022 6:41 pm

Re: Feature request: DHCPv6 server leases sync between two routers? (HA setup)

Mon Aug 01, 2022 2:31 am

Just found this thread, as I had the same question.

What you do (SLAAC) works fine if the dhcp network is the "edge". Where it doesn't work is if the routers are being used in an ISP or equivalent situation. For example:
I am an ISP. I allocate a dynamic IP (/64) to each customer on my customer-facing network. However, I also offer Prefix Delegation, say a /60, to each customer who requests it. This allows the customer's router (Mikrotik or otherwise) to request address space (through DHCPv6) and use the delegated subnet on its own LAN. When a customer does request the PD (Prefix Delegation -- the IPv6 subnet), the Mikrotik ISP router needs to add a static route in its routing table for that subnet pointing to the IPv6 /64 that was allocated directly on the network (eg, 1111:1:1:10/64 is reached through 1111:1:1:1::50 (the specific IP of the customer's router on the WAN side).

To have HA work in this scenario, its critical for two things to happen:

1) since prefix delegation REQUIRES DHCPv6, there will be a DHCPv6 lease table (all leases the SERVER has allocated to clients/customers), both routers need this
2) There will be an existing list of IPv6 routes that Mikrotik (dhcpv6 server?) has inserted to the FIB (routing table) to make the delegated prefixes reachable from the internet. These need to be sync'ed to the backup router.

Is there any way to make this work? This is the main thing standing in the way of me deploying a Mikrotik core on my ISP...

Who is online

Users browsing this forum: No registered users and 12 guests