一、对于S21的进入(上行)的数据的限速,可以用Qos做到。

ip access-list extended acl_1                配置ACL
permit ip 172.16.41.0 0.0.0.255   any 进入端口源地址为172.16.41.0的数据流
   deny ip any   any
!
class-map class_1                            设置分类映射图
match access-group acl_1                   匹配ACL
policy-map 1m                               设置策略映射图
class class_1                               匹配分类映射图
police 1000000 65536                      设置限制带宽1Mbps,猝发流量65536byte
Interface Fastethernet 0/24                   进入F 0/24
Switch mode TRUNK                      配置端口模式为TRUNK
mls qos trust cos                         启用QoS
service-policy input 1m                   对输入带宽生效
说明:1.QOS的实现也是由ASIC芯片实现的,不会对CPU造成什么影响。  
   2.S2126只有input模式。


二、对于S21的出入(下行)的数据的限速,可以用qos或 rate-control命令实现。
1.Qos:
ip access-list extended acl_1                配置ACL
permit ip any 172.16.41.0 0.0.0.255    进入端口目的地址为172.16.41.0的数据流
   deny ip any   any
!
class-map class_1                             设置分类映射图
   match access-group acl_1                   匹配ACL
policy-map 1m                                设置策略映射图
class class_1                               匹配分类映射图
police 1000000 65536                      设置限制带宽1Mbps,猝发流量65536byte
Interface Fastethernet 0/2                   进入F 0/2,交换机的上行端口(出口)
Switch mode TRUNK                       配置端口模式为TRUNK
mls qos trust cos                         启用QoS
service-policy input 1m                   对输入带宽生效

2.rate-control:
Interface Fastethernet 0/2                                     进入F 0/2
rate-control 1 tx                                           对输出做1M带宽限速