How To Install OVPN Client in Debian 12

How To Install OVPN Client in Debian 12

Overview

This document outlines how to tweak the openvpn config file to get DNS working across the VPN pipe.

Install systemd-resolved helper scripts

After downloading the config, need to follow these instructions:

  1. The system uses systemd-resolved, so all you have to do is install the openvpn helper script for systemd-resolved via

    sudo apt install openvpn-systemd-resolved

    or with these GitHub instructions

  2. Update your config.ovpn file adding these lines:

    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.

  3. To prevent DNS Leakage, you should add this line to the end of the config.ovpn file (according to this systemd issue comment):

    dhcp-option DOMAIN-ROUTE .