From 2cfd70b7ebbcfc9058542b58466176ecda217209 Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 24 Nov 2021 20:05:46 +0100 Subject: [PATCH] System: High Availability - optionally disconnect dailup interfaces when going into CARP backup mode. while here reformat the HA section a bit as state sync is only part of the options. closes https://github.com/opnsense/core/issues/3185 --- src/etc/rc.syshook.d/carp/20-ppp | 63 ++++++++++++++++++++++++++++++++ src/www/system_hasync.php | 30 ++++++++++----- 2 files changed, 83 insertions(+), 10 deletions(-) create mode 100755 src/etc/rc.syshook.d/carp/20-ppp diff --git a/src/etc/rc.syshook.d/carp/20-ppp b/src/etc/rc.syshook.d/carp/20-ppp new file mode 100755 index 000000000..f7a4b8532 --- /dev/null +++ b/src/etc/rc.syshook.d/carp/20-ppp @@ -0,0 +1,63 @@ +#!/usr/local/bin/php + $interface) { + if ($ppp['if'] == $interface['if']) { + log_error("{$iface} is connected to ppp interface {$ifkey} set new status {$type}"); + if ($type == 'BACKUP') { + interface_bring_down($ifkey); + } else { + interface_ppps_configure(false, $ifkey); + } + } + } + } + } +} diff --git a/src/www/system_hasync.php b/src/www/system_hasync.php index 9b3ba8304..ab949c2ba 100644 --- a/src/www/system_hasync.php +++ b/src/www/system_hasync.php @@ -35,6 +35,7 @@ $a_hasync = &config_read_array('hasync'); $checkbox_names = array( 'pfsyncenabled', 'disablepreempt', + 'disconnectppps', 'synchronizealiases', 'synchronizeauthservers', 'synchronizecerts', @@ -127,12 +128,30 @@ include("head.inc");
- + + + + + + + + + - - - -
+ /> + +
+ /> + +
@@ -146,15 +165,6 @@ include("head.inc");
- /> - -