Running Wireguard on Ubuntu Server 22.04 with Pi4

The Raspberry Pi is a series of credit card-sized single-board computers developed in the United Kingdom by the Raspberry Pi Foundation to promote the teaching of basic computer science in schools and developing countries.

Post Reply
User avatar
/RaspberryPi
Corporate
Posts: 2449
Joined: Wed Jun 05, 2019 1:29 am

Running Wireguard on Ubuntu Server 22.04 with Pi4

Post by /RaspberryPi »

So I'm running Ubuntu Server 22.04 on a Pi4, I have Wireguard installed so I can use the Pi4 to establish a connection to my Wireguard Server in Oracle Cloud. On that note, all is good and a connection is established.
On other devices at home, devices such as AppleTV where I cannot run a VPN on device itself, I'm wanting to point to the Pi4, specifying that as the gateway and then all traffic runs through that VPN on the Pi4.
All is good at this point but the next thing is what I think I need some help with and also a couple of things I found to be an issue post-setup.
Maybe a minor thing but I'm seeing IPv4 address on interface eth0 appearing twice. One entry is for the IP it picked up on DHCP and secondly, the IP which it has now, statically assigned by the router.
For clarity, router is 192.168.0.1, I have a PiHole/PiVPN running on 192.168.0.2 and my Pi4 is 192.168.0.3.
Ideally when the Pi4 has no VPN connection, it'll default to using PiHole's IP for DNS. That's what I'm wanting to achieve here.
I'm thinking when doing a full tunnel VPN, the Pi4 won't see the devices in local network such as PiHole with it being on an internal IP address.
I was hoping I could set DNS to be 192.168.0.2 on Pi4 so that traffic would hit PiHole and do the necessary. While traffic seems to go to PiHole, sites don't load as I'd expect but see responses from devices in PiHole.
I hope I'm making sense. I have devices normally going to PiHole directly. Where a device has Pi4 set as gateway, the local DNS doesn't work. So when gateway is set as that of Pi4, I'd like for Pi4 to potentially be the DNS as well.
For that case then, I should see logs in PiHole that show DNS queries coming via Pi4 if it is the gateway but I don't.
Apologies if none of this is so clear. My setup is a little unique maybe. I use PiHole to block ads, its intended purpose and with DNSmasq to direct queries to ControlD SmartDNS for certain domains while rest will go DoH to Cloudflare. So I want content from a certain country on Apple TV and want for DNS to fallback to PiHole where the VPN is disconnected.

submitted by /u/phoenix_73
[link] [comments]

More...
Post Reply

Return to “Raspberry Pi Forum”