OPNsense Forum

Archive => 19.7 Legacy Series => Topic started by: whit on September 20, 2019, 07:57:04 PM

Title: Adding arbitrary actions to CARP scripting
Post by: whit on September 20, 2019, 07:57:04 PM
What is the most correct way to add arbitrary commands to start or stop services, or execute other actions, when there are CARP status changes? I'm used to doing this in Linux using UCARP, so have the general hang of it. But I'm unacquainted with how BSD, and particularly OPNsense, are set up for this. I'm especially interested in doing it so as to coordinate with, but not get clobbered by, configuration actions taken through the OPNsense web UI. There's likely to be a clean and proper way to do this. Has anyone explored it?
Title: Re: Adding arbitrary actions to CARP scripting
Post by: mimugmail on September 21, 2019, 07:22:49 AM
There is no clean and proper way, you have to script around. Just have a look at the FRR plugin, it has a mechanism like this https://github.com/opnsense/plugins/tree/master/net/frr/src/etc
Title: Re: Adding arbitrary actions to CARP scripting
Post by: franco on September 23, 2019, 10:11:58 AM
> There is no clean and proper way

Well, the clean and proper way *is* https://docs.opnsense.org/development/backend/autorun.html#syshook although you will have to script your way through it according to existing scripts like with FRR or OpenVPN.


Cheers,
Franco
Title: Re: Adding arbitrary actions to CARP scripting
Post by: whit on September 23, 2019, 04:21:13 PM
Thanks Franco,

Exactly what I need to know.