导出前在 M 和 T Series 路由器上记录 cflowd 流
要在导出 cflowd 流之前将其收集到日志文件中,请在[edit forwarding-options sampling output flow-server hostname]层次结构级别包含以下local-dump语句:
[edit forwarding-options sampling output flow-server hostname] local-dump;
默认情况收集在 /var/log/sampled 中;要更改文件名,请在[edit forwarding-options sampling traceoptions]层次结构级别包含filename语句。有关更改文件名的更多信息,请参阅配置流量采样输出。
注意:
由于该 local-dump 语句会增加额外的开销,因此应仅在调试 cflowd 问题时使用它,而不应在正常作期间使用它。
以下是流信息的示例。导出的 AS 编号是源 AS 编号。属于 cflowd 标头下的所有流都将转储,后跟标头本身:
Jun 27 18:35:43 v5 flow entry Jun 27 18:35:43 Src addr: 192.0.2.1 Jun 27 18:35:43 Dst addr: 198.51.100.15 Jun 27 18:35:43 Nhop addr: 198.51.100.240 Jun 27 18:35:43 Input interface: 5 Jun 27 18:35:43 Output interface: 3 Jun 27 18:35:43 Pkts in flow: 15 Jun 27 18:35:43 Bytes in flow: 600 Jun 27 18:35:43 Start time of flow: 7230 Jun 27 18:35:43 End time of flow: 7271 Jun 27 18:35:43 Src port: 26629 Jun 27 18:35:43 Dst port: 179 Jun 27 18:35:43 TCP flags: 0x10 Jun 27 18:35:43 IP proto num: 6 Jun 27 18:35:43 TOS: 0xc0 Jun 27 18:35:43 Src AS: 7018 Jun 27 18:35:43 Dst AS: 11111 Jun 27 18:35:43 Src netmask len: 16 Jun 27 18:35:43 Dst netmask len: 0
[...另外 41 个版本 5 流条目;然后是以下标题:]
Jun 27 18:35:43 cflowd header: Jun 27 18:35:43 Num-records: 42 Jun 27 18:35:43 Version: 5 Jun 27 18:35:43 low seq num: 118 Jun 27 18:35:43 Engine id: 0 Jun 27 18:35:43 Engine type: 3