I have a raspberry pi running pihole, unbound, and pivpn (wireguard). When wifi is turned off on my android phone and I am connected to the wireguard VPN I am able to browse the web and connect to locally hosted servers on my home network without issue. If I connect to my home network with wireguard running I am unable to connect to any websites or local servers. I am curious why this is occurring and if there are any workarounds. I don’t want to have to manually disable/re-enable my VPN connection every time I leave or return home. Thank you for any advice that is provided and please let me know if you have any clarifying questions about how my pi is configured.
This is probably because you’re trying to connect to your public IP from inside the network, which usually doesn’t work for a variety of reasons. Depending on your router, you might be able to set up a NAT rule to translate requests coming from inside your network to the IP of your Pi.
Instead of doing that, though, my suggestion would be to see if the VPN app you’re using has an “on demand” feature that recognizes when you’re connected to your home network or another trusted SSID and disables the tunnel. There’s not really any benefit to being connected to VPN while you’re at home anyway.
I’m an Apple user so I’m not sure which Android apps support that - it looks like the official WireGuard app does, but the iOS version of that didn’t work great for me so I’m using another app.
Which android OS are you running?
I dont think the on demand feature is still a thing with android (someone correct if im wrong)
The best way to do this is how wireguard turn off when it connects to your SSID at home. Look at the app tasker
Thank you for the feedback. I assumed that I would have issues using a VPN that connects to my home network while my phone is connected to the SSID, but glad someone else confirmed my suspicion. Like I said in my other reply I was hoping to turn the VPN connection on/off when connected to my home network but the Samsung routines did not allow me to do so.
Android version 14. I have a galaxy and was going to set up a routine to turn my VPN on/off depending on if I am connected to my home network but for some reason you are only allowed to connect/disconnect from a VPN that was manually added in settings, not a VPN that is from a downloaded app (Wireguard in this case). I will look at tasker to accomplish the same set up I had in mind using a routine.
I don’t have docker installed on my pi, but good information to know in the future. Time for me to do some research into what changes I need to make to the iptable rules! Never good to make config changes with no knowledge of what I’m doing.