在 Vyatta 路由器上配置流量导出
对于 NetFlow 分析,您需要配置设备将流量数据导出到 Site24x7 本地轮询器(即 NetFlow 采集器)。本地轮询器将监听特定端口以接收流量数据。了解如何查找本地轮询器的端口号。
请按照以下步骤在 Vyatta 路由器上配置 NetFlow 导出:
- 设置 NetFlow 版本。
set system flow-accounting netflow version 9
- 要将流量数据导出到 Site24x7,请提供 IP 地址(安装了 Site24x7 本地轮询器的机器的 IP)作为流量目标地址,以及其监听端口。
示例:set system flow-accounting netflow server 192.168.0.1 port 9996set system flow-accounting netflow server <NFA server IP> port <Port #>
- 对每个要监控的接口执行以下命令:
示例:set system flow-accounting interface eth0set system flow-accounting interface <interface name>
- 将活跃流量超时设置为 1 分钟。默认情况下,该值已设置为 1 分钟或 60 秒。
set system flow-accounting netflow timeout expiry-interval 60
- 在对所有接收数据包进行统计时,Vyatta 流量统计功能可能会消耗大量资源。另一种方法是开启采样,每 N 个数据包中统计 1 个,N 为采样率。
示例:set system flow-accounting netflow sampling-rate 500set system flow-accounting netflow sampling-rate N
- 使用以下命令设置其他必要的 Vyatta 流量统计参数:
set system flow-accounting netflow engine-id id (id values range between 0 – 255)
set system flow-accounting netflow timeout max-active-life 604800
set system flow-accounting netflow timeout flow-generic 3600
set system flow-accounting netflow timeout tcp-fin 300
set system flow-accounting netflow timeout tcp-generic 3600
set system flow-accounting netflow timeout tcp-rst 120
set system flow-accounting netflow timeout icmp 300
set system flow-accounting netflow timeout udp 300
NetFlow 配置
system {
flow-accounting {
interface <ifname> { // Please apply this on all active interface
netflow {
version 9 # Can use 5 or 9
engine-id <u32> # 0-255
server <Collector IP> {
port 9996 # user configurable}
timeout {
expiry-interval 60
flow-generic 3600
icmp 300
max-active-life 604800
tcp-fin 300
tcp-generic 3600
tcp-rst 120
udp 300
}
}}
}
sFlow 配置
system {
flow-accounting {
sflow {
agentid <u32>
server 192.168.1.1 {
port 9996
}
}
-
本页内容
- NetFlow 配置
- sFlow 配置
