Netgate SG-1000 microFirewall

Author Topic: Trigger action on CARP status change  (Read 116 times)

0 Members and 1 Guest are viewing this topic.

Offline TinMar

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Trigger action on CARP status change
« on: January 12, 2018, 09:13:23 am »
Hi

I'm setting up 2 pfSense instances with HA in a cloud environment but I cannot link my public IP address to the CARP vIP.
I'm searching a way to execute a script when one of the pfSense became master to redirect my public IP to this instance trough my provider's API.

I found this thread that I can add entry to /etc/devd.conf.
Is it a proper way to do that with actual version (2.4.2)?

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21571
  • Karma: +1471/-26
    • View Profile
Re: Trigger action on CARP status change
« Reply #1 on: January 12, 2018, 10:52:15 am »
You can edit your changes into /etc/rc.carpbackup and /etc/rc.carpmaster, or if you want to get fancier there is a plugin infrastructure you could use to write your code into a simple package xml to have it triggered automatically.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!

Offline TinMar

  • Newbie
  • *
  • Posts: 6
  • Karma: +0/-0
    • View Profile
Re: Trigger action on CARP status change
« Reply #2 on: January 17, 2018, 11:11:17 am »
Thanks for your answer.

I've added a line in /etc/rc.carpmaster to execute my script and it's working well but I notice that /etc/rc.carpmaster was overwritten during last update.

The second method could be more stable but I'm not familiar with pfSense package, is there any doc about package structure?