导出前记录 M 和 T 系列路由器上的流
要先在导出日志文件中收集 cflowd 流,请将语句local-dump
[edit forwarding-options sampling output flow-server hostname]
包含在层次结构级别:
[edit forwarding-options sampling output flow-server hostname] local-dump;
默认情况下,流收集在 /var/log/sampled 中;以更改文件名,在 filename
层次结构级别包含语句 [edit forwarding-options sampling traceoptions]
。有关更改文件名的更多信息,请参阅 配置流量采样输出。
注意:
由于语句 local-dump
会增加额外开销,因此应仅在调试流式问题时使用,而不是在正常运行期间。
以下是流信息的示例。导出的 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