- Create openvpn3 autoload config file
mkdir -p $HOME/.openvpn3/autoload/
touch $HOME/.openvpn3/autoload/x5.autoload
vim $HOME/.openvpn3/autoload/x5.autoload
{
"autostart": true
}
- Copy .ovpn file to autoload config directory with same name like .autoload file
cp /home/andrey/Загрузки/apokoev.retn.ovpn $HOME/.openvpn3/autoload/x5.ovpn
chmod 600 $HOME/.openvpn3/autoload/x5.ovpn && chmod 600 $HOME/.openvpn3/autoload/x5.autoload
- Create systemd sevice to autostart of openvpn3 session
sudo vim /usr/lib/systemd/system/openvpn3-autoload.service
[Unit]
Description=OpenVPN 3 Linux configuration auto loader and starter
After=network.target dbus.service
[Service]
Type=oneshot
User=andrey
ExecStart=/usr/sbin/openvpn3-autoload --directory /home/andrey/.openvpn3/autoload
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
- Run commands
systemctl daemon-reload
systemctl enable openvpn3-autoload.service
systemctl start openvpn3-autoload.service