summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-06-11 11:47:56 -0400
committerjim-p <jimp@pfsense.org>2010-06-11 11:50:54 -0400
commit9434370cd00b9b2bf12be0add969d92730810d3d (patch)
tree76fca0e07610971ecf91ce91424ca98faf0e2f26
parentddc75a80690a26e3368e1c2692f9a0940ba831f3 (diff)
downloadpfsense-9434370cd00b9b2bf12be0add969d92730810d3d.zip
pfsense-9434370cd00b9b2bf12be0add969d92730810d3d.tar.gz
Sync OpenVPN settings and DHCP Daemon settings via XMLRPC, and for DHCP set a proper failover IP where needed. Ticket #645 & Ticket #646 - Still needs a way to sync/restart services on Backup after config sync.
-rwxr-xr-xetc/rc.filter_synchronize15
-rw-r--r--usr/local/pkg/carp_settings.xml8
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>
OpenPOWER on IntegriCloud