Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Firewall - inconsistency in policy based routing rules between route-to and reply-to behaviour #5230

Closed
2 tasks done
AdSchellevis opened this issue Sep 22, 2021 · 0 comments
Closed
2 tasks done
Assignees
Labels
cleanup Low impact changes roadmap Major roadmap item
Milestone

Comments

@AdSchellevis
Copy link
Member

Important notices

Before you add a new report, we ask you kindly to acknowledge the following:

Describe the bug

The automatically generated policy based routing rules for outbound traffic use OPNsense\Firewall\Plugin()->getInterfaceGateways($interface) to determine which route-to gateway to set, this has the side affect of also enforcing this policy for gateways which aren't specifically assigned.

When looking at the generated reply-to gateways, they use OPNsense\Routing\Gateways(legacy_interfaces_details())->getInterfaceGateway($interface, $inet, true) and configure this on the interface, which explicitly excludes non-configured interfaces as gateway candidate.

To Reproduce

Create a gateway on lan, don't assign it to the interface and compare the output of:

print_r(OPNsense\Firewall\Plugin()->getInterfaceGateways("lan"));
--> newly created gateway
print_r(OPNsense\Routing\Gateways(legacy_interfaces_details())->getInterfaceGateway("lan", "inet", true))
--> empty

Expected behavior

Logically reply-to selection should match route-to (and outbound nat) as the logic behind it is similar and should match logical "wan" gateways.

Describe alternatives you considered

none

Additional context

none

Environment

Software version used and hardware type if relevant, e.g.:

OPNsense 20.7.2 (amd64, OpenSSL).

@AdSchellevis AdSchellevis added the cleanup Low impact changes label Sep 22, 2021
@AdSchellevis AdSchellevis self-assigned this Sep 22, 2021
@AdSchellevis AdSchellevis added the roadmap Major roadmap item label Oct 20, 2021
@fichtner fichtner added this to the 22.1 milestone Oct 20, 2021
fichtner pushed a commit that referenced this issue Oct 20, 2021
…amic property instead of the fixed address, refactor route-to behaviour to match reply-to and outbound nat. remove getInterfaceGateways() from firewall plugin as being unused now. closes #5230

(cherry picked from commit 500c82f)
oshogbo pushed a commit to DynFi/opnsense-core that referenced this issue Mar 3, 2022
…amic property instead of the fixed address, refactor route-to behaviour to match reply-to and outbound nat. remove getInterfaceGateways() from firewall plugin as being unused now. closes opnsense/core#5230

(cherry picked from commit 500c82f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Low impact changes roadmap Major roadmap item
Development

No branches or pull requests

2 participants