2020-04-30 16:32:50 +00:00
|
|
|
# OpenVPN
|
2020-03-13 08:06:32 +00:00
|
|
|
|
|
|
|
Read [update-systemd-resolved](https://github.com/jonathanio/update-systemd-resolved).
|
|
|
|
|
2020-05-20 09:50:13 +00:00
|
|
|
| Distribution | Package |
|
|
|
|
| ------------ | --------------------------------------- |
|
|
|
|
| Archlinux | `openvpn-update-systemd-resolved` (AUR) |
|
|
|
|
| Ubuntu | `openvpn-systemd-resolved` |
|
2020-03-13 08:19:30 +00:00
|
|
|
|
2020-05-20 09:50:13 +00:00
|
|
|
Start and enable service:
|
2020-03-13 08:06:32 +00:00
|
|
|
|
|
|
|
```sh
|
2020-05-20 09:50:13 +00:00
|
|
|
systemctl enable --now systemd-resolved.service
|
2020-03-13 08:06:32 +00:00
|
|
|
```
|
|
|
|
|
2020-03-13 08:19:30 +00:00
|
|
|
Edit `client.ovpn`:
|
2020-03-13 08:06:32 +00:00
|
|
|
|
|
|
|
```txt
|
2020-05-20 09:54:26 +00:00
|
|
|
script-security 2
|
|
|
|
setenv PATH /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
|
2020-03-13 08:06:32 +00:00
|
|
|
up /etc/openvpn/scripts/update-systemd-resolved
|
|
|
|
up-restart
|
|
|
|
down /etc/openvpn/scripts/update-systemd-resolved
|
|
|
|
down-pre
|
|
|
|
```
|
2020-03-13 08:19:30 +00:00
|
|
|
|
2020-05-20 09:50:13 +00:00
|
|
|
Connect with factor authentication and start as a dameon:
|
2020-03-13 08:19:30 +00:00
|
|
|
|
|
|
|
```sh
|
2020-05-20 09:50:13 +00:00
|
|
|
sudo openvpn --config /path/to/client.ovpn \
|
|
|
|
--auth-user-pass --auth-retry interact \
|
|
|
|
--daemon
|
2020-03-13 08:19:30 +00:00
|
|
|
```
|