如何设置 Juniper EX3300 交换机的接口流量速度?

网络工程 杜松 杜松-朱诺斯 瞻博网络
2022-02-17 16:56:27

如何设置 Juniper EX3300 交换机的接口流量速度?

在问这个问题之前,我尝试了很多方法,都失败了。

首先,设置Interface traffic speed 不是interfaces speed doc,因为这个只能设置10m, 100m, 1g

我想让ge-0/0/0输入和输出可以限制速度到23m.

我的设备是EX3300,如何设置?

现在我的配置是这样的:

防火墙

firewall {
    family ethernet-switching {
        filter lnterface-Police {
            term Police {
                from {
                    source-address {
                        0.0.0.0/0;
                    }
                }
                then policer limit-50m;
            }
            term Permit-ALL-Other {
                then accept;
            }
        }
    }
    policer limit-50m {
        if-exceeding {
            bandwidth-limit 20m;
            burst-size-limit 1500;
        }
        then discard;
    }
}

ge-0/0/5

ge-0/0/5 {
    unit 0 {
        family ethernet-switching {
            filter {
                input lnterface-Police;
                output lnterface-Police;
            }
        }
    }
}

但是当我使用时commit check,出现以下错误:

admin# commit check
[edit interfaces ge-0/0/10 unit 0 family ethernet-switching]
  'filter'
    Referenced filter 'lnterface-Police' can not be used as policer not supported on egress
error: configuration check-out failed
2个回答

您不能在 L2 ACL 中使用 L3/L4 ACL 选项,也不支持 EGRESS 监管。

这里为你工作的例子:

[edit interfaces ge-5/0/46 unit 0 family ethernet-switching]
       filter {
           input interface-police;
       }

[edit firewall]
    family ethernet-switching {
        filter interface-police {
            term limit-50m {
                then policer limit-50m;
            }
        }
    }

[edit firewall]
   policer limit-50m {
       filter-specific;
       if-exceeding {
           bandwidth-limit 50m;
           burst-size-limit 15k;
       }
       then discard;
   }

在这种情况下,policer 只会限制 INGRESS 流量。要限制 EGRESS 流量,请添加此部分:

[edit]
  class-of-service {
      interfaces {
          ge-5/0/46 {
              shaping-rate 50m;
          }
      }
  }

更新

我错了。CoS 仅适用于接口输出,因此应同时应用 CoS 整形和输入监管。

试着塑造你的出口流量——你不能监管它。

添加这个来塑造你的出口流量:

[edit class-of-service interfaces]
ge-0/0/5 {
    shaping-rate 23m;
}

output lnterface-Police;从您的 ge-0/0/5 接口配置中删除。

并尝试再次提交。