在华为设备上配置流量导出
若要进行 NetFlow 分析,您需要将设备配置为向 Site24x7 本地轮询器(即 NetFlow 采集器)导出流量数据。本地轮询器将监听特定端口以接收流量数据。了解如何查找本地轮询器的端口号。
sFlow 配置
使用以下命令在华为设备上配置 sFlow:
-
配置 sFlow Agent IP
sFlow Agent IP 是设备用于向采集器导出流量数据的 IP 地址。sflow
sflow agent ipcommit -
配置 sFlow 采集器
设置 sFlow 采集器(Site24x7 本地轮询器)的 IP 地址并提交更改。sflow collector 1 commit
sflow server ipcommit quit quit -
在指定槽位上启用 sFlow
在将监控流量的相关槽位上激活 sFlow。
slot 4
sflow enable
commit
quit -
配置流量采样
定义 sFlow 在特定接口上对数据包进行采样的频率。
interface GigabitEthernet 0/1/3
sflow flow-sampling collector 1 inbound
commit
sflow flow-sampling rate 2000 inbound
commit
quit - 验证 sFlow 配置
运行以下命令验证 sFlow 配置是否正确。
更多详情,请参阅华为官方文档。display sflow configuration
NetStream 配置
- 配置 NTP 服务器
通过配置 NTP 服务器确保设备间的时间同步。
此操作将 NetStream 导出数据发送至指定 IP 地址。请指定安装了 Site24x7 本地轮询器的机器的 IP 地址及配置的监听端口,默认端口为 9996。ntp-service server disable
ntp-service ipv6 server disable
ntp-service unicast-peerntp-service unicast-peer - 配置用于导出流量信息的槽位
指定导出流量数据的槽位。如有不同,请将"3"替换为实际的槽位编号。
slot 3 (Replace "3" with your actual slot number if different.)
ip netstream sampler to slot self
ipv6 netstream sampler to slot self - 配置 NetStream 导出设置
设置 NetStream 导出参数,包括版本、源 IP 和目标主机 IP。
ip netstream timeout active 1
ip netstream timeout inactive 15
ip netstream export version 9
ip netstream export index-switch 32
ip netstream export template timeout-rate 1
ip netstream sampler fix-packets 500 inbound
ip netstream sampler fix-packets 500 outbound
ip netstream export sourceip netstream export host 2055 ip netstream export template option sampler ip netstream export template option timeout-rate 1 ip netstream as-mode 32 ipv6 netstream as-mode 32 ipv6 netstream timeout active 1 ipv6 netstream timeout inactive 15 ipv6 netstream export version 9 ipv6 netstream export index-switch 32 ipv6 netstream export template timeout-rate 1 ipv6 netstream sampler fix-packets 500 inbound ipv6 netstream sampler fix-packets 500 outbound ipv6 netstream export source ipv6 netstream export host 2055 ipv6 netstream export template option sampler ipv6 netstream export template option timeout-rate 1 ipv6 netstream as-mode 32 - 在接口上启用 NetFlow
在将导出流量数据的接口上启用 NetFlow。
ip netstream inbound
ipv6 netstream inbound更多详情,请参阅华为官方文档。
-
本页内容
- sFlow 配置
- NetStream 配置
