ros桥接限速.doc_第1页
ros桥接限速.doc_第2页
ros桥接限速.doc_第3页
ros桥接限速.doc_第4页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

modified on 25 June 2009 at 07:13 102,654 viewsTransparentTrafficShaperFrom MikroTik WikiJump to: navigation, searchContentshide 1 Introduction 2 Quick Start for Impatient 3 Explanation o 3.1 Bridge o 3.2 V3 o 3.3 Mangle o 3.4 Queues IntroductionThis example shows how to configure a transparent traffic shaper. The transparent traffic shaper is essentially a bridge that is able to differentiate and prioritize traffic that passes through it. Consider the following network layout: We will configure one queue limiting the total throughput to the client and three sub-queues that limit HTTP, P2P and all other traffic separately. Quick Start for ImpatientConfiguration snippet from the MikroTik router: / interface bridge add name=bridge1/ interface bridge port add interface=ether2 bridge=bridge1 add interface=ether3 bridge=bridge1 / interface bridge settingsset use-ip-firewall=yes/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 action=mark-connection new-connection-mark=http_conn passthrough=yesadd chain=prerouting connection-mark=http_conn action=mark-packet new-packet-mark=http passthrough=noadd chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yesadd chain=prerouting connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=noadd chain=prerouting action=mark-connection new-connection-mark=other_conn passthrough=yesadd chain=prerouting connection-mark=other_conn action=mark-packet new-packet-mark=other passthrough=no/ queue simple add name=main target-addresses=2/32 max-limit=256000/512000add name=http parent=main packet-marks=http max-limit=240000/500000 priority=1add name=p2p parent=main packet-marks=p2p max-limit=64000/64000 priority=8add name=other parent=main packet-marks=other max-limit=128000/128000 priority=4ExplanationEach piece of code is followed by the explanation of what it actually does. Bridge/ interface bridge add name=bridge1/ interface bridge port add interface=ether2 bridge=bridge1 add interface=ether3 bridge=bridge1We create a new bridge interface and assign two ethernet interfaces to it. Thus the prospective traffic shaper will be completely transparent to the client. V3/ interface bridge settingsset use-ip-firewall=yesBridged packets behavior is changed on RouterOS v3. Use command to make bridged packets go trough ip firewall, by default bridged traffic is not going over ip firewall. Mangle/ ip firewall mangle add chain=prerouting protocol=tcp dst-port=80 action=mark-connection new-connection-mark=http_conn passthrough=yesadd chain=prerouting connection-mark=http_conn action=mark-packet new-packet-mark=http passthrough=noAll traffic destined to TCP port 80 is likely to be HTTP traffic and therefore is being marked with the packet mark http. Note, that the first rule has passthrough=yes while the second one has passthrough=no. (You can obtain additional information about mangle at /docs/ros/2.9/ip/mangle) / ip firewall mangle add chain=prerouting p2p=all-p2p action=mark-connection new-connection-mark=p2p_conn passthrough=yesadd chain=prerouting connection-mark=p2p_conn action=mark-packet new-packet-mark=p2p passthrough=noadd chain=prerouting action=mark-connection new-connection-mark=other_conn passthrough=yesadd chain=prerouting connection-mark=other_conn action=mark-packet new-packet-mark=other passthrough=noSame as above, P2P traffic is marked with the packet mark p2p and all other traffic is marked with the packet mark other. Queues/ queue simple add name=main target-addresses=2/32 max-limit=256000/512000We create a queue that limits all the traffic going to/from the client (specified by the target-address) to 256k/512k. / queue simple add name=http parent=main packet-marks=http max-limit=240000/500000 priority=1add name=p2p parent=main packet-marks=p2p max-limit=64000/64000 priority=8add name=other parent=main packet-marks=other max-limit=128000/128000 priority=4All sub-queues have the main queue as the parent, thus the aggregate data rate could not exceed limits sp

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论