CARP Trigger Script

Started by nertwork, September 11, 2019, 11:54:12 AM

Previous topic - Next topic
Hello,

I'm trying to run something on this where if carp is no longer master but in backup I can run a script. I'm not sure if this is possible but if it is I would like to know where to put that and how to do it.

Thanks!

https://github.com/opnsense/core/tree/master/src/etc/rc.syshook.d/carp

We also had some addions to frr plugin and Ad did some nice additions to capture syslog-ng events and trigger actions.

Sorry, I'm kinda new to this. I have an ISO install that doesn't seem to have anything in /etc/rc.syshook.d/carp/

root@router2:/etc # uname -r
11.2-RELEASE-p14-HBSD


Oh cool! I see it now - so I tried putting a shell script in there with just grabbing some ARGV stuff and it doesn't seem like it calls it. So all I want to do is shut an interface off when it's backup and when it's master bring the interface back online again.

Not sure if that's something to easily do in php here, or if there's an existing script template to use.

Thanks for any additional help here - you've been great on the forums!  ;D ;D :D


Not ppoe - I have residential cable internet with DHCP for the home lab. I have a 2960g and when I set up HA it shows the MAC address bouncing between the two nodes. I also see slower internet speeds and some missed pings when HA is enabled.

Not sure if I'm doing it right but I have CARP set on just the LAN with a .2 and .3 physical with a .1 virtual address on the lan. I don't have anything set up for the WAN. OVPN works fine when bound to the virtual address.

How do you handle WAN failover with DHCP? Usually you need the Modem do the dialup and OPN with private subnet as WAN

So I'm hoping to have carp trigger an interface down on the wan interface when it's backup. When it's master I would like it to trigger an interface up on the wan interface. I don't want to double-nat here, I want to be able to have opnsense have a public dynamic ip address.