Closed htilly closed 2 years ago
I am having the same issue on my UDMP. I however, have tried creating a network within Unifi settings, no change.
Hi @austin12block and @htilly,
The problem is dnsmasq is configured to only listen for requests from certain interfaces. You need to add the wg0 (or your wireguard interface name) to the dnsmasq config. You just need to run these commands after you run wg-quick up
,
echo "interface=wg0" > /run/dnsmasq.conf.d/custom_listen.conf
killall -9 dnsmasq
Alternatively, you can add those commands to PostUp in your wireguard config's Interface section, e.g.:
PostUp = sh -c 'echo "interface=wg0" > /run/dnsmasq.conf.d/custom_listen.conf; killall -9 dnsmasq'
PreDown = sh -c 'rm -f /run/dnsmasq.conf.d/custom_listen.conf; killall -9 dnsmasq'
Please try the following solution and see if it works for you guys.
Also @htilly, do you mean UDM, not USG right?
@austin12block, you should NOT create a network with the same subnet as the wireguard interface in your Unifi settings. It will confuse the routing and packets will not make it to the wireguard interface (instead going to the other network half the time).
Hi @peacey I have added the commands you gave to my wg0.conf and it is working wonderfully. Thank you for the assistance!
Thanks @peacey!
Works perfect, and yes, I meant the USG. Might be worth mentioning about the DNS in the https://github.com/tusc/wireguard-kmod#configuration ?
Thanks again.
@htilly glad it worked. But sorry, you said USG again. This project is for the UDM, not USG, so I'm surprised it's working on the USG.
Can you tell us your USG firmware version, and also your kernel version by running uname -a
? This is the first time I've seen someone use this on the USG, so very curious.
@peacey must be autocorrection :-) Let's try it again: UDM
:-)
Everything works perfect beside the fact that I can't get local DNS to work.
Client config:
Server config:
All other internal traffic to the LAN, 172.16.200.0/24, work just fine.
I have not created a network nor static routes or FW rules in the USG. Since the DNS is hosted on the USG it self, do I need to create the WG network in order for the USG firewall to accept / route the traffic.. And if so, will this messup the WG traffic?