How To Set Up WireGuard on unRAID

unRAID 6.8 is soon to be released and within it lies a game changer for all of us, including those new to the homelab to those of us with more "advanced" setups. I am, of course, talking about WireGuard.


This is a companion discussion topic for the original entry at https://engineerworkshop.com/blog/how-to-set-up-wireguard-on-unraid/

Thank you for a great article. I have been wanting to do this. I think I did everything correctly, but I’m not getting DNS assigned. After much troubleshooting, I can ping and attach to my unRaid server using IP but not name resolution. Same with external sites (I’m guessing as I can ping 1.1.1.1 and 8.8.8.8 but not attach to a web site as I do not know any ones IPs. Any suggestions?
Thanks
Joe

Hi Joe,

Good troubleshooting steps. I agree, it sounds like DNS is not getting assigned. Did you assign a Peer DNS server in the VPN Manager? (If not, assign it to something like 1.1.1.1). Let me know how that works out!

-TorqueWrench

Thanks - I did not see that option. Should I assign it my home router so I can get to stuff on my home net or an external? Also do I need then to export the config again and re-import it to the client.
Thanks
Joe

Yeah, unfortunately the Peer DNS setting only appears after you create the peer (and you have to look for it by clicking the drop down arrow). You typically shouldn’t have to set it. If I am indeed correct, that makes me wonder if your unRAID server’s DNS settings are also off. (Can you ping weather.com from the terminal in unRAID?)

It depends on if your router is also running a DNS server- a lot do. First though, I’d check to make sure that this is actually the problem and just set it to a common DNS like 1.1.1.1 or 8.8.8.8. You will have to export the config again and re-import to the client.

hey mate, another great write up! I have been wanting to test WireGuard on my Unraid box for a while now. So I went through the steps, and it looks like everything is fine but I never get a handshake on my Unraid box in WireGuard, so its not fully connected.

I have set up my dynamic dns, I can ping that and get my current WAN IP, I have set up a NAT rule to forward UDP 51820 to my unraid IP, set up my peer with keys etc, created the tunnel on my iPhone in the WireGuard app using the QR code method - it connects and says its active, however Unraid says “last handshake not received”, and on my iphone I can’t hit the unraid box or my LAN. Also pftop and the firewall logs show no packets at all hitting pfsense for port 51820 either.

Not sure what is happened to be honest … any ideas?

Hey Blade,

Great investigation steps so far. Post your configuration records (with security keys removed) and I’ll take a look!

-TorqueWrench

this was a very easy guide to follow, I opened the file using wireguard on Mac and it connects, and allows me to use my Unraid. however, when I am connected through wireguard, I do not have access to any other webpages even if its on the same WIFI. why can’t I use the web when connected to wireguard? please help

Hi @marc_Webb,

Sorry for the delayed response, I was out on vacation last week. This sounds like a DNS issue. Can you ping individual IP addresses (such as 1.1.1.1)?

Try updating the WireGuard client config file (the one you’re using on your Mac), to include DNS = 1.1.1.1 under the [Interface] block. An example is shown here.

I think that should do the trick for you, but let me know if it doesn’t.

-TorqueWrench