Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

header-navigation
keyboard_arrow_up
close
keyboard_arrow_left
list Table of Contents
file_download PDF
{ "lLangCode": "en", "lName": "English", "lCountryCode": "us", "transcode": "en_US" }
English
keyboard_arrow_right

Configuring Policers Based on Logical Interface Bandwidth

date_range 29-Nov-23

When you configure a policer as a percentage (using the bandwidth-percent statement), the bandwidth is calculated as a percentage of either the physical interface media rate or the logical interface shaping rate.

  • To specify that the bandwidth be calculated based on the logical interface shaping rate and not the physical interface media rate, set the logical-bandwidth-policer option at the [edit firewall] hierarchy level. Next,, specify the shaping-rate for the logical interfaces under the [edit class-of-service] hierarchy level and apply the policer to the logical interfaces..

  • If a shaping rate is not configured for the logical interface, the physical interface media rate is used, even if you include the logical-bandwidth-policer. You can configure the shaping rate on the logical interface using class-of-service statements.

The following example configures and applies a logical bandwidth policer rate to two logical interfaces on interface ge-0/2/7. The policed rate on unit 0 is 2 Mbps (50 percent of 4 Mbps) and the policed rate on unit 1 is 1 Mbps (50 percent of 2 Mbps).

To configure and apply this policer:

  1. Create and configure the policer.
    1. Create the policer.

      content_copy zoom_out_map
      [edit]
      user@host# edit firewall policer Logical_Policer
      
    2. Specify that the policer is based on the shaping rate of the logical interface.

      content_copy zoom_out_map
      [edit firewall policer Logical_Policer]
      user@host# set logical-bandwidth-policer
      
    3. Configure the rate limits for the policer.

      content_copy zoom_out_map
      [edit firewall policer Logical_Policer]
      user@host# set if-exceeding bandwidth-limit 50
      user@host# set burst-size-limit 125k
      
    4. Configure the policer to discard packets that exceed the specified rate limits.

      content_copy zoom_out_map
      [edit firewall policer Logical_Policer]
      user@host# set then discard
      
  2. Specify the shaping-rate for each logical interface.
    content_copy zoom_out_map
    {edit}
    user@host# edit class-of-service interfaces ge-0/2/7
    user@host# set unit 0 shaping-rate 4m
    user@host# set unit 1 shaping-rate 2m
    
  3. Apply the policer to the logical interfaces.
    • Enable scheduling on logical interfaces.

      content_copy zoom_out_map
      [edit]
      user@host# edit interfaces ge-0/2/7
      user@host# set per-unit-scheduler
      
    • Enable the reception and transmission of 802.1Q VLAN-tagged frames on the interface.

      content_copy zoom_out_map
      [edit interfaces ge-0/2/7]
      user@host# set vlan-tagging
      
    • Apply the policer to the first logical interface.

      content_copy zoom_out_map
      [edit interfaces ge-0/2/7]
      user@host# set unit 0 vlan-id 100 family inet policer input Logical_Policer
      user@host# set unit 0 vlan-id 100 family inet policer output Logical_Policer
      user@host# set unit 0 vlan-id 100 family inet address 172.16.1.1/30
      
    • Apply the policer to the second logical interface.

      content_copy zoom_out_map
      [edit interfaces ge-0/2/7]
      user@host# set unit 1 vlan-id 200 family inet policer input Logical_Policer
      user@host# set unit 1 vlan-id 200 family inet policer output Logical_Policer
      user@host# set unit 1 vlan-id 200 family inet address 172.26.1.1/30
      
  4. Confirm your configuration.
    content_copy zoom_out_map
    [edit]
    user@host# show firewall
    
    content_copy zoom_out_map
    policer Logical_Policer {
        logical-bandwidth-policer;
        if-exceeding {
            bandwidth-percent 50;
            burst-size-limit 125k;
        }
        then discard;
    }
    
    content_copy zoom_out_map
    [edit]
    user@host# show class-of-service interfaces ge-0/2/7
    
    content_copy zoom_out_map
    unit 0 {
        shaping-rate 4m;
    }
    unit 1 {
        shaping-rate 2m;
    }
    
    content_copy zoom_out_map
    [edit]
    user@host# show interfaces ge-0/2/7
    
    content_copy zoom_out_map
    per-unit-scheduler;
    vlan-tagging;
    unit 0 {
        vlan-id 100;
        family inet {
            policer {
                input Logical_Policer;
                output Logical_Policer;
            }
            address 172.16.1.1/30;
        }
    }
    unit 1 {
        vlan-id 200;
        family inet {
            policer {
                input Logical_Policer;
                output Logical_Policer;
            }
            address 172.26.1.1/30;
        }
    }
    
  5. Save the configuration.
    content_copy zoom_out_map
    [edit]
    user@host# commit
    
footer-navigation