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 +++++- 2 files changed, 126 insertions(+), 4 deletions(-) (limited to 'config/openbgpd') 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 -- cgit v1.2.3