summaryrefslogtreecommitdiff
path: root/data/templates
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-07-27 17:10:48 +0100
committerGitHub <noreply@github.com>2023-07-27 17:10:48 +0100
commitb76f103317b5aa8abdee5c942509fc11f9e20ef3 (patch)
treeac2b268cc25c42f23f1bae2f91498787aa743b7a /data/templates
parentef6cc1f32566e8524e71634c386c8044e5bcc673 (diff)
parentbd4bb4f869d6df02bfda1ce5668b8cf15a95b4af (diff)
downloadvyos-1x-b76f103317b5aa8abdee5c942509fc11f9e20ef3.tar.gz
vyos-1x-b76f103317b5aa8abdee5c942509fc11f9e20ef3.zip
Merge pull request #2105 from sever-sever/T5368
T5368: service ids ddos-protection add support sflow mode
Diffstat (limited to 'data/templates')
-rw-r--r--data/templates/ids/fastnetmon.j211
-rw-r--r--data/templates/ids/fastnetmon_networks_list.j22
2 files changed, 11 insertions, 2 deletions
diff --git a/data/templates/ids/fastnetmon.j2 b/data/templates/ids/fastnetmon.j2
index 0340d3c92..f6f03d0db 100644
--- a/data/templates/ids/fastnetmon.j2
+++ b/data/templates/ids/fastnetmon.j2
@@ -29,10 +29,19 @@ unban_only_if_attack_finished = on
# For each subnet, list track speed in bps and pps for both directions
enable_subnet_counters = off
-{% if mode.mirror is vyos_defined %}
+{% if mode is vyos_defined('mirror') %}
mirror_afpacket = on
+{% elif mode is vyos_defined('sflow') %}
+sflow = on
+{% if sflow.port is vyos_defined %}
+sflow_port = {{ sflow.port }}
+{% endif %}
+{% if sflow.listen_address is vyos_defined %}
+sflow_host = {{ sflow.listen_address }}
+{% endif %}
{% endif %}
+
process_incoming_traffic = {{ 'on' if direction is vyos_defined and 'in' in direction else 'off' }}
process_outgoing_traffic = {{ 'on' if direction is vyos_defined and 'out' in direction else 'off' }}
diff --git a/data/templates/ids/fastnetmon_networks_list.j2 b/data/templates/ids/fastnetmon_networks_list.j2
index 5f1b3ba4d..0a0576d2a 100644
--- a/data/templates/ids/fastnetmon_networks_list.j2
+++ b/data/templates/ids/fastnetmon_networks_list.j2
@@ -1,4 +1,4 @@
-{% if network is vyos_defined() %}
+{% if network is vyos_defined %}
{% for net in network %}
{{ net }}
{% endfor %}