免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1121 | 回复: 0
打印 上一主题 下一主题

NAT后做限速 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-04-01 08:43 |只看该作者 |倒序浏览
当接入路由器做NAT时如何做限速
??前段时间一直有客户问我路由器可不可以做到限制内部某些机子的下行速率,我很自然的答了句:可以做限速的。其实限速肯定是可以的,但是需要考虑一个具体的问题
??一般接入路由器都作了地址转换,但是了解到路由器的操作步骤会发现如下的执行步骤:
??
??check input rate limits ------->nat outside to inside------->check output rate limits
??所以针对内部部分主机做限速策略,由于必须在ACL里面指定inside local 地址,所以应该在内网接口上应用service-policy output xxx,而不是在外网接口上的service-policy input xxx!
??
??下面是一个具体的例子:
??Router#sh run
??Building configuration...
??
??Current configuration : 1026 bytes
??!
??version 12.2
??service timestamps debug datetime msec
??service timestamps log datetime msec
??no service password-encryption
??!
??hostname Router
??!
??!
??ip subnet-zero
??!
??!
??no ip domain lookup
??!
??!
??class-map match-all test-class
??match access-group 100
??!
??!
??policy-map speed
??class test-class
??police cir 80000 bc 32000
??conform-action transmit
??exceed-action drop
??!
??!
??!
??!
??!
??interface FastEthernet0/0
??ip address 192.168.1.111 255.255.255.0
??ip nat outside
??duplex auto
??speed auto
??!
??interface FastEthernet0/1
??ip address 172.16.1.1 255.255.255.0
??ip nat inside
??duplex auto
??speed auto
??service-policy output speed
??!
??ip nat inside source list 1 interface FastEthernet0/0 overload
??!
??ip classless
??ip route 0.0.0.0 0.0.0.0 192.168.1.1
??no ip http server
??!
??!
??access-list 1 permit any
??access-list 100 deny ip any host 172.16.1.100
??access-list 100 permit ip any any
??!
??line con 0
??line aux 0
??line vty 0 4
??!
??!
??end
??
??Router#
??最后的效果,可以达到限制内网除172.16.1.100的其他主机的下行速率在10KBps附近
??
????
??我的配置是这样的:
??class-map match-all 2m
??class-map match-all default
??match ip dscp 0
??
??policy-map c2m
??class default
??police 2000000 512000 exceed-action drop
??就可以了.
??
??
??然后在限速的端口上写:
??serice-policy input c2m
??serice-policy output c2m


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u/5591/showart_93824.html
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP