当前位置: 首页 >> 榆树网-网络 >> 文章正文

IP 流量统计排行榜 ( netflow TopN ) 简易速成法

安装 /usr/ports/net-mgmt/flow-tools 后在 /etc/rc.conf 加入如下设定:flow_capture_enable=”YES”
flow_capture_datadir=”Directory
flow_capture_remoteip=”192.168.1.1
flow_capture_port=”9991
flow_capture_flags=”-e 1440 -N 0 -n 143 -z 6
可用内建指令做各种 netflow TopN 统计:底下以县网为例,因县网有二个 Interface 对外 ( 编号 83,93 ) ,各是 1G 线路,因此做 TopN 的指令如下:
单位内下载量排行榜
flow-cat netflow-rawfile | flow-filter -i83,93 | flow-stat -f8 -S2
单位内下载封包数排行榜
flow-cat netflow-rawfile | flow-filter -i83,93 | flow-stat -f8 -S3
单位内上传量排行榜
flow-cat netflow-rawfile | flow-filter -I83,93 | flow-stat -f9 -S2
单位内上传封包数排行榜
flow-cat netflow-rawfile | flow-filter -I83,93 | flow-stat -f9 -S3
所有 IP ( 含外部 ) 总传输量排行榜
flow-cat netflow-rawfile | flow-stat -f11 -S2 | more
所有 IP ( 含外部 ) 总封包数排行榜
flow-cat netflow-rawfile | flow-stat -f11 -S3 | more
IP 封包类型统计 ( 含外部 )
flow-cat netflow-rawfile | flow-stat -f12 -s0
看详细 netflow 内容 ( n 请换成 0 … 24 显示格式 )
flow-print -fn < netflow-rawfile
netflow 工具列表:
flow-capture
flow-cat
flow-dscan
flow-expire
flow-export
flow-fanout
flow-filter
flow-gen
flow-header
flow-import
flow-log2rrd
flow-mask
flow-merge
flow-nfilter
flow-print
flow-receive
flow-report
flow-rpt2rrd
flow-rptfmt
flow-send
flow-split
flow-stat
flow-tag
flow-xlate
PS: 自行替换斜体字。

相关文章

发表评论