1
General Discussion / Re: mdns repeater in cluster ha setup
« on: May 24, 2021, 01:30:54 pm »
I've started messing with this issue on my HA config.
Experimenting with firewall rules to block the traffic from non-carp firewall interfaces, but haven't quite gotten there yet.
Either way, thank you for this information!
This is the WIP script for stopping the mdns-repeater on carp members for anyone else that comes across this thread. Updating as I have time to test and fix.
Experimenting with firewall rules to block the traffic from non-carp firewall interfaces, but haven't quite gotten there yet.
Either way, thank you for this information!
This is the WIP script for stopping the mdns-repeater on carp members for anyone else that comes across this thread. Updating as I have time to test and fix.
Code: [Select]
#!/usr/bin/env bash
set -euo pipefail
if [ $( sysctl -a | awk '/net.inet.carp.allow/ {print $2}' ) -ne 1 ];
then
echo "Carp is not enabled";
exit 0;
fi
if [ ! -f /conf/config.xml ];
then
echo "Unable to find Opnsense config";
exit 1;
fi
DEMOTE=$( sysctl -a | awk '/net.inet.carp.demotion/ {print $2}' );
PREEMPT=$( sysctl -a | awk '/net.inet.carp.preempt/ {print $2}' );
if [ ${DEMOTE} -gt 0 ];
then
echo "Stopping MDNS Repeater on demoted CARP member";
service mdns-repeater stop
else
if [ ${PREEMPT} -eq 0 ];
then
echo "Stopping MDNS Repeater on non-primary CARP member";
service mdns-repeater stop
fi
fi