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 FILEParameters & Attributes
| Name | Type | Description |
|---|---|---|
| -c | option | Check only |
| -f | option | Read commands from file |
| FILE | operand | Rules 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