Skip to content

Instantly share code, notes, and snippets.

@groldo
Last active January 28, 2023 22:47
Show Gist options
  • Select an option

  • Save groldo/b84745166e336f1a7eebcd49d4d19ec2 to your computer and use it in GitHub Desktop.

Select an option

Save groldo/b84745166e336f1a7eebcd49d4d19ec2 to your computer and use it in GitHub Desktop.

Openvpn service creation

tested with ubuntu 22.04

config with:

dhcp-option DNS 1.1.1.1
dhcp-option DOMAIN-ROUTE . # routes all dns traffic through vpn
sudo apt update
sudo apt install openvpn
sudo apt install openvpn-systemd-resolved
touch /etc/openvpn/server/openvpn-server.conf # mind .conf not .ovpn
sudo vim /etc/openvpn/server/openvpn-server.conf
sudo systemctl start openvpn-server@openvpn-server # will look for openvpn-server under /etc/openvpn/server/
sudo systemctl enable openvpn-server@openvpn-server

for openvpn-systemd-resolved to work config has to include:

script-security 2
up /etc/openvpn/update-systemd-resolved
down /etc/openvpn/update-systemd-resolved
down-pre
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment