I have multiple servers in my OpenVPN client config with 'random server' turned on. I'd like to reset the connections automatically (via cron?) so it switches between these servers. Can and if so, how can I do that?
Thanks for helping
If you go to /usr/local/opnsense/service/conf/actions_service.conf and add the following line to [reload.all] :
description:Reload all services
It should bring up the service in the Cron GUI to be used.
This is lost on firmware updates. Maybe it does what you want, so we can use that as a base for discussion. :)
Cheers,
Franco
Thank you, that does the trick! It see it reloads all connections. Is it possible to narrow it down to just VPN?
Yes, it's possible to narrow it down to VPN.
Create a new file e.g. /usr/local/opnsense/service/conf/actions.d/actions_custom.conf and add the following:
[vpn]
command:pluginctl vpn
parameters:
type:script_output
message:Reloading VPN subsystem
description:Reload VPN subsystem
You can test it using:
# configctl custom vpn
And it should output something like this:
Configuring IPsec VPN...done.
Syncing OpenVPN settings...done.
Cheers,
Franco