core icon indicating copy to clipboard operation
core copied to clipboard

Disable reply-to does not work on auto-added VPN rules

Open glasid opened this issue 5 years ago • 3 comments

Important notices

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

  • [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
  • [x] I have searched the existing issues and I am convinced that mine is new.

Describe the bug Auto-added VPN firewall rules do not take the global firewall setting "Disable reply-to on WAN rules" into account.

To Reproduce Steps to reproduce the behavior:

  1. Setup an IPsec VPN tunnel.
  2. Make sure that auto-added VPN firewall rules are active (uncheck Disable Auto-added VPN rules under VPN -> IPsec -> Advanced Settings).
  3. Output firewall rules on console with command pfctl -sr.
  4. Now globally disable reply-to on WAN rules (Firewall -> Settings -> Advanced).
  5. Output firewall rules on console with command pfctl -sr.

Expected behavior Auto-added VPN firewall rules should not being generated with a reply-to expression when reply-to is globally disabled.

Relevant log files pass out log on pppoe0 route-to ( pppoe0 fe80::xxxx:xxxx:xxxx:xxxx ) proto udp from {any} to {any} port {500} keep state label "37[...]c7" # IPsec: Mobile Devices

pass in log on pppoe0 reply-to ( pppoe0 fe80::xxxx:xxxx:xxxx:xxxx ) proto udp from {any} to {any} port {500} keep state label "27[...]81" # IPsec: Mobile Devices

Environment OPNsense 21.1.5-amd64

glasid avatar Apr 25 '21 09:04 glasid

You should be able to find the responsible toggle using the magnifying glass at the end of the automatically generated rules, I expect your looking for " Disable all auto-added VPN rules." in the advanced IPsec settings.

AdSchellevis avatar Apr 25 '21 11:04 AdSchellevis

I want to use auto-added VPN rules.

The problem is that OPNsense does not honor the global setting "Disable reply-to on WAN rules" when creating auto-added VPN rules.

Auto-added VPN rules should be written without reply-to expression when reply-to on WAN rules is globally disabled under Firewall -> Settings -> Advanced.

firewall_setting

pfctl_output

glasid avatar Apr 25 '21 12:04 glasid

Currently it's probably best to disable the auto generated vpn rules, although it's debatable if it should add route-to in this case, it might have side affects for others (these rules are mainly an inheritance from the past).

For a major update it's no problem to change this, a minor I'm not sure yet.

AdSchellevis avatar Apr 25 '21 15:04 AdSchellevis