From 075a0b7a4abdc20a379fec6773a208a7effc73ea Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Sun, 15 Apr 2018 15:37:09 +0200 Subject: [PATCH] CARP/VIP, remove address requirement for virtual ip's, closes https://github.com/opnsense/core/issues/2358 --- src/etc/inc/interfaces.inc | 16 ---------------- src/www/firewall_virtual_ip_edit.php | 7 ------- 2 files changed, 23 deletions(-) diff --git a/src/etc/inc/interfaces.inc b/src/etc/inc/interfaces.inc index affd9a056..dea388dbe 100644 --- a/src/etc/inc/interfaces.inc +++ b/src/etc/inc/interfaces.inc @@ -1707,22 +1707,6 @@ function interface_carp_configure(&$vip) return; } - if (is_ipaddrv4($vip['subnet'])) { - /* Ensure a IP on this interface exists prior to configuring CARP. */ - $ww_subnet_ip = find_interface_ip($realif); - if (!is_ipaddrv4($ww_subnet_ip)) { - file_notice("CARP", sprintf(gettext("Sorry but we could not find a required assigned ip address on the interface for the virtual IP address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); - return; - } - } elseif (is_ipaddrv6($vip['subnet'])) { - /* Ensure a IP on this interface exists prior to configuring CARP. */ - $ww_subnet_ip = find_interface_ipv6($realif); - if (!is_ipaddrv6($ww_subnet_ip)) { - file_notice("CARP", sprintf(gettext("Sorry but we could not find a required assigned ip address on the interface for the virtual IPv6 address %s."), $vip['subnet']), "Firewall: Virtual IP", ""); - return; - } - } - $vip_password = $vip['password']; $vip_password = escapeshellarg(addslashes(str_replace(" ", "", $vip_password))); if ($vip['password'] != "") { diff --git a/src/www/firewall_virtual_ip_edit.php b/src/www/firewall_virtual_ip_edit.php index 84605330d..e14115113 100644 --- a/src/www/firewall_virtual_ip_edit.php +++ b/src/www/firewall_virtual_ip_edit.php @@ -113,13 +113,6 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { $input_errors[] = gettext("A valid IP address must be specified."); } - $natiflist = get_configured_interface_with_descr(); - foreach ($natiflist as $natif => $natdescr) { - if ($pconfig['interface'] == $natif && (empty($config['interfaces'][$natif]['ipaddr']) && empty($config['interfaces'][$natif]['ipaddrv6']))) { - $input_errors[] = gettext("The interface chosen for the VIP has no IPv4 or IPv6 address configured so it cannot be used as a parent for the VIP."); - } - } - /* ipalias and carp should not use network or broadcast address */ if ($pconfig['mode'] == "ipalias" || $pconfig['mode'] == "carp") { if (is_ipaddrv4($pconfig['subnet']) && $pconfig['subnet_bits'] != "32") {