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 Inspect feature shows N/A for most of the rules #3620

Closed
JasMan78 opened this issue Aug 1, 2019 · 6 comments
Closed

Firewall Inspect feature shows N/A for most of the rules #3620

JasMan78 opened this issue Aug 1, 2019 · 6 comments
Assignees
Labels
bug Production bug
Milestone

Comments

@JasMan78
Copy link

JasMan78 commented Aug 1, 2019

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'm convinced that mine is new.

Describe the bug
Firewall statistics (Inspect) shows N/A for Evaluations, States, Packets and Bytes for most of the rules. Only the NAT rules show current statistics

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Firewall > Rules > INTERFACE'
  2. Click on 'Inspect'

Expected behavior
The new 'Inspect' feature should show statistics for each of the firewall rules (as I understand).

Screenshots
grafik

Relevant log files
Don't know which log file could help to identify the issue.

Additional context
I've already asked some forum members if they knew the issue or how to solve it. But nobody else seems to have this issue.

Environment
OPNsense 19.7.1 (amd64)
Intel(R) Celeron(R) CPU J1900 @ 1.99GHz (4 cores)
OnBoard Realtek
2 x Realtek GbE OnBoard LAN chips (10/100/1000 Mbit)

@AdSchellevis
Copy link
Member

I haven't seen the issue either, some things you could try:

Reload ruleset to make sure there are no parsing issues:

pfctl -f /tmp/rules.debug

(shouldn't generate output)

Check the output of the following command (which is the same as our stats use):

/sbin/pfctl -sr -v

The labels (e.g. 57e45e98f405ff38156d7ccef945da92) should match in /tmp/rules.debug where you can find the description (or the other way around).

@AdSchellevis AdSchellevis added the support Community support label Aug 1, 2019
@fichtner
Copy link
Member

fichtner commented Aug 1, 2019

it could be rules optimised out so no stats can be gathered in the first place

@JasMan78
Copy link
Author

JasMan78 commented Aug 1, 2019

The reload of the ruleset didn't helped.

The output of the second command shows me values for all my rules.

pass in quick on hn1_vlan10 inet proto tcp from <Email_Clients> to ! <Private_Networks> port = imaps flags S/SA keep state label "43043f5837bb8a73d9aa4d6b4cef689f"
  [ Evaluations: 4         Packets: 140       Bytes: 51905       States: 0     ]
  [ Inserted: uid 0 pid 85819 State Creations: 1     ]

The WebGUI still shows N/A

grafik

@JasMan78
Copy link
Author

JasMan78 commented Oct 1, 2019

Yeeeehaaa, I've found the issue. :)
I associated each rule to a category like "LAN > Internet" or "WAN > DMZ".
The inspect feature don't like the ">" sign. After I'd removed it, the values were shown.

@fichtner
Copy link
Member

fichtner commented Oct 1, 2019

HTML encode -> hash mismatch maybe?

@AdSchellevis AdSchellevis added bug Production bug and removed support Community support labels Jan 30, 2020
@AdSchellevis AdSchellevis self-assigned this Jan 30, 2020
@AdSchellevis
Copy link
Member

OPNsense\Firewall\Util::calcRuleHash() on escaped content seems to be the culprit indeed, will fix in close in the next commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Production bug
Development

No branches or pull requests

3 participants