rate-limit详解

 1. 在全局模式下开启cef:
    Router(config)#ip cef    cef(cisco express forwarding,cisco特快交换)

    2. 定义标准或者扩展访问列表:

    Router(config)#access-list 2 permit 192.168.6.0 0.0.0.255

    3. 在希望限制的端口上进行rate-limit:

    Rounter(config-if)#rate-limit output access-group 2 128000 16000 16000 conform-action transmit exceed-action drop

rate-limit的命令格式:
    #rate-limit {input|output} [access-group number] bps burst-normal burst-max conform-action action exceed-action action

    input|output:这是定义数据流量的方向。

    access-group number:定义的访问列表的号码。

    bps:定义流量速率的上限,单位是bps。

    burst-normal burst-max:定义的数据容量的大小,一般采用8000,16000,32000,单位是字节,当到达的数据超过此容量时,将触发某个动作,丢弃或转发等,从而达到限速的目的。

    conform-action和exceed-action:分别指在速率限制以下的流量和超过速率限制的流量的处理策略。

    action:是处理策略,包括drop和transmit等。

配置指定的访问速率和分布式访问速率策略,你可以使用rate-limit 端口配置命令.
移除rate limit配置,在原命令上加上no移除.
指令:
rate-limit {input | output} [access-group [rate-limit] acl-index] bps burst-
normal burst-max conform-action conform-action exceed-action exceed-action
no rate-limit {input | output} [access-group [rate-limit] acl-index] bps burst-
normal burst-max conform-action conform-action exceed-action conform-action
参数描述: input?? ??在入口上对接受的packets应用一个访问速率策略
output ?? 在出口上对发送的packets应用一个访问速率策略
access-group 可选项,在指定的访问控制列表上应用访问速率策略 --通常在对指定的ip和应用程序
限速的情况下使用
rate-limit 可选项,这个是rate-limit访问控制策略
acl-index 可选项,Access list number.
bps 平均速率(bits/每秒),为8kbp的倍数
burst-normal 普通的最大速率,The minimum value is bps divided by 2000.
burst-max 非正常时的最大速率(单位字节)
conform-action 相应的行为动作
1.continue --Evaluates the next rate-limit command.
2.drop 丢弃该包
3.set-dscp-continue -----Sets the differentiated services code point (DSCP) (0
to 63) and evaluate the next rate-limit command.
4.set-dscp-transmit―------Sends the DSCP and transmit the packet.
5.set-mpls-exp-transmit―--Sets the MPLS experimental bits (0 to 7) and sends
the packet.
6.set-prec-continue―---Sets the IP precedence (0 to 7) and evaluates the next
rate-limit command.
7.set-qos-continue―---Sets the QoS group ID (1 to 99) and evaluates the next
rate-limit command.
8.transmit―---Sends the packet.
exceed-action--------Action to take on packets that exceed the specified rate
limit. Specify one of the following k