I
I
ilovemaryjane2018-11-15 22:32:49
linux
ilovemaryjane, 2018-11-15 22:32:49

How to start openvpn on boot and not allow connections directly?

I set up an OpenVPN server (or rather, I just created all the configs on my vpsk with a script). As a result, I got a .ovpn file, everything works.
And now how to perform this task:
1. Automatically connect when the PC boots
up 2. If the OpenVPN connection is interrupted for some reason, then do not connect directly.
With the first paragraph of the theory, you can make a script, like:

sudo -i
openvpn --config test.ovpn

And run it on boot.
But I'm not sure if this is the best solution.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
TyzhSysAdmin, 2018-11-15
@POS_troi

1. The OpenVPN client can work in daemon mode (except for articles from the Internet, take the trouble to study the documentation)
2. Use a firewall to cut off all outgoing connections towards the gateway, except for connections to the vps-ku with the OpenVPN server

R
Radjah, 2018-11-16
@Radjah

https://blog.radjah.ru/2018/02/openvpn.html
Debian has a unit template [email protected]. After @ is the name of the conf-file from /etc/openvpn/without the extension. You can run separately, you can pull openvpn.serviceto taxi all at once.
There is a unit template [email protected]. After @ is the name of the conf-file from /etc/openvpn/clientwithout the extension. There is a similar one for server.
Dependency difference.
> created on my vpsk
> do not connect directly
The bridge fell - access to the VPS was lost? o_0

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question