From 39ddda3cdcad65da50042e95067fe2abd71797fc Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Mon, 11 Dec 2023 09:53:04 +0100 Subject: [PATCH] Interfaces: Virtual IPs: Settings - ProxyARP requires strict subnets. --- .../mvc/app/models/OPNsense/Interfaces/Vip.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vip.php b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vip.php index 755d2a313..53ba99a9a 100644 --- a/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vip.php +++ b/src/opnsense/mvc/app/models/OPNsense/Interfaces/Vip.php @@ -117,6 +117,18 @@ class Vip extends BaseModel } } } + } elseif ((string)$node->mode == 'proxyarp') { + $net = $subnet . "/" . $subnet_bits; + if (Util::isSubnet($net) && !Util::isSubnetStrict($net)) { + $messages->appendMessage( + new Message( + gettext("Only strict subnets are allowed for Proxy ARP types". + " (e.g. 192.168.0.0/24, 192.168.1.1/32)." + ), + $key . ".subnet" + ) + ); + } } $vhid_key = sprintf("%s_%s", $node->interface, $node->vhid); if ((string)$node->mode == 'carp') {