Skip to content

Commit 7d74829

Browse files
committed
T7556: VPP add IPFIX collector configuration
Add VPP IPFIX configuration commands: ``` set vpp ipfix active-timeout '8' set vpp ipfix collector 192.0.2.2 port '2055' set vpp ipfix collector 192.0.2.2 source-address '192.0.2.1' set vpp ipfix flowprobe-record 'l2' set vpp ipfix flowprobe-record 'l3' set vpp ipfix flowprobe-record 'l4' set vpp ipfix inactive-timeout '32' set vpp ipfix interface eth0 set vpp ipfix interface eth1 direction 'both' set vpp ipfix interface eth1 flow-variant 'ipv4' ```
1 parent 71591b7 commit 7d74829

File tree

10 files changed

+819
-0
lines changed

10 files changed

+819
-0
lines changed

data/config-mode-dependencies/vyos-vpp.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"vpp_interfaces_vxlan": ["vpp_interfaces_vxlan"],
1212
"vpp_interfaces_xconnect": ["vpp_interfaces_xconnect"],
1313
"vpp_acl": ["vpp_acl"],
14+
"vpp_ipfix": ["vpp_ipfix"],
1415
"vpp_nat": ["vpp_nat"],
1516
"vpp_nat_cgnat": ["vpp_nat_cgnat"],
1617
"vpp_kernel_interface": ["vpp_kernel-interfaces"],

data/templates/vpp/startup.conf.j2

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,8 @@ plugins {
9191
plugin linux_cp_plugin.so { enable }
9292
plugin linux_nl_plugin.so { enable }
9393
plugin pppoe_plugin.so { enable }
94+
# Flow
95+
plugin flowprobe_plugin.so { enable }
9496
plugin sflow_plugin.so { enable }
9597
# NAT uncomment if needed
9698
# plugin cnat_plugin.so { enable }

interface-definitions/vpp.xml.in

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,182 @@
346346
</tagNode>
347347
</children>
348348
</node>
349+
<node name="ipfix" owner="${vyos_conf_scripts_dir}/vpp_ipfix.py">
350+
<properties>
351+
<help>IP Flow Information Export (IPFIX) configuration</help>
352+
<priority>322</priority>
353+
</properties>
354+
<children>
355+
<tagNode name="collector">
356+
<properties>
357+
<help>Collector IP address</help>
358+
<valueHelp>
359+
<format>ipv4</format>
360+
<description>IPv4 server to export IPFIX</description>
361+
</valueHelp>
362+
<valueHelp>
363+
<format>ipv6</format>
364+
<description>IPv6 server to export IPFIX</description>
365+
</valueHelp>
366+
<constraint>
367+
<validator name="ip-address"/>
368+
</constraint>
369+
</properties>
370+
<children>
371+
#include <include/port-number.xml.i>
372+
<leafNode name="port">
373+
<defaultValue>4739</defaultValue>
374+
</leafNode>
375+
<leafNode name="path-mtu">
376+
<properties>
377+
<help>Path MTU</help>
378+
<valueHelp>
379+
<format>u32:68-1450</format>
380+
<description>Bytes</description>
381+
</valueHelp>
382+
<constraint>
383+
<validator name="numeric" argument="--range 68-1450"/>
384+
</constraint>
385+
</properties>
386+
<defaultValue>512</defaultValue>
387+
</leafNode>
388+
#include <include/source-address-ipv4-ipv6.xml.i>
389+
<leafNode name="template-interval">
390+
<properties>
391+
<help>Interval in seconds</help>
392+
<valueHelp>
393+
<format>u32:1-300</format>
394+
<description>Seconds</description>
395+
</valueHelp>
396+
<constraint>
397+
<validator name="numeric" argument="--range 1-300"/>
398+
</constraint>
399+
</properties>
400+
<defaultValue>20</defaultValue>
401+
</leafNode>
402+
<leafNode name="udp-checksum">
403+
<properties>
404+
<help>Allow UDP checksum</help>
405+
<valueless/>
406+
</properties>
407+
</leafNode>
408+
</children>
409+
</tagNode>
410+
<tagNode name="interface">
411+
<properties>
412+
<help>Interface</help>
413+
<completionHelp>
414+
<script>${vyos_completion_dir}/list_interfaces</script>
415+
</completionHelp>
416+
<valueHelp>
417+
<format>txt</format>
418+
<description>Interface name</description>
419+
</valueHelp>
420+
</properties>
421+
<children>
422+
<leafNode name="direction">
423+
<properties>
424+
<help>Flow direction</help>
425+
<completionHelp>
426+
<list>rx tx both</list>
427+
</completionHelp>
428+
<valueHelp>
429+
<format>rx</format>
430+
<description>Rx direction</description>
431+
</valueHelp>
432+
<valueHelp>
433+
<format>tx</format>
434+
<description>Tx direction</description>
435+
</valueHelp>
436+
<valueHelp>
437+
<format>both</format>
438+
<description>Rx and Tx direction</description>
439+
</valueHelp>
440+
<constraint>
441+
<regex>(rx|tx|both)</regex>
442+
</constraint>
443+
</properties>
444+
<defaultValue>both</defaultValue>
445+
</leafNode>
446+
<leafNode name="flow-variant">
447+
<properties>
448+
<help>Flow variant</help>
449+
<completionHelp>
450+
<list>l2 ipv4 ipv6</list>
451+
</completionHelp>
452+
<valueHelp>
453+
<format>l2</format>
454+
<description>L2</description>
455+
</valueHelp>
456+
<valueHelp>
457+
<format>_ipv4</format>
458+
<description>IPv4</description>
459+
</valueHelp>
460+
<valueHelp>
461+
<format>_ipv6</format>
462+
<description>IPv6</description>
463+
</valueHelp>
464+
<constraint>
465+
<regex>(l2|ipv4|ipv6)</regex>
466+
</constraint>
467+
</properties>
468+
<defaultValue>ipv4</defaultValue>
469+
</leafNode>
470+
</children>
471+
</tagNode>
472+
<leafNode name="active-timeout">
473+
<properties>
474+
<help>Flow activity timeout</help>
475+
<valueHelp>
476+
<format>u32:0-2147483647</format>
477+
<description>Active flow export timeout (seconds)</description>
478+
</valueHelp>
479+
<constraint>
480+
<validator name="numeric" argument="--range 0-2147483647"/>
481+
</constraint>
482+
</properties>
483+
<defaultValue>15</defaultValue>
484+
</leafNode>
485+
<leafNode name="inactive-timeout">
486+
<properties>
487+
<help>Flow inactivity timeout</help>
488+
<valueHelp>
489+
<format>u32:0-2147483647</format>
490+
<description>Inactive flow export timeout (seconds)</description>
491+
</valueHelp>
492+
<constraint>
493+
<validator name="numeric" argument="--range 0-2147483647"/>
494+
</constraint>
495+
</properties>
496+
<defaultValue>120</defaultValue>
497+
</leafNode>
498+
<leafNode name="flowprobe-record">
499+
<properties>
500+
<help>Flow record layers</help>
501+
<completionHelp>
502+
<list>l2 l3 l4</list>
503+
</completionHelp>
504+
<valueHelp>
505+
<format>l2</format>
506+
<description>Include level 2 information</description>
507+
</valueHelp>
508+
<valueHelp>
509+
<format>l3</format>
510+
<description>Include level 3 information</description>
511+
</valueHelp>
512+
<valueHelp>
513+
<format>l4</format>
514+
<description>Include level 4 information</description>
515+
</valueHelp>
516+
<constraint>
517+
<regex>(l2|l3|l4)</regex>
518+
</constraint>
519+
<multi/>
520+
</properties>
521+
<defaultValue>l3</defaultValue>
522+
</leafNode>
523+
</children>
524+
</node>
349525
<node name="settings">
350526
<properties>
351527
<help>VPP settings</help>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?xml version="1.0"?>
2+
<interfaceDefinition>
3+
<node name="show">
4+
<children>
5+
<node name="vpp">
6+
<children>
7+
<node name="ipfix">
8+
<properties>
9+
<help>Show VPP IPFIX information</help>
10+
</properties>
11+
<children>
12+
<node name="collectors">
13+
<properties>
14+
<help>Show IPFIX collectors</help>
15+
</properties>
16+
<command>sudo ${vyos_op_scripts_dir}/vpp.py show_ipfix_collectors</command>
17+
</node>
18+
<node name="interfaces">
19+
<properties>
20+
<help>Show IPFIX interfaces</help>
21+
</properties>
22+
<command>sudo ${vyos_op_scripts_dir}/vpp.py show_ipfix_interfaces</command>
23+
</node>
24+
<node name="table">
25+
<properties>
26+
<help>Show IPFIX table</help>
27+
</properties>
28+
<command>sudo ${vyos_op_scripts_dir}/vpp.py show_ipfix_table</command>
29+
</node>
30+
</children>
31+
</node>
32+
</children>
33+
</node>
34+
</children>
35+
</node>
36+
</interfaceDefinition>

python/vyos/vpp/ipfix/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
from .ipfix import IPFIX
2+
3+
__all__ = ['IPFIX']

0 commit comments

Comments
 (0)