eworm-de / routeros-scripts

a collection of scripts for MikroTik RouterOS
GNU General Public License v3.0
1.27k stars 285 forks source link

DHCP-to-DNS script IPv6 support #48

Open KuxaBeast opened 10 months ago

KuxaBeast commented 10 months ago

I have used a similar script to dhcp-to-dns for assigning static DNS records to IPv4 addresses and previously modified it to also generate records for IPv6 addresses based on DHCPv4 leases' MAC address and IPv6 Neighbor List entries. I haven't thought about it much before, so there might be some scenario where this kind of solution misbehaves. Nevertheless, I believe we deserve some way to implement DNS auto-configuration for IPv6 as well...

Is this feature wanted or is the dhcp-to-dns script considered feature-complete? Would perhaps a separate script implementing this feature be welcomed or does this feel too hacky?

eworm-de commented 10 months ago

The scripts are never feature-complete... I am constantly improving all of them.

In fact I have thought about adding support for IPv6 / AAAA records in dhcp-to-dns several time, but always relinquished.

Let's face the details: The A records for IPv4 addresses generated from DHCP work pretty well. Generating AAAA records on top of that with a pretty fragile mechanism is a bad idea. It does not bring any benefit (as A records a available anyway), but brings extra layers of complexity. I am inclined not to accept anything like this.

Or can you give an example where this actually does bring a real benefit?

KuxaBeast commented 10 months ago

Well, when I build my network on dual-stack, I don't think IPv4 records are enough for me. I consider the possibility of having devices in remote IPv6-only networks (on VPN or other medium) trying to access my local network and in case of having just A records, they would not resolve my devices. I actually have a practical use case with a WireGuard-based OSPF2/3 network and since NAT64/46 is kinda not possible on ROS atm I can't really cheat that :D

eworm-de commented 10 months ago

But for remote IPv6-only devices you do not have IPv4 DHCP leases that you could derive the AAAA records from, no?

eworm-de commented 10 months ago

Ah, wait... Your case is the other way round? Your remote devices should access local devices via IPv6, resolved via derived AAAA records? Hmm... 🤔

I am still not sure this is a good tradeoff...

netravnen commented 5 months ago

Caveat,

How many local devices have Privacy Extensions enabled nowadays? 🤔

Apple defaults to using privacy extensions on all platforms, afaik.

↪ DHCP(hostname)-to-DNS for subnets with SLAAC for clients to generate their addresses does not seem very viable. If my client rotates it's primary v6 every few hours Y hours/X minutes.


For subnets with addressing being done with DHCPv6. Were client addresses are very stable for as long as the client is up and connected. The suggestion idea does certainly hold value.