I found a solution on this blog post.While there are two solutions mentioned, I prefer using the second one because it means my DNS is set by the OpenVPN server (the first solution means I use the same DNS servers whether or not I'm connected to the OpenVPN server).

Rather, the openvpn-systemd-resolved package dynamically updates the file /etc/resolv.conf, by specifying an executable script after the up and down in your openvpn client conf (as per the linked (and incomplete!) "tutorial"). DD-WRT Forum :: View topic - openVPN --script-security Error Apr 12, 2009 Openvpn Script Security 2 - tuffceroomsimpledg.cf Openvpn Script Security 2, aplicaciones vpn gratis iphone, add cyberghost to fire stick, How Do You Use Web Browser For Expressvpn How To Set Up an OpenVPN Server on Ubuntu 16.04 | DigitalOcean

OpenVPN / Re: [Openvpn-users] Up/Down Script Failure

@ring0 I would advise using route-up instead of up to minimize race conditions. When the up script is executed, the connection is not yet set up and you have no chance to query the remote resolver you're setting. If you start the OpenVPN client in a situation where the connection setup would not complete, you are putting your resolver into a possibly non-functional state for a prolonged period How to create OpenVPN TAP interface - bridge mode Below is an example of connection two LANs (bridged eth0 and eth1) through TAP interface of OpenVPN tunnel on the layer two (L2) of ISO/OSI model. Router A - Server server.ovpn

Create the /etc/openvpn/upvpn script: Source based routing for specific client added in up script route-noexec # script-security 2 needed to run up and down scripts script-security 2 # Script to run after successful TUN/TAP device open up /etc/openvpn/upvpn # Call down script before to close TUN to properly remove the routing down-pre down

DD-WRT OpenVPN Setup with setup script | hide.me VPN … Dec 08, 2016 Ubuntu 18.04 no DNS resolution when connected to openvpn script-security 2 up /etc/openvpn/update-systemd-resolved down /etc/openvpn/update-systemd-resolved down-pre That instead of adding up and down of /etc/openvpn/update-resolv-conf to the conf. To prevent DNS Leakage, you should add this line to the end of the config.ovpn file … linux - Running a command after my OpenVPN client connects