Interesting observation. Not the behaviour I would have expected. And anyway, couldn’t the tag just be set on the main fw rule?
Or alternatively if unbound can be configured to use a different gateway and upstream DNS servers depending on the IP of the client making the request, that would be a potential solution. Just not sure what is achievable.
If local DNS resolution is important to you on the clients using the WG tunnel, you could implement a hack (assuming you are using a real domain for your local network) by configuring public DNS entries at your domain host that resolve to local IPs. Not best practice, and you would need to disable DNS rebinding protection on OPNsense, but it would achieve the outcome.
In the end I can live without local DNS resolution, although I'm still sure there must be a trick I haven't thought of.
# /usr/sbin/traceroute6 -w 2 -m '18' -s 'fc00:bbbb:bbbb:bb01::2:7bd8' '2606:4700:4700::1111'traceroute6 to 2606:4700:4700::1111 (2606:4700:4700::1111) from fc00:bbbb:bbbb:bb01::2:7bd8, 18 hops max, 20 byte packets 1 fc00:bbbb:bbbb:bb01::1 20.729 ms 25.648 ms 21.192 ms 2 2400:fa80:1:11::1 23.273 ms 20.705 ms 22.750 ms 3 d5c:89d1:bc60:3::b 21.325 ms 25.349 ms 20.294 ms 4 d5c:89d1:bc60:3::a 21.198 ms 25.220 ms 20.966 ms 5 2402:1b80:1:11::36 20.337 ms 20.226 ms 23.783 ms 6 2402:1b80:1:11::26 25.638 ms 25.354 ms 21.307 ms 7 13335.syd.equinix.com 22.037 ms 40.306 ms 24.235 ms 8 2400:cb00:26:1024::6ca2:f850 23.891 ms 2400:cb00:26:1024::6ca2:f892 26.773 ms 2400:cb00:26:1024::6ca2:f836 25.054 ms
tracert 213.13.24.11Tracing route to 213.13.24.11 over a maximum of 30 hops 1 <1 ms <1 ms <1 ms OpenWRT.lan [192.168.0.1] 2 17 ms 14 ms 15 ms 10.0.0.1 3 * * * Request timed out. 4 * * * Request timed out. 5 * * * Request timed out. 6 * * * Request timed out. 7 * * * Request timed out. 8 * * * Request timed out. 9 * * * Request timed out. 10 * * * Request timed out. 11 * * * Request timed out. 12 * * * Request timed out. 13 * * * Request timed out. 14 * * * Request timed out. 15 * * * Request timed out.