commands

nft — Check or inspect nftables

Check an illustrative ruleset without committing changes; requires suitable kernel/netlink access. Never load the partial fixture. Use a fresh private workspace; do not apply to a real system.

Formal Syntax & Structure

linux syntaxlinux
nft -c -f FILE

Parameters & Attributes

NameTypeDescription
-coptionCheck only
-foptionRead commands from file
FILEoperandRules file

Return Value

exit status and output

Check mode reports whether the proposed ruleset can be validated without committing it. Nonzero may indicate syntax, semantic or permission failure; a successful check is not an applied firewall policy.

Working Example

Example Snippetlinux
nft -c -f teaching.nft
Linux Reference