I try to set up a VPN on demand on my iphone, but unfortunately I can not get it to work. Has anyone come to work? would be cool if the connection is always on and you do not lose the connection.
I'm using the OpenVPN Connect app. On my Raspberry I installed PiVPN (in addition to DietPI) which lets you create ovpn keys with the pivpn add command which you can import in that app.
However, in order to make everything work more things are necessary.
You need a public DNS name from a DynDNS provider which must be added to your router in order to use a static IP address for PiVPN.
You have to open port 1194 UDP in your router for the IP address of your Pi-hole.
In /etc/openvpn/server.conf you have to add the line
push "dhcp-option DNS xxx.yyy.zzz.aa"
where the latter is the IP address of your Raspberry/Pi-hole.
@pi-user thanks, my raspi with vpn runs great. only my iphone loses the connection from time to time and I must then always reconnect myself. that's annoying that's why I'm trying out on demand, or at least try it: D
@Mike1: In the settings of the OpenVPN app I chose "Seamless Tunnel" and "Continuously retry" under "Connection Timeout". Works great for me. Hope that helps!
Just in case you're running DietPi: It comes with its own ssh server which doesn't work with FileZilla. I replaced it with openSSH and now it works flawlessly.