From 5f8d92438c489cc9ea6d6685e7a541612b10098a Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 5 Jun 2015 12:08:44 -0400 Subject: Add CARP status support to OpenBGPD so it can be stopped on a secondary unit. --- config/openbgpd/openbgpd.inc | 116 ++++++++++++++++++++++++++++++++++++++++++- config/openbgpd/openbgpd.xml | 14 +++++- pkg_config.10.xml | 2 +- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 5 files changed, 129 insertions(+), 7 deletions(-) diff --git a/config/openbgpd/openbgpd.inc b/config/openbgpd/openbgpd.inc index c625cff8..038ffa11 100644 --- a/config/openbgpd/openbgpd.inc +++ b/config/openbgpd/openbgpd.inc @@ -191,6 +191,46 @@ function openbgpd_install_conf() { @chmod("{$bgpd_config_base}/bgpd.conf", 0600); unset($conffile); + $carp_ip_status_check = ""; + if (is_ipaddr($openbgpd_conf['carpstatusip'])) { + + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + switch ($pfs_version) { + case "2.0": + case "2.1": + /* Check for 2.1 and before */ + $carpcheckinterface = trim(find_carp_interface($openbgpd_conf['carpstatusip'])); + $carp_ip_status_check = << diff --git a/config/openbgpd/openbgpd.xml b/config/openbgpd/openbgpd.xml index ff40452a..e7d77786 100644 --- a/config/openbgpd/openbgpd.xml +++ b/config/openbgpd/openbgpd.xml @@ -105,6 +105,11 @@ /openbgpd_status.php + + + plugin_carp + + Autonomous Systems (AS) Number @@ -143,8 +148,13 @@ Set the router ID to the given IP address, which must be local to the machine. input - - + + CARP Status IP + carpstatusip + IP address used to determine the CARP status. When the VIP is in BACKUP status, bgpd will not be started. <br/>NOTE: On 2.1.x and before this requires changes to /etc/rc.carpmaster to start bgpd and /etc/rc.carpbackup to stop bgpd or it will not be fully effective. On pfSense 2.2.x and later, full support is automatic. + input + 25 + Networks network diff --git a/pkg_config.10.xml b/pkg_config.10.xml index b1927cef..bced5f51 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -553,7 +553,7 @@ net/openbgpd - 0.9.3_2 + 0.9.3_3 STABLE https://doc.pfsense.org/index.php/OpenBGPD_package 2.2 diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 9e59b3ac..b7bf2019 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -651,7 +651,7 @@ net/openbgpd - 0.9.2 + 0.9.2_1 STABLE https://doc.pfsense.org/index.php/OpenBGPD_package 1.3 diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index a572b727..bbeb5449 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -638,7 +638,7 @@ net/openbgpd - 0.9.2 + 0.9.2_1 STABLE https://doc.pfsense.org/index.php/OpenBGPD_package 1.3 -- cgit v1.2.3