第一种方式:QOS

QOS为物理端口限速

1
2
3
4
5
6
7
8
9
1.先进入端口模式
interface GigabitEthernet 0/0/32
2.输入命令
qos lr inbound cir 10240 cbs 1280000 \\限制服务器上传,限制速度为10M
qos lr outbound cir 10240 cbs 1280000 \\限制服务器下载,限制速度为10M
第一个数值为速度 10240Kbps
建议cbs=200cir
删除为undo qos lr inbound

第二种方式:traffic-limit

此方式为IP限速

1.先创建一个acl 规则允许任何IP访问

1
2
acl 2000
rule 5 permit source any

2.输入命令

1
2
3
traffic-limit inbound acl 2000 cir 102400       \\限制服务器上传,限制速度为10M
traffic-limit outbound acl 2000 cir 10240 \\限制服务器下载,限制速度为10M
删除为undo traffic-limit inbound acl 2000

CIR(Committed Information Rate,承诺信息速率)

每秒可通过的速率,计量单位为Kbps (以bit 位为单位)。如设置为500Kbps 。每8bit位=1Byte 1Kbps=1024bit

CBS(Committed Burst Size):

承诺突发尺寸,令牌桶的容量,即每次突发所允许的最大的流量尺寸。设置的突发尺寸必须大于最大报文长度。计量单位为byte(字节)。

CBS = 200 * CIR = 200 * 2048 = 409600