diff options
-rwxr-xr-x | etc/rc.filter_synchronize | 15 | ||||
-rw-r--r-- | usr/local/pkg/carp_settings.xml | 8 |
2 files changed, 21 insertions, 2 deletions
diff --git a/etc/rc.filter_synchronize b/etc/rc.filter_synchronize index 6e49ed3..36cb100 100755 --- a/etc/rc.filter_synchronize +++ b/etc/rc.filter_synchronize @@ -41,6 +41,7 @@ require_once("functions.inc"); require_once("filter.inc"); require_once("shaper.inc"); require_once("xmlrpc.inc"); +require_once("interfaces.inc"); /* * backup_vip_config_section($section): returns as an xml file string of @@ -146,6 +147,16 @@ function carp_sync_xml($url, $password, $sections, $port = 80, $method = 'pfsens } } + if (is_array($config_copy['dhcpd'])) { + foreach($config_copy['dhcpd'] as $dhcpif => $dhcpifconf) { + if($dhcpifconf['failover_peerip'] <> "") { + $int = guess_interface_from_ip($dhcpifconf['failover_peerip']); + $intip = find_interface_ip($int); + $config_copy['dhcpd'][$dhcpif]['failover_peerip'] = $intip; + } + } + } + foreach ($sections as $section) { /* we can't use array_intersect_key() * due to the vip 'special case' @@ -244,6 +255,10 @@ if (is_array($config['installedpackages']['carpsettings']['config'])) { $sections[] = 'load_balancer'; if ($carp['synchronizeipsec'] != "" and is_array($config['ipsec'])) $sections[] = 'ipsec'; + if ($carp['synchronizeopenvpn'] != "" and is_array($config['openvpn'])) + $sections[] = 'openvpn'; + if ($carp['synchronizedhcpd'] != "" and is_array($config['dhcpd'])) + $sections[] = 'dhcpd'; if ($carp['synchronizednsforwarder'] != "" and is_array($config['dnsmasq'])) $sections[] = 'dnsmasq'; if ($carp['synchronizeschedules'] != "" and is_array($config['schedules'])) diff --git a/usr/local/pkg/carp_settings.xml b/usr/local/pkg/carp_settings.xml index cac39ab..97aee7a 100644 --- a/usr/local/pkg/carp_settings.xml +++ b/usr/local/pkg/carp_settings.xml @@ -106,14 +106,18 @@ <description>When this option is enabled, this system will automatically sync the IPsec configuration to the other CARP host when changes are made.</description> <type>checkbox</type> </field> - <!-- + <field> + <fielddescr>Synchronize OpenVPN</fielddescr> + <fieldname>synchronizeopenvpn</fieldname> + <description>When this option is enabled, this system will automatically sync the OpenVPN configuration to the other CARP host when changes are made.</description> + <type>checkbox</type> + </field> <field> <fielddescr>Synchronize DHCPD</fielddescr> <fieldname>synchronizedhcpd</fieldname> <description>When this option is enabled, this system will automatically sync the DHCP Server settings over to the other carp host when changes are made.</description> <type>checkbox</type> </field> - --> <field> <fielddescr>Synchronize Wake on LAN</fielddescr> <fieldname>synchronizewol</fieldname> |