Skip to content

Commit 331408c

Browse files
committed
T75: migrate from pmacct to ipt_NETFLOW
* Change nft to iptables in system_flow-accounting.py as ipt_NETFLOW is iptales plugin * Remove specific and non-relevant pmacct options * Add ipt_NETFLOW options * Move 'interfaces' to 'netflow' tree * Support more flexible 'source-address' and 'source-interface' for each server instead of one source * Add migration script * Update op mode command 'show flow-accounting'
1 parent adb3e06 commit 331408c

16 files changed

Lines changed: 542 additions & 670 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{% if netflow.engine_id is vyos_defined %}
2+
options ipt_NETFLOW engine-id={{ netflow.engine_id }}
3+
{% endif %}
4+
{% if netflow.max_flows is vyos_defined %}
5+
options ipt_NETFLOW maxflows={{ netflow.max_flows }}
6+
{% endif %}
7+
{% if netflow.sampling_rate is vyos_defined %}
8+
options ipt_NETFLOW sampler=random:{{ netflow.sampling_rate }}
9+
{% endif %}
10+
{% if netflow.server is vyos_defined %}
11+
{% set servers_list = [] %}
12+
{% for server in netflow.server %}
13+
{% set d = netflow.server[server] %}
14+
{% set s = (server | bracketize_ipv6) ~ ':' ~ d['port'] %}
15+
{% set s = s ~ ('%' ~ d['source_interface'] if d['source_interface'] is vyos_defined else '') %}
16+
{% set s = s ~ ('@' ~ d['source_address'] if d['source_address'] is vyos_defined else '') %}
17+
{% set _ = servers_list.append(s) %}
18+
{% endfor %}
19+
options ipt_NETFLOW destination={{ servers_list | join(",") }}
20+
{% endif %}
21+
{% if netflow.version is vyos_defined %}
22+
options ipt_NETFLOW protocol={{ netflow.version }}
23+
{% endif %}
24+
{% if netflow.inactive_timeout is vyos_defined %}
25+
options ipt_NETFLOW inactive_timeout={{ netflow.inactive_timeout }}
26+
{% endif %}
27+
{% if netflow.active_timeout is vyos_defined %}
28+
options ipt_NETFLOW active_timeout={{ netflow.active_timeout }}
29+
{% endif %}

data/templates/pmacct/override.conf.j2

Lines changed: 0 additions & 17 deletions
This file was deleted.

data/templates/pmacct/uacctd.conf.j2

Lines changed: 0 additions & 57 deletions
This file was deleted.

debian/control

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -318,9 +318,6 @@ Depends:
318318
# For "vpn openconnect"
319319
ocserv,
320320
# End "vpn openconnect"
321-
# For "system flow-accounting"
322-
pmacct (>= 1.6.0),
323-
# End "system flow-accounting"
324321
# For "system syslog"
325322
rsyslog,
326323
# End "system syslog"
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<!-- include start from include/version/flow-accounting-version.xml.i -->
2-
<syntaxVersion component='flow-accounting' version='2'></syntaxVersion>
2+
<syntaxVersion component='flow-accounting' version='3'></syntaxVersion>
33
<!-- include end -->

0 commit comments

Comments
 (0)