配置 jflow v5 报错:interface-name: 'xxx': Must be a services interface

网络工程 杜松 瞻博网络 净流
2022-02-11 01:26:06

朋友们:

当我在 MX-480 上配置 jflow v5 时:

=====

admin@USA-MX-RE0# show forwarding-options sampling    
instance {
    MONITOR-FLOW {
        input {
            rate 1000;
        }
        family inet {
            output {
                ##
                ## Warning: Output 'interface' or 'inline Jflow' should be configured with flow-server
                ##
                flow-server 23.224.24.253 {
                    port 50001;
                    source-address 23.224.24.1;
                    version 5;
                }
            }
        }
    }
}

{master}[edit]
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface lo0.0 
error: interface-name: 'lo0.0': Must be a services interface
error: statement creation failed: interface

{master}[edit]
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface lo0      
error: interface-name: 'lo0': Must be a services interface
error: statement creation failed: interface

{master}[edit]
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface ae17.10 
error: interface-name: 'ae17.10': Must be a services interface
error: statement creation failed: interface

{master}[edit]
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface fp         
                                                                                                    ^
invalid interface type in 'fp' at 'fp'
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface fpc         
                                                                                                    ^
invalid interface type in 'fpc' at 'fpc'
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface fpc0   
                                                                                                    ^
invalid interface type in 'fpc0' at 'fpc0'

{master}[edit]
admin@USA-MX-RE0# set forwarding-options sampling instance MONITOR-FLOW family inet output interface ?      
Possible completions:
  <interface-name>     Interfaces used to send monitored information
{master}[edit]


====

I don't know which interface should configure in there.

===

我的其他配置:

admin@USA-MX-RE0# show services flow-monitoring 
version-ipfix {
    template TEMPLATE-PRTG-IPV4 {
        flow-active-timeout 300;
        flow-inactive-timeout 300;
        template-refresh-rate {
            packets 1000;
            seconds 10;
        }
        option-refresh-rate {
            packets 1000;
            seconds 10;
        }
        ipv4-template;
    }
}

{master}[edit]

admin@USA-MX-RE0# show chassis fpc 0 
pic 0 {
    tunnel-services {
        bandwidth 1g;
    }
}
sampling-instance MONITOR-FLOW;
inline-services {
    flow-table-size {
        ipv4-flow-table-size 8;
    }
}

{master}[edit]
1个回答

首先,了解 NetFlow(J-Flow 到 Juniper)的各种风格及其局限性非常重要。

  • 基于 RE 的采样:这适用于 J-Flow v5/v8。顾名思义,RE 完成了这项工作。当采样的数据包进入/离开接口时,数据包被复制到 RE 进行处理和导出。RE 本身执行此操作时存在缩放/硬件限制,Juniper 不建议超过 1:1000 数据包速率,并且最大可达到 7000 pps。基于 RE 的采样仅支持 IPv4 流量。

  • 基于 PIC 的采样:类似于基于 RE 的采样,但没有严格限制,但需要专门的硬件。

  • 内联采样:这适用于 v9/IPFIX。FPC/PFE 代替 RE 或服务 PIC 完成工作。这更容易扩展,并且使用更新的格式,提供更多选项。

您可以混合使用某些选项,但有一些限制。如果需要,我不确定您是否在配置中引用了 IPFIX,或者只是为了让 v5 正常工作。如果需要它而不是/除此之外,我会更新我的答案,但现在,你问的是 v5,所以我会坚持 v5。

我不知道应该在那里配置哪个接口。

在此配置中您不需要接口。指定接口意味着您要进行基于服务 PIC 的采样,这需要专门的硬件。

至于您的“其他配置”,您不需要 FPC 或模板上的采样实例。

基于 RE 的采样配置

防火墙过滤器

如果您还没有,则需要在要采样流量的接口上安装防火墙过滤器。您需要将过滤器添加为带有family inet filter input SAMPLE. 指定您想要的任何匹配条件(如果有)。

firewall {
    filter SAMPLE {
        term INET {
            then {
                sample;
                accept;
            }
        }
    }
}

转发选项(采样)

显然根据需要更改任何采样率。

forwarding-options {
    sampling {
        input {
            rate 1000;
            run-length 1;
            max-packets-per-second 7000;
        }
        family inet {
            output {
                flow-inactive-timeout 15;
                flow-active-timeout 60;
                flow-server 23.224.24.253 {
                    port 50001;
                    source-address 23.224.24.1;
                    version 5;
                }
            }
        }
    }
}