使用模板配置 M、MX 和 T Series 路由器以进行丢弃计费
基于 RFC 3954 的流监控版本 9 提供了一种将流数据组织到模板中的方法。版本 9 还提供了一种主动监控 IPv4、IPv6、MPLS 和对等方 AS 计费流量的方法。AS-I PIC 不支持版本 9。
要在流监控中激活模板,您必须配置一个模板,并将该模板包含在版本 9 的流监控配置中。版本 9 不能与版本 5 和 8 一起使用。
要配置版本 9 模板,请在层次结构级别包含 template template-name 语句 [edit services flow-monitoring version9]。Junos OS 支持五种不同的模板: ipv4-template、 ipv6-template、 mpls-template、 mpls-ipv4-template 和 peer-as-billing-template。要查看在每个模板中选择的字段,请参阅 流监控版本 9 格式输出字段。
[edit services]
flow-monitoring {
version9 { # Specifies flow monitoring version 9.
template mpls { # Specifies template you are configuring.
template-refresh-rate {
packets 6000; # The default is 4800 packets and the range is 1–480000 packets.
seconds 90; # The default is 60 seconds and the range is 1–600 seconds.
}
option--refresh-rate {
packets 3000; # The default is 4800 packets and the range is 1–480000 # packets.
seconds 30; # The default is 60 seconds and the range is 1–600.
}
flow-active-timeout 60; # The default is 60 seconds and the range is # 10–600.
flow-inactive-timeout 30; # The default is 60 seconds and the range 10–600.
template-refresh-rate seconds 10; # The default is 600 seconds and the # range is 10–600
mpls-template {
label-positions [1 | 2 | 3]; # Specifies label position for the MPLS template.
}
}
}
一次可以导出到多个模板,最多可导出到 8 台用于 AS PIC 的流服务器,以及一台用于所有其他 PIC 的流服务器。要将模板分配给流输出,请在[edit forwarding options sampling output flow-server version9] 层次结构级别包含以下template template-name语句:
[edit]
forwarding-options {
sampling {
input {
family mpls {
rate 1;
run-length 1;
}
}
output {
flow-server 10.60.2.1 { # The IP address and port of the flow server.
port 2055;
source-address 192.0.2.1;
version9 { # Records are sent to the flow server using version 9 format.
template { # Indicates a template will organize records.
mpls; # Records are sent to the MPLS template.
}
}
}
}
}
}