diff options
author | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-09-07 20:30:50 +0000 |
---|---|---|
committer | Nicolas Fort <nicolasfort1988@gmail.com> | 2023-09-07 20:30:50 +0000 |
commit | 1772c0a7232789e6eeb0caa78fe630fab899522d (patch) | |
tree | 52cb227388e57903f3da1aee2b891201fcaf6833 /data/templates/firewall/nftables.j2 | |
parent | 487c817ea320ddabcdaf41a8112937a29c19443e (diff) | |
download | vyos-1x-1772c0a7232789e6eeb0caa78fe630fab899522d.tar.gz vyos-1x-1772c0a7232789e6eeb0caa78fe630fab899522d.zip |
T4072: add firewall bridge filtering. First implementation only applies for forward chain and few matchers. Should be extended in the future.
Diffstat (limited to 'data/templates/firewall/nftables.j2')
-rw-r--r-- | data/templates/firewall/nftables.j2 | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/data/templates/firewall/nftables.j2 b/data/templates/firewall/nftables.j2 index 0fbddfaa9..bb14609b0 100644 --- a/data/templates/firewall/nftables.j2 +++ b/data/templates/firewall/nftables.j2 @@ -1,6 +1,7 @@ #!/usr/sbin/nft -f {% import 'firewall/nftables-defines.j2' as group_tmpl %} +{% import 'firewall/nftables-bridge.j2' as bridge_tmpl %} flush chain raw FW_CONNTRACK flush chain ip6 raw FW_CONNTRACK @@ -147,7 +148,7 @@ table ip vyos_filter { {% endfor %} {% endif %} {% endif %} -{{ group_tmpl.groups(group, False) }} +{{ group_tmpl.groups(group, False, True) }} } {% if first_install is not vyos_defined %} @@ -250,5 +251,16 @@ table ip6 vyos_filter { {% endfor %} {% endif %} {% endif %} -{{ group_tmpl.groups(group, True) }} -}
\ No newline at end of file +{{ group_tmpl.groups(group, True, True) }} +} + +## Bridge Firewall +{% if first_install is not vyos_defined %} +delete table bridge vyos_filter +{% endif %} +{% if bridge is vyos_defined %} +table bridge vyos_filter { +{{ bridge_tmpl.bridge(bridge) }} +{{ group_tmpl.groups(group, False, False) }} +} +{% endif %} |