在我的freebsd框中:
#uname -rimp 9.1-STABLE amd64 amd64 GENERIC
flow_tools:
> pkg_info -x flow Information for flow-tools-0.68_7: Comment: Suite of tools and library to work with netflow data Description: Tools to capture, replicate, print, filter, send and other works on Cisco's NetFlow Export. WWW: http://www.splintered.net/sw/flow-tools/
收集器是ng_flow,以。开头
/usr/sbin/ngctl mkpeer ipfw: netflow 30 iface0 /usr/sbin/ngctl name ipfw:30 netflow /usr/sbin/ngctl msg netflow: setdlt {iface=0 dlt=12} /usr/sbin/ngctl msg netflow: setifindex {iface=0 index=5} /usr/sbin/ngctl msg netflow: settimeouts {inactive=15 active=150} /usr/sbin/ngctl mkpeer netflow: ksocket export inet/dgram/udp /usr/sbin/ngctl msg netflow:export connect inet/127.0.0.1:9995
和ipfw规则:
02750 59239017674 33111253913522 ngtee 30 ip from any to any via em0
用flow_capture导出flow_fanout。
# ps axww | grep flow 15106 ?? Ss 2:50,08 /usr/local/bin/flow-fanout -p /var/run/flow-capture/flow-fanout.pid 127.0.0.1/0.0.0.0/9995 127.0.0.1/127.0.0.1/9556 16367 ?? Ss 11:28,63 /usr/local/bin/flow-capture -n 95 -N 3 -z 5 -S 5 -E270G -w /var/netflow -p /var/run/flow-capture/flow-capture.pid 127.0.0.1/0.0.0.0/9556
对于我来说不明原因flow_capture在日志中报告:
Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=103.247.29.1 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=116.115.58.13 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=186.85.188.1 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=186.84.72.1 d_ver=5 pkts=2 flows=60 lost=480 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=186.85.212.1 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=190.149.28.1 d_ver=5 pkts=2 flows=60 lost=0 reset=0 filter_drops=0 Mar 27 10:20:00 rubin flow-capture[16367]: STAT: now=1364358000 startup=1364227269 src_ip=127.0.0.1 dst_ip=190.149.4.1 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 .... Mar 27 10:25:00 rubin flow-capture[16367]: STAT: now=1364358300 startup=1364227269 src_ip=127.0.0.1 dst_ip=0.0.0.0 d_ver=5 pkts=8253374 flows=246879659 lost=71012 reset=0 filter_drops=0 .... Mar 27 10:25:28 rubin flow-fanout[15106]: ftpdu_seq_check(): src_ip=127.0.0.1 dst_ip=0.0.0.0 d_version=5 expecting=895162410 received=895162440 lost=30
我无法理解:为什么所有这些都在这里?
我没有像190.149.4.1和186.85.212.1等任何其他configuration。
另外flow_fanout和flow_capture都会占用越来越多的内存。 最后一次,我重新启动这些恶魔之前,这是关于3Gb的内存。
请帮助我与这个奇怪的IPS日志。 我有一些错误的configuration吗? 还是它的一个已知的错误?
UPD:我关于flow_capture日志的问题措辞不佳。 再次尝试:
在其他我的服务器与flow_capture类似的configuration我看到在日志中只有一个logging每15分钟:
Mar 28 08:55:00 flow-capture[45410]: STAT: now=1364439300 startup=1356501324 src_ip=127.0.0.1 dst_ip=127.0.0.1 d_ver=5 pkts=41948436 flows=1256544938 lost=0 reset=0 filter_drops=0
看看dst_ip = 127.0.0.1。
当我用相同的configuration返回到我的第一台服务器时,我在日志中看到
Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=65.121.97.1 d_ver=5 pkts=1 flows=30 lost=0 reset=0 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=255.127.0.0 d_ver=5 pkts=1458 flows=43711 lost=21989 reset=1395 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=109.112.100.32 d_ver=5 pkts=446 flows=13380 lost=15933 reset=401 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=12.79.228.1 d_ver=5 pkts=4 flows=120 lost=0 reset=3 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=105.110.100.44 d_ver=5 pkts=465 flows=13950 lost=16443 reset=411 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=8.0.0.0 d_ver=5 pkts=88 flows=2611 lost=210 reset=85 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=82.111.119.115 d_ver=5 pkts=449 flows=13412 lost=11044 reset=409 filter_drops=0 Mar 28 09:05:00 rubin flow-capture[16367]: STAT: now=1364439900 startup=1364227269 src_ip=127.0.0.1 dst_ip=0.0.0.0 d_ver=5 pkts=14965070 flows=447566910 lost=130355 reset=0 filter_drops=0
看看所有这个dst_ip,例如8.0.0.0。 它看起来像错误或错误configuration。 但我不知道如何解决这个问题。
几年前, BSD下的内存泄漏是0.68 ,但从那以后我不知道是否已经修复。
我注意到你正在使用一个非常大的数字-E标签。 如果你用小得多的东西(比如-E1M)尝试一下,并且内存的占用空间一直在控制之内,那么我会倾向于把内存的使用归咎于那里。
我不确定你在其他问题上的问题。 可能只是针对一个端点为127.0.0.1的所有会话进行匹配?
编辑:我想我明白你现在说的话。 如果是NetFlow v9,我会说有一个可能的模板错误(这可能导致读取结构中错误的字节),但我没有遇到过NetFlow v5。 我认为有四种可能性:
我将使用像Wireshark这样的数据包捕获实用程序来检查NetFlowlogging,并确保它们正确地通过flow_fanout中继,并在命令行上正确报告。 我从来没有像flow_fanout这样的问题,所以我个人会在#3。 有一些自由stream程出口商可以下载运行,并与当前出口商出现的内容进行比较。