Juniper – How to Set Juniper EX3300 Switch’s Interface Traffic Speed

juniperjuniper-exjuniper-junos

How can I set the Juniper EX3300 Switch's Interface traffic speed?

Before asking this question I have attempted many methods, all fail.

first of all, set the Interface traffic speed is not the interfaces speed doc, because this only can set 10m, 100m, 1g.

I want to let the ge-0/0/0 input and output can limit speed to 23m.

My device is EX3300, how can I set it?

Now my configurations is this:

firewall

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;
            }
        }
    }
}

but when I use commit check, there gets bellow error:

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

Best Answer

You cannot use L3/L4 ACL options in L2 ACL's, and also EGRESS policing is not supported.

Here working example for you:

[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;
   }

In this case policer will only limit INGRESS traffic. To limit also EGRESS traffic add this section:

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

Update

I was wrong. CoS applied only for interface output, so CoS shaping and input policing should be both applied.