Cookbooks
firewall
documentation
Resource Nftables Rule

nftables_rule

Actions

  • :create

Properties

NameTypeDefaultDescription
command:accept :counter :drop :log :masquerade :redirect :reject:allow
descriptionStringname_property, can be added as comment to the nftables ruleset
destination[String, Array]ip address, fqdn or a list thereof
direction:in :out :pre :post :forward:in
dport[Integer, String, Array, Range]
family[:ip6, :ip]:ip
firewall_nameString'default'Must be equal to the name of the nftables-resource.
include_comment[true, false]true
interfaceString
log_group[nil, Integer]nilIf set to an integer, specify the nflog group for this rule
log_prefix[nil, String]nilIf nil, use the name of the chain as prefix, otherwise the provided value
notify_firewall[true, false]trueWhen set to false, this rule will not be added to the ruleset
outerfaceString
positionInteger50Lower priority means earlier rule evaluation
protocol[Integer, Symbol]:tcp
rawString
redirect_portInteger
source[String, Array]
sport[Integer, String, Array, Range]
stateful[Symbol, Array]

Examples

See the recipe used for testing.