パソコンで動作するNetFlow/IPFIX センサー (softflowd)
1.2K
LinuxパソコンでパケットキャプチャーしてNetflow/IPFIXのデータを送信できる
softflowdをDocker環境で動作するようにしたコンテナです。
TWSNMP FCのセンサープログラムとして動作します。
元のソースコードは
https://github.com/irino/softflowd
です。スタティックリンクしています。
# docker run --net host -d --rm twsnmp/softflowd -i enp3s0f0 -v 10 -n 127.0.0.1:2055
enp3s0f0がネットワークインターフェース名です。
127.0.0.1:2055 が 送信先のIPアドレスとポート番号です。
-v 10の10がNetFlowのバージョン番号です。
# docker run --net host --rm twsnmp/softflowd -h
Usage: softflowd [options] [bpf_program]
This is softflowd version 1.0.0. Valid commandline options:
-i [idx:]interface Specify interface to listen on
-r pcap_file Specify packet capture file to read
-t timeout=time Specify named timeout
-m max_flows Specify maximum number of flows to track (default 8192)
-n host:port Send Cisco NetFlow(tm)-compatible packets to host:port
-p pidfile Record pid in specified file
(default: /var/run/softflowd.pid)
-c socketfile Location of control socket
(default: /var/run/softflowd.ctl)
-v 1|5|9|10|psamp NetFlow export packet version
10 means IPFIX and psamp means PSAMP (packet sampling)
-L hoplimit Set TTL/hoplimit for export datagrams
-T full|port|proto|ip| Set flow tracking level (default: full)
vlan ("vlan" tracking means "full" tracking with vlanid)
ether ("ether" tracking means "vlan" tracking with ether header)
-6 Track IPv6 flows, regardless of whether selected
NetFlow export protocol supports it
-d Don't daemonise (run in foreground)
-D Debug mode: foreground + verbosity + track v6 flows
-P udp|tcp|sctp Specify transport layer protocol for exporting packets
-A sec|milli|micro|nano Specify absolute time format form exporting records
-s sampling_rate Specify periodical sampling rate (denominator)
-B bytes Libpcap buffer size in bytes
-b Bidirectional mode in IPFIX (-b work with -v 10)
-a Adjusting time for reading pcap file (-a work with -r)
-C capture_length Specify length for packet capture (snaplen)
-l Load balancing mode for multiple destinations
-R receive_port Specify port number for PSAMP receive mode
-N Disable promiscuous mode
-S send_interface_name Specify send interface name
-h Display this help
Valid timeout names and default values:
tcp (default 3600) tcp.rst (default 120) tcp.fin (default 300)
udp (default 300) icmp (default 300) general (default 3600)
maxlife (default 604800) expint (default 60)
Content type
Image
Digest
Size
968.4 kB
Last updated
about 5 years ago
Requires Docker Desktop 4.37.1 or later.