diff --git a/defaults/main.yml b/defaults/main.yml index 46b8a83..00bd905 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -4,6 +4,7 @@ firewall: statement: accept matches: ~ priority: 1000 + counter: True input: {} forward: {} output: {} diff --git a/templates/nftables.conf.j2 b/templates/nftables.conf.j2 index 143aae3..b55fb20 100644 --- a/templates/nftables.conf.j2 +++ b/templates/nftables.conf.j2 @@ -2,7 +2,7 @@ #!/usr/sbin/nft -f {%- macro nftrule(rule) -%} - {{rule.matches }} {% if not rule.statement == "counter" %}counter {% endif %}{{ rule.statement }} comment "{{ rule.comment }}" + {{rule.matches }} {% if not rule.statement == "counter" or not rule.counter %}counter {% endif %}{{ rule.statement }} comment "{{ rule.comment }}" {% endmacro %} {%- macro nftchain(name) -%}