Bug #11734
closed
NAT rule overlap detection is inconsistent
Added by Marcos M over 3 years ago.
Updated about 3 years ago.
Plus Target Version:
22.01
Affected Architecture:
All
Description
When saving an additional NAT port forward rule:
- The "protocol" field is effectively ignored in overlap checks
- The "source" field is not checked in overlap checks
- Rule is prevented from being saved when a destination mask is defined
- Status changed from New to Rejected
Protocol doesn't overlap. You can have separate port forward rules for TCP and for UDP on the same port ranges which do not conflict.
Plus, that overlap check isn't for looking at network addresses, it's only making sure that port ranges do not overlap.
I've added some further details on it. At the least, there is a typo that should be fixed.
- Status changed from Rejected to Pull Request Review
- Target version set to CE-Next
Adding more details here; currently:
It's possible for rules with overlapping ports to be saved when the destination type is set to network
because $natent['destination']['address']
can have a value of 10.0.0.0/24
while post['dst']
has a value of 10.0.0.0
(the mask is on a separate variable post['dstmask']
).
There is a typo $natent['proto']
, which means the !=
operator checks will always return true because null
will never equal a defined variable. Hence, unless the protocol is set to TCP/UDP
, the overlap check below this statement will never run.
- Plus Target Version set to 21.09
- Status changed from Pull Request Review to Feedback
PR has been merged. Thanks!
- % Done changed from 0 to 100
There's still an issue when the selected source or destination is a special network (e.g. L2TP Clients), as well as a missing /
in the checks. I have a fix ready to submit.
Tested the changeset and the issue for 12132 and this redmine appears to be resolved.
- Status changed from Feedback to Pull Request Review
- Has duplicate Bug #12132: Port Fowards Using CARP VIP Form Validation on Source Broken added
- Target version changed from CE-Next to 2.6.0
- Related to Bug #12361: NAT rule overlap detection does not check special networks added
- Status changed from Pull Request Review to Resolved
Marking resolved since the original part was already tested. I moved the special networks issue over to #12361 as it needs to wait until after 21.09.
- Plus Target Version changed from 21.09 to 22.01
Also available in: Atom
PDF