如果由防火墙过滤器设置,如何验证 Junos 中的流量转发类?

网络工程 杜松 服务质量
2022-02-11 01:21:46

assured-forwarding我有一个防火墙过滤器,如果不超过带宽阈值,它会将 ICMP 流量分类:

root@vmx> show configuration firewall filter example | display inheritance no-comments 
term policer-example {
    from {
        protocol icmp;
    }
    then {
        policer class-example;
        forwarding-class assured-forwarding;
        accept;
    }
}

root@vmx> show configuration firewall policer class-example | display inheritance no-comments
if-exceeding {
    bandwidth-limit 8k;
    burst-size-limit 1500;
}
then forwarding-class best-effort;

root@vmx> 

命名的防火墙过滤器example设置在ge-0/0/2接口的入口方向,我正在生成通过ge-0/0/2接口进入转发平面的传输流量(ICMP 消息)。

如何确定我的流量是否最终进入assured-forwardingbest-effort上课?DSCP 值始终为 0(十进制),类似的命令show interfaces forwarding-class-counters什么也不显示:

root@vmx> show interfaces forwarding-class-counters    

root@vmx> show interfaces forwarding-class-counters ge-0/0/2    
  Logical interface ge-0/0/2.0 (Index 343) (SNMP ifIndex 543)
      Forwarding-class statistics are not applicable to this interface.

root@vmx> 
1个回答

要查看每个转发类的队列计数器,您必须使用命令

show interfaces xe-0/0/0 extensive | find "Queue counters" 

R1>show interfaces xe-0/0/0 extensive | find "Queue counters"   
  Queue counters:       Queued packets  Transmitted packets      Dropped packets
    0                       3670800337           3670800337                    0
    1                        200104217            200104217                    0
    2                         20410753             20410753                    0
    3                         27381361             27381361                    0
    4                           381678               381678                    0
    5                        399632152            399632152                    0
    6                         62819593             62819593                    0
  Queue number:         Mapped forwarding classes
    0                   best-effort
    1                   business
    2                   Video_on_Demand
    3                   Multicast
    4                   infrastructure-traffic
    5                   VoIP
    6                   Network_Control
  Active alarms  : None
  Active defects : None

这将列出在拥塞情况下已排队、传输和丢弃的数据包数量。

我们需要记住 CoS 是一种出口现象 在我们的例子中,流量通过路由器 R1 的接口 xe-0/0/0 进入网络。因此,要检查队列计数器,我们需要在 xe-0/0/0 上运行上述命令来检查队列统计信息并验证传入的数据包在将它们转发出出口接口之前是否放置在相应的队列中,即 xe-2/0/1 用于例子。

对于您的下一个查询,为什么您的 DSCP 值始终为 0 ,我认为监管器“类示例”操作正在尽最大努力将数据包放入。因此,在 junos 使用术语“保证转发”之前,数据包已经尽了最大努力。

您可以尝试以下配置:-

root@vmx> show configuration firewall filter example | display inheritance no-comments 
term policer-example {
    from {
        protocol icmp;
    }
    then {
        policer class-example;
        forwarding-class assured-forwarding;
        accept;
    }
}

root@vmx> show configuration firewall policer class-example | display inheritance no-comments
if-exceeding {
    bandwidth-limit 8k;
    burst-size-limit 1500;
}
then accept;