cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
5583
Views
0
Helpful
10
Replies

Bandwidth limit in Cisco switch

mohamed.ali
Level 1
Level 1

Dears, 

we need your support to limit switch interface to consume up to 700 Kbps up and down.

 

 

 

BR

10 Replies 10

Francesco Molino
VIP Alumni
VIP Alumni
Hi

You want to limit the bandwidth for all traffic, you can use police command like:

policy-map LIMIT
class class-default
police 700k
!

And apply that policy-map to your interface:

interface g0/0
service-policy input LIMIT
service-policy output LIMIT


Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

Joseph W. Doherty
Hall of Fame
Hall of Fame
If your switch supports port ingress/egress policing, it should be doable.

(BTW, it often helps if you would note your exact switch model and what IOS it's running.)

3560 My switch model and i have a old version .
can u provide me with general config ?

The 3560 doesn't support defining egress policies, but it does ingress, e.g.:

ip access-list extended QOS-ACL-ANY
 permit ip any any


class-map match-any QOS-CLASS-EF
match ip dscp ef

class-map match-all QOS-CLASS-ANY
 match access-group name QOS-ACL-ANY


policy-map QOS-POLICY
class QOS-CLASS-EF
police 320000 8000 exceed-action policed-dscp-transmit
class QOS-CLASS-ANY
set dscp default

interface x
service-policy input QOS-POLICY

not working dear :(

What's not working?
Which config did you apply?

As Joseph mentioned, on your platform only inbound policing can be done, then your config should look like something like:

ip access-list extended ALL-TRAFFIC
permit ip any any
!
class-map match-all TRAFFIC
match access-group name ALL-TRAFFIC
!
policy-map LIMIT
class TRAFFIC
police 700000 8000 exceed-action drop
!
interface X
service-policy input LIMIT

For outbound, you can use the command srr-queue bandwidth limit.
But with this command the minimum you can allow for traffic will be 10Mb if we calculate the ratio on a 100Mb port. Here a documentation for that command: https://www.cisco.com/c/en/us/td/docs/switches/lan/catalyst3750/software/release/12-2_52_se/configuration/guide/3750scg/swqos.html

Now a quick question, what is your use case to limit a port on a switch to 700k ?



Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

"For outbound, you can use the command srr-queue bandwidth limit."

Ah, good you mentioned this. Do note, it shapes, not polices, but a shaper can limit traffic too. Also, it impacts all traffic on the port, i.e. you cannot use it selectively against just some traffic.  Also shaping value's application is inexact.

Also on the subject of shaping, if you enable QoS you can also shape a port's egress queues.

I proposed this command for outbound as he said we wanted to limit the bandwidth no matter if this is done by policing or shaping.
The only thing is he wouldn't be able to limit bandwidth for 700k with this command.

My concern is about the use case to limit to 700k the traffic on the switch port. Maybe, based on the use case, the limitation could be done on the upstream layer by filtering the traffic with an acl and applying some policing on it.

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question

"I proposed this command for outbound as he said we wanted to limit the bandwidth no matter if this is done by policing or shaping. "

Yes, and for such, yours is a good suggestion!

"The only thing is he wouldn't be able to limit bandwidth for 700k with this command.

My concern is about the use case to limit to 700k the traffic on the switch port."

Well, if the port was running at 10 Mbps, you could come close.

BTW (to OP), if shaping egress queues, I recall, it doesn't suffer from the same limitations as shaping the port.

"BTW (to OP), if shaping egress queues, I recall, it doesn't suffer from the same limitations as shaping the port."

You recall correctly :-)

If it's a 10Mbps port, yes we will be close :-)

Thanks
Francesco
PS: Please don't forget to rate and select as validated answer if this answered your question