diff --git a/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php b/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php index 1ffe0ec90..dea2b0810 100644 --- a/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php +++ b/src/opnsense/mvc/app/library/OPNsense/Firewall/FilterRule.php @@ -205,7 +205,7 @@ class FilterRule extends Rule } } // restructure state settings for easier output parsing - if (!empty($rule['statetype']) && $rule['type'] == 'pass') { + if (!empty($rule['statetype']) && ($rule['type'] == 'pass' || empty($rule['type']))) { $rule['state'] = array('type' => 'keep', 'options' => array()); switch ($rule['statetype']) { case 'none': diff --git a/src/www/firewall_nat_edit.php b/src/www/firewall_nat_edit.php index dec89b08d..c92741aa9 100644 --- a/src/www/firewall_nat_edit.php +++ b/src/www/firewall_nat_edit.php @@ -288,6 +288,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'GET') { // Update interface, protocol and destination $filterent['interface'] = $natent['interface']; + $filterent['statetype'] = "keep state"; if (!empty($natent['protocol'])) { $filterent['protocol'] = $natent['protocol']; } elseif (isset($filterent['protocol'])) {