Debug nftables rules
The nftables framework provides different options for administrators to debug rules and if packets match them.
Create a rule with a counter Copy linkLink copied!
Copy linkLink copied!
To identify if a rule is matched, you can use a counter.
Before you begin Copy linkLink copied!
Copy linkLink copied!
- The chain to which you want to add the rule exists.
Procedure Copy linkLink copied!
Copy linkLink copied!
Add a counter to an existing rule Copy linkLink copied!
Copy linkLink copied!
To identify if a rule is matched, you can use a counter.
Before you begin Copy linkLink copied!
Copy linkLink copied!
- The rule to which you want to add the counter exists.
Procedure Copy linkLink copied!
Copy linkLink copied!
Monitor packets that match an existing rule Copy linkLink copied!
Copy linkLink copied!
To display packets that match a rule, you can use the tracing feature in nftables in combination with the nft monitor command. You can enable tracing for a rule and use it to monitor packets that match this rule.
Before you begin Copy linkLink copied!
Copy linkLink copied!
- The rule to which you want to add the counter exists.
Procedure Copy linkLink copied!
Copy linkLink copied!