You may need to limit bandwidth, perhaps for a customer, or for an area of your network to avoid issues that occur when they saturate links, knowingly or unknowingly.
In this example we’ll create a 20MBit Limit with a 250Kb burst, and we’ll make the switch drop anything that exceeds that limit. So in effect the VLAN that we’re applying to will be limited to 20Mbit of download and upgrade (ingress and egress) depending on how you look at it.
Configuration
You need to perform three main steps:
- Create the Meter, specifying the limits.
- Create the Policy, specifying the matching criteria and meter.
- Apply the Policy to the required ports, either as Ingress or Egress or both.
Step 1 – Create the Meter
Create the meter with the required limits.
create meter Customer20G
configure meter Customer20G committed-rate 2 Gbps max-burst-size 250 Kb out-actions drop
Step 2 – Create Bandwidth Policy
Create the Bandwidth Limit policy file. You don’t need one per tenant, you can coexist many in a single file.
vi LimitBandwidth.pol
Create the entry with the matching criteria.
entry Custerom20G {
if match all {
vlan-id 4077;
}
then {
meter Customer20G;
}
}
Step 3 – Apply the Policy
Apply the policy to the port to start the bandwidth trottling.
configure access-list LimitBandwidth ports 40 ingress
configure access-list LimitBandwidth ports 40 egress
Monitor Metering
To see it in action:
show access-list meter "Customer20G" port 40 ingress
switch1.1 # show access-list meter "Customer20G" port 40 ingress
Policy Name Vlan Name Port
Committed Max Burst Out-of-Profile Out-of-Profile
Meter Rate (Kbps) Size (K) Action DSCP Packet Count
===============================================================================
LimitBandwidth * 40
Customer20G 2000000 250000 Drop 675022569