access-list 102 permit ip 192.168.1.0 0.0.0.255 any
access-list 102 permit ip any 192.168.1.0 0.0.0.255
interface FastEthernet0/1
rate-limit input access-group 102 256000 1500 2000 conform-action transmit exceed-action drop
rate-limit output access-group 102 256000 1500 2000 conform-action transmit exceed-action drop
上面两种方法的配置是对整个ip地址段来限速,如果我们要对ip段中的每一个ip进行限速25.6KB/s的话,就要用下面的方法了:
access-list 121 permit ip host 192.168.0.21 any
access-list 121 permit ip any host 192.168.0.21
!
access-list 122 permit ip host 192.168.0.22 any
access-list 122 permit ip any host 192.168.0.22
!
access-list 123 permit ip host 192.168.0.23 any
access-list 123 permit ip any host 192.168.0.23
!
class-map match-all 121
match access-group 121
!
class-map match-all 122
match access-group 122
!
policy-map xiansu
class 121
police 2560000 8000 conform-action transmit exceed-action drop
class 122
police 2560000 8000 conform-action transmit exceed-action drop
!
interface FastEthernet0/1
service-policy input xiansu
service-policy output xiansu
上面是对192.168.0.21,192.168.0.21限速256KB/s,要是限制整个段的ip,那就自己慢慢写吧。
从转载的,http://cuter.blog.51cto.com/822595/535784