2

Openvpn can execute a script upon connection using the --up parameter. However this does not seem to work at reconnecting, i.e. when a connection is lost and openvpn automatically reconnects. Is this normal behaviour and is there a way to execute scripts on reconnect too?

Background is that there is a service that supposed to communicate over a VPN. If the connection gets lost, the service might timeout and quit. Therefore I want to have a script running on VPN-connection, that checks if the service is running and if not, starting it.

1 Answers1

2

This is normal behavior. By default, OpenVPN does not run the --up script for partial restarts (In your case: reconnects) . You can change this behavior by using the --up-restart option in your client config. This is clearly documented in the OpenVPN Manual

dotvotdot
  • 572