D
D
Dana2018-06-01 16:26:35
openvpn
Dana, 2018-06-01 16:26:35

OpenVPN client: Execute script on server shutdown?

On the server, there is a client-disconnect in the configuration. When the client is disconnected, the script is run.
Is it possible to do something like this on the client? So that when the connection with the server is lost, the script is launched.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Anton, 2018-06-01
@Fragster

Script Order of Execution
--up
Executed after TCP/UDP socket bind and TUN/TAP open.
--tls-verify
Executed when we have a still untrusted remote peer.
--ipchange
Executed after connection authentication, or remote IP address change.
--client-connect
Executed in --mode server mode immediately after client authentication.
--route-up
Executed after connection authentication, either immediately after, or some number of seconds after as defined by the --route-delay option.
--route-pre-down
Executed right before the routes are removed.
--client-disconnect
Executed in --mode server mode on client instance shutdown.
--down
Executed after TCP/UDP and TUN/TAP close.
--learn-address
Executed in --mode server mode whenever an IPv4 address/route or MAC address is added to OpenVPN's internal routing table.
--auth-user-pass-verify
Executed in --mode server mode on new client connections, when the client is still untrusted.
In this case, IMHO, --down is suitable

I
Igor, 2018-06-10
@hostmaster

As a rule, you can. In the standard openvpn client, this is --client-disconnect cmd. GUI clients like Tunnelblick also have this setting in the connection properties.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question