fix: Include rules or tables file only if set

This commit is contained in:
pulsar89.5 2023-12-29 11:12:41 +01:00
parent efdd1560ff
commit 2ee5dc5ff2
1 changed files with 4 additions and 0 deletions

View File

@ -16,13 +16,17 @@ table inet filter {
# accept neighbour discovery otherwise IPv6 connectivity breaks.
ip6 nexthdr icmpv6 icmpv6 type {nd-neighbor-solicit, nd-router-advert, nd-neighbor-advert} accept
{% if nftables_rules | length > 0 %}
# include specific rules
include "/srv/nftables/rules.conf"
{% endif %}
# count and drop any other traffic
counter drop
}
}
{% if nftables_tables | length > 0 %}
# include more tables
include "/srv/nftables/tables.conf"
{% endif %}