NetFlow 基于流缓存,按五元组、接口、ToS 等字段聚合;v5 固定格式,v9 使用模板,IPFIX 是 IETF 标准(RFC 7011)。sFlow 按报文采样并上报接口计数,不维护完整流缓存。采样率 1:1000 表示每 1000 个包采一个,统计值要乘以采样率估算,采样越稀误差越大。NetFlow 适合流量明细,sFlow 更适合高速接口的统计抽样。
在高流量接口开启流统计会增加 CPU、内存和上报带宽;采样和缓存超时会影响结果精度。先在低峰和单个接口验证,确认采集器可达后再推广;回滚是移除接口下的 flow monitor/netstream/sampling 配置。导出源地址、VRF、时间同步和采集器容量都要提前规划。
Cisco IOS-XE(Flexible NetFlow)
flow record FLOW-V4
match ipv4 source address
match ipv4 destination address
match transport source-port
match transport destination-port
collect counter bytes long
collect counter packets long
flow exporter EXP-1
destination 192.0.2.50
transport udp 2055
flow monitor MON-1
record FLOW-V4
exporter EXP-1
interface GigabitEthernet0/1
ip flow monitor MON-1 input
show flow monitor MON-1 cache format table
Huawei VRP / H3C Comware(NetStream)
ip netstream export host 192.0.2.50 2055
ip netstream export version 9
interface GigabitEthernet0/0/1
ip netstream inbound
display ip netstream cache
Junos 用 forwarding-options sampling 配置采样和 flow-server,或在支持平台使用 inline flow monitoring;接口下引用 sampling input。不同平台对 NetFlow v9/IPFIX、采样和模板刷新支持不同,以设备版本为准。
合上页面,先回答,再展开对照。
小程序版
微信扫码,随时查命令