AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题 / 491690
Accepted
Korjavin Ivan
Korjavin Ivan
Asked: 2013-03-27 20:31:47 +0800 CST2013-03-27 20:31:47 +0800 CST 2013-03-27 20:31:47 +0800 CST

flow_fanout flow_capture 中的内存泄漏。flow_capture 输出中的奇怪 ip

  • 772

在我的 freebsd 盒子上:

#uname -rimp
9.1-STABLE amd64 amd64 GENERIC

流程工具:

> 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

我不明白:为什么所有这些 ips 都在这里?

我没有任何关于 190.149.4.1 和 186.85.212.1 等 ip 的配置。

此外,flow_fanout 和 flow_capture 都占用越来越多的内存。上次在我重新启动那些恶魔之前,它大约有 3Gb 的内存。

请帮助我处理日志中的这个奇怪的 ips。我配置有误吗?或者它是一个已知的错误?

UPD:我关于 flow_capture 日志的问题措辞不当。再试一次:

在我的其他服务器上,关于 flow_capture 的配置类似,我在日志中看到每 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。

当我返回到具有相同配置的第一台服务器时,我在日志中看到

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。它看起来像错误或配置错误。但我不知道如何解决。

freebsd
  • 1 1 个回答
  • 280 Views

1 个回答

  • Voted
  1. Best Answer
    John Murphy
    2013-03-28T17:36:58+08:002013-03-28T17:36:58+08:00

    几年前,有人抱怨 BSD 在 0.68 下存在内存泄漏,但我不知道从那时起它们是否得到修复。

    我确实注意到您使用的 -E 标签数量非常大。如果您尝试使用更小的东西(例如,-E1M)并且内存占用量保持在控制之下,我倾向于将内存使用归咎于此。

    我不确定你在另一个问题中问的是什么。它可能只是匹配一个端点为 127.0.0.1 的所有会话吗?

    编辑:我想我现在明白你在说什么了。如果它是 NetFlow v9,我会说可能存在模板错误(这可能导致从结构中读取错误的字节),但我还没有遇到 NetFlow v5。我认为有四种可能:

    1. flow_capture 误报了它收到的信息
    2. flow_fanout 以某种方式破坏了它中继的流
    3. 您的 NetFlow 导出器首先误报了流量
    4. 您的网络上有某种(恶意的?)应用程序会打开与随机 IP 地址的会话。

    我会使用像 Wireshark 这样的数据包捕获实用程序来检查 NetFlow 记录,并确保它们被 flow_fanout 正确中继并在命令行上正确报告。不过,我从来没有遇到过 flow_fanout 这样的问题,所以我个人会看 #3。您可以下载许多免费的流量导出器,与它们一起运行并与当前导出器输出的内容进行比较。

    • 1

相关问题

  • Mono 2.4 Ahead-Of-Time (AOT) 可以在 FreeBSD x86(或 x64)上编译吗?

  • FreeBSD 和 Linux 有什么区别?[关闭]

  • 在 FreeBSD 上安装和运行 MySql

  • 在 freeBSD 上安装 netbeans 的问题

  • 用于 Web 应用服务器的 FreeBSD 磁盘分区(Apache/MySQL/PHP)

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve