IPv6 Relay and DNS announcement

Hi, I been using openwrt for a few weeks and I'm preparing a new router with a nanopi r6s. My ISP does not support prefix delegation and I'm using double NAT (I also configured DMZ on my ISP router, to reduce the impact of double NAT), so the only option I have for IPv6 is using relay mode for RA-service, DHCP-service and NDP-Proxy in my wan6 and br-lan interfaces. When I do this, my LAN devices are able to connect to the internet using ipv6, however, I noticed that openwrt is no longer being handled as the local DNS. After digging a bit, I found that my RA is actually announcing my ISP DNS (which makes sense, as I'm using relay mode). I know that changing the DNS in my ISP Router could help me circumvent that issue (by pointing it to the link address of the wan interface of the nanopi, which I tested and I know it works). But I have a couple of questions:

  1. Is there I way to make my openwrt router override the DNS from my ISP router (using relay mode)?
  2. I have a ULA prefix set up in the interface global options, but I do not see a ULA being assigned to any of my devices. Is this a consequence of using relay mode too?

Thanks!

Correct.

And regarding No.1, I don't think you can easily alter the relayed packets to change the DNS. You know you could use the ULA to use masq6 for IPv6 only.

You can create a second interface, unmanaged, using an alias as device.

Setup a RA / DHCP server this dummy interface which should announce your custom DNS servers.

Your setup would be simpler if your ISP router supported bridge mode.

In relay mode the LAN interface will not hold a GUA IPv6, so to advertise the router itself as a DNS server on v6 you need to use LAN's LLA or assign a ULA to it.

Then I think you can add a list dns to the LAN DHCP configuration (not in the network, but in the DHCP file, as this is the DNS that you want DHCP to advertise) but I'm not sure if that works in relay mode.

Thanks all for your help... after digging a bit I found a way to override the DNS provided by my ISP router. I got this configuration from the adguard home guide in openwrt documentation.

# Delete existing config ready to install new options.
uci -q del dhcp.lan.dhcp_option
uci -q del dhcp.lan.dns
 
# DHCP option 3: Specifies the gateway the DHCP server should send to DHCP clients.
uci add_list dhcp.lan.dhcp_option='3,'"NET_ADDR"
 
# DHCP option 6: Specifies the DNS server the DHCP server should send to DHCP clients.
uci add_list dhcp.lan.dhcp_option='6,'"NET_ADDR" 
 
# DHCP option 15: Specifies the domain suffix the DHCP server should send to DHCP clients.
uci add_list dhcp.lan.dhcp_option='15,'"lan"
 
# Set IPv6 Announced DNS
uci add_list dhcp.lan.dns="NET_ADDR6"
 
uci commit dhcp
service dnsmasq restart
service odhcpd restart

You only need to change NET_ADDR for the DNS IPv4 and NET_ADDR6 for the IPv6. In my case the IPv4 is the br-lan address, and the IPv6 is the ULA address find in "Global network options". This configuration is not available from Luci, but can be enabled using uci commands.

Hope this helps someone else struggling with these limitations imposed by some ISPs.