"") { interfaces_carp_set_maintenancemode(!isset($config["virtualip_carp_maintenancemode"])); } if ($_POST['disablecarp'] <> "") { if ($status > 0) { set_single_sysctl('net.inet.carp.allow', '0'); if (is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; $found_dhcpdv6 = false; foreach ($viparr as $vip) { $carp_iface = "{$vip['interface']}_vip{$vip['vhid']}"; switch ($vip['mode']) { case "carp": interface_vip_bring_down($vip); interface_ipalias_cleanup($carp_iface); /* * Reconfigure radvd when necessary * XXX: Is it the best way to do it? */ if (isset($config['dhcpdv6']) && is_array($config['dhcpdv6'])) { foreach ($config['dhcpdv6'] as $dhcpv6if => $dhcpv6ifconf) { if ($dhcpv6ifconf['rainterface'] != $carp_iface) { continue; } services_radvd_configure(); break; } } sleep(1); break; } } } $savemsg = sprintf(gettext("%s IPs have been disabled. Please note that disabling does not survive a reboot and some configuration changes will re-enable."), $carp_counter); $status = 0; } else { $savemsg = gettext("CARP has been enabled."); if (is_array($config['virtualip']['vip'])) { $viparr = &$config['virtualip']['vip']; foreach ($viparr as $vip) { switch ($vip['mode']) { case "carp": interface_carp_configure($vip); sleep(1); break; case 'ipalias': if (strpos($vip['interface'], '_vip')) { interface_ipalias_configure($vip); } break; } } } interfaces_sync_setup(); set_single_sysctl('net.inet.carp.allow', '1'); $status = 1; } } $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); if (!empty($_POST['resetdemotion'])) { set_single_sysctl("net.inet.carp.demotion", "-{$carp_detected_problems}"); sleep(1); $carp_detected_problems = get_single_sysctl("net.inet.carp.demotion"); } $pgtitle = array(gettext("Status"),gettext("CARP")); $shortcut_section = "carp"; include("head.inc"); ?>
0) { print_info_box( gettext("CARP has detected a problem and this unit has been demoted to BACKUP status.") . "
" . gettext("Check the link status on all interfaces with configured CARP VIPs.") . "
" . gettext("Search the") . " " . gettext("system log") . " " . gettext("for CARP demotion-related events.") . "
" . "" ); } ?>
"; $align = "style=\"vertical-align:middle\""; if ($carp_enabled == false) { $icon = "\"disabled\""; $status = "DISABLED"; } else { if ($status == "MASTER") { $icon = "\"master\""; } else if ($status == "BACKUP") { $icon = "\"backup\""; } else if ($status == "INIT") { $icon = "\"init\""; } else { $icon = ""; } } echo ""; echo ""; echo ""; echo ""; } } ?>
0) { if ($status > 0) { $carp_enabled = true; echo ""; } else { $carp_enabled = false; echo ""; } if (isset($config["virtualip_carp_maintenancemode"])) { echo ""; } else { echo ""; } } ?>


" . gettext("Could not locate any defined CARP interfaces."); echo "
"; include("fend.inc"); echo ""; return; } if (is_array($config['virtualip']['vip'])) { foreach ($config['virtualip']['vip'] as $carp) { if ($carp['mode'] != "carp") { continue; } $ipaddress = $carp['subnet']; $vhid = $carp['vhid']; $status = get_carp_interface_status("_vip{$carp['uniqid']}"); echo "
" . convert_friendly_interface_to_friendly_descr($carp['interface']) . "@{$vhid}  " . $ipaddress . " {$icon}  " . $status . " 

:
.

" . gettext("pfSync nodes") . ":
"; echo "
";
	system("/sbin/pfctl -vvss | /usr/bin/grep creator | /usr/bin/cut -d\" \" -f7 | /usr/bin/sort -u");
	echo "
"; ?>