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

Policy info is missing in iptables output #636

Open
Shellcat-Zero opened this issue Jan 14, 2025 · 2 comments
Open

Policy info is missing in iptables output #636

Shellcat-Zero opened this issue Jan 14, 2025 · 2 comments
Labels
enhancement New feature or request

Comments

@Shellcat-Zero
Copy link

Normal output of iptables -xnvL will show lines like:

Chain FORWARD (policy DROP 1110 packets, 141866 bytes)
Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)

that indicates the current policy and associated packet/byte counts processed by the policy. This output appears to be missing from a command like iptables -xnvL | jc --iptables. Please advise.

Thanks!

@kellyjonbrazil kellyjonbrazil added the enhancement New feature or request label Jan 26, 2025
@kellyjonbrazil
Copy link
Owner

Hi there - I can add these fields. I'm assuming these are the totals since the table was initialized? I notice the numbers don't always match up to the underlying rules in the output so wasn't sure how they worked.

@Shellcat-Zero
Copy link
Author

From what I have observed the packets/bytes count corresponds to whatever makes it all the way to the end of the chain where the policy finally acts on the packets. The 'default policy' is whatever happens when packets make it to the end of the chain. I had set up logs at the end of my chains, which would always catch packets prior to the policy, and their packet/byte counts correspond to the policy numbers as shown in my example above, confirming to me that those numbers correspond to packets/bytes being handled specifically by the default policy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants