Using OpenVPN on Raspberry PI4 - Help configuring

I managed to have raspberry pi 4 running openwrt with wi-fi and openVPN, but I'm having some problems with the configuration:

  • I can't start OpenVPN through Luci, only through SSH and with commands to ask for user and password; I wanted to save user and pass on the openVPN configuration so it worked instead of failing
  • OpenVPN isn't starting automatically on reboot, which would expose my IP if there was some quick electric loss or something
  • It's having a DNS leak, it doesn't use my VPN provider's DNS servers

I'm fairly new to OpenWRT and even to Raspberry Pi, how can I fix those problems? :blush:


Found online some tips and then noticed the extra field for the user and pass on Luci, configured it there, but I had to add the path to the .auth file on the the auth-pass config line for it to work, apparently it's coming up as well on reboot, but I still haven't found where I stop my DNS from leaking!

1 Like

Follow the OpenWrt wiki to set up OpenVPN client.
Username/password should be stored in a separate file linked inside the VPN client profile.
Autostart should work when you properly configure the username/password authentication.
Disable peer DNS and use public upstream resolvers to solve DNS leak.
As an alternative, use DNS offered by the VPN server.

1 Like

Thanks!! That did it!
The DNS offered by the VPN server link worked and now it's not leaking the DNS anymore, thanks vgaetera!

1 Like

I tried changing from a wi-fi client to wi-fi ap, it didn't work, and then I changed it back but now it's leaking DNS again.
Is the DNS leak solution not permanent or just because my change of configurations?

Check the related configs:

uci show dhcp; netstat -l -n -p | grep -e dnsmasq; pgrep -f -a dnsmasq; \
head -v -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.