I’m in an interesting situation.
There is an ISP. My HAP AC2 (TIK1) connects to it via Wifi (wlan0), and it gets an IP address from this ISP. Also it allows ISP’s DNS to be used (dhcp client’s config)
TIK1’s other wifi (wlan1) is setup as AP, allowing other devices (my phone) to connect to it. I also added a dhcp server, with the TIK1’s IP as DNS server.
Traffic is then masqueraded ofc.
I also setup a fixed DNS server (8.8.8.8) in TIK1.
Everything went smooth until now: ISP seems blocking UDP53 to anywhere else but its own DNS server.
With 8.8.8.8 set as fixed in TIK1, neither my phone nor my computer can access the internet.
Once I removed this fix DNS server from TIK1, both devices can connect just fine.
Things get interesting from here.
TIK1 creates a wireguard site-2-site tunnel with TIK2. All necessary mangles are created for marking certain connections and packets to use the tunnel. Currently used only for clients on TIK1 to access TIK2’s lan.
I however need to tunnel my phone’s traffic to this tunnel, and I also created mangles for it: when 8.8.8.8 set as fixed DNS in TIK1, this worked as intended: all traffic of my phone went through the tunnel, and it also used the tunnel for UDP53 to 8.8.8.8.
No as I had to remove 8.8.8.8, if I enable this “phone-2-tunnel” mangle, phone loses internet access with this tunnel. I assume UDP53 is tunnelled, but ISP’s dynamic DNS server is not reachable through the tunnel. But this is only assumption!
Mangle rule is on “prerouting”: it just a “mark connection” from the phone’s IP. So in this case if my phone gets the DNS server as TIK1s IP, will UDP53 be tunneled, or not? Shall I create a mangle for “input” chain too?
Temporarily I added a “tcp” setting to the original mangle, and it’s working now: my phone can see internet through the tunnel (but I assume it get’s dns records from the ISP).
As this is a theoretical topic, I might not have solid question(s) beside of what do you think? Can I solve this somehow better?