forked from vyos/vyos-1x
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathipt_NETFLOW.conf.j2
More file actions
29 lines (29 loc) · 1.23 KB
/
Copy pathipt_NETFLOW.conf.j2
File metadata and controls
29 lines (29 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
{% if netflow.engine_id is vyos_defined %}
options ipt_NETFLOW engine-id={{ netflow.engine_id }}
{% endif %}
{% if netflow.max_flows is vyos_defined %}
options ipt_NETFLOW maxflows={{ netflow.max_flows }}
{% endif %}
{% if netflow.sampling_rate is vyos_defined %}
options ipt_NETFLOW sampler=random:{{ netflow.sampling_rate }}
{% endif %}
{% if netflow.server is vyos_defined %}
{% set servers_list = [] %}
{% for server in netflow.server %}
{% set d = netflow.server[server] %}
{% set s = (server | bracketize_ipv6) ~ ':' ~ d['port'] %}
{% set s = s ~ ('%' ~ d['source_interface'] if d['source_interface'] is vyos_defined else '') %}
{% set s = s ~ ('@' ~ d['source_address'] if d['source_address'] is vyos_defined else '') %}
{% set _ = servers_list.append(s) %}
{% endfor %}
options ipt_NETFLOW destination={{ servers_list | join(",") }}
{% endif %}
{% if netflow.version is vyos_defined %}
options ipt_NETFLOW protocol={{ netflow.version }}
{% endif %}
{% if netflow.inactive_timeout is vyos_defined %}
options ipt_NETFLOW inactive_timeout={{ netflow.inactive_timeout }}
{% endif %}
{% if netflow.active_timeout is vyos_defined %}
options ipt_NETFLOW active_timeout={{ netflow.active_timeout }}
{% endif %}