A busy rule can discard every matching packet while logging only a sample. Record the source zone, destination, protocol, port and time of one authorized test before comparing the log with the counter.
Find the rule that made the decision
A router service uses Input. Traffic crossing the router to a NAS uses Forward. In LuCI open Network → Firewall → Traffic Rules and check earlier rules. For the existing deny rule, back up its settings. On supported fw4 versions, log enables logging and log_limit limits the messages. Inspect fw4 print for a rate-limited log and a separate deny verdict, then run fw4 check before applying. Inspect the live counter with nft -a list table inet fw4. If no packets arrive, check the upstream router first.
option log '1' · option log_limit '2/minute'
Count four loopback packets
Use an isolated OpenWrt 25.12.6 x86/64 test router with nft and socat. Confirm the table name is unused. Save the first block as sample.nft in a new directory. The second block sends only to loopback. The lab uses a one-packet burst so the counters are easy to compare.
table inet gm_log_sample40 {
chain sampled_output {
type filter hook output priority 8; policy accept;
oifname "lo" ip daddr 127.40.0.1 udp dport 52440 limit rate 1/minute burst 1 packets counter log prefix "GM40-SAMPLE "
oifname "lo" ip daddr 127.40.0.1 udp dport 52440 counter drop
}
}
ubus call system board | jsonfilter -e '@.release.description'
cat sample.nft
nft -c -f sample.nft && nft -f sample.nft
for i in 1 2 3 4; do echo test | socat -u - UDP4:127.40.0.1:52440; done
nft list chain inet gm_log_sample40 sampled_output
logread | grep 'GM40-SAMPLE ' | tail -n 1
nft delete table inet gm_log_sample40
nft list table inet gm_log_sample40 >/dev/null 2>&1; echo "lookup status: $?"
The log rule counted 1 packet / 33 bytes and the drop rule counted 4 packets / 132 bytes. The log showed OUT=lo, PROTO=UDP and DPT=52440. Operation not permitted was expected. After deleting only the test table its lookup returned 1. For a real policy, retry an allowed service and a fresh denied connection from the intended zones. If the deny counter stays unchanged, check rule order, address family and path. Remove temporary logging and retain the original deny action. Identify a new device from OpenWrt lease and access logs
Comments