ROS 网页优先的脚本
- 格式:doc
- 大小:22.00 KB
- 文档页数:2
ros2.96秋风破解版安装教程(修正版)昨天晚上做的教程,因为半夜思路不清晰,做出了一个错误的垃圾教程~首先向下载过教程的朋友道歉~ 这次经过测试给大家重新做个教程~也是刚才到网盟看了一下~贴子还浮在上面~不能对不起大家,所以,不能误导大家,还是乖乖的重新做一个吧~废话少说了~先把需要的软件和部分策略说一下。
ROS2.96秋风破解版下载(网吧电信光纤,大家手下留情!)网通路由表、防火墙策略、自动切换脚本。
(绿字的教程附带,蓝字的请自己下载。
)接下来是说下具体步骤~这样思路会明确一些~1。
安装ROS系统,并选择所有服务。
硬盘接到IDE1,光驱接到IDE0。
BIOS里设置光驱引导系统,我拿虚拟机做演示,顺便虚拟机的使用大家也看下吧!需要安装的服务,全部选择即可。
全选输入A,同意选择输入I,回车,询问你:注意啦,所有数据(功能),都要被安装(选择的),是否继续,输入Y即可。
它又询问,是否保存旧配置,输入N。
接下来开始创建分区,格式化硬盘,安装服务。
提示软件安装完成,按回车重起。
这里多说一句,虚拟机如果安装完ROS后,会自动从硬盘启动,但是真实的计算机,就还是在光驱启动,所以这时候大家该把光盘拿出来了,BIOS里改为硬盘启动,ROS就会独立启动了。
启动后又问了,是否检测硬盘。
通常不必检测了,因为耽误时间。
默认他自动选N。
我们也可以直接输入N的。
他自动选了。
呵呵~2。
登陆ROS,修改网卡名字、填写另外两块网卡的IP信息。
ROS启动好后,在ROS主机上输入账号admin密码为空。
回车。
输入命令/int pri 查看系统检测到几块网卡~电信+网通双线切换路由,当然应该是3块网卡,如果少了,请自行检查问题所在!输入命令/ip address (设置IP命令)输入命令add address=192.168.0.1/24 interface=ether1 设置路由IP,也就是网关~(内网的网关地址)(内网网卡)通常是靠近CPU的为内网网卡,也就是ether1好了,网关设置好了,那我们登陆http://192.168.0.1来下载Winbox刚才我安装过一次,有遗留信息的。
ROS之动态网站解析2010-12-24 19:33当我们需要对某些网站进行监控或者限制访问时,我们需要得到他们的IP地址,但有时候网站的IP地址随时在变化,为了获得准确的网站IP地址我们可以通过脚本解析网站,并将它们存入地址列表脚本如下:global a [:resolve ]:global b 0:foreach i in=[/ip firewall address-list find list=qqgame] do={:if ($a = [/ip firewall address-list get $i address ]) do={:set b 1}}:if ($b = 0) do={ /ip firewall address-list add list=qqgame address=$a这里使用了resolve指令,即解析指令,解析一个网站(注:要求路由的ip dns setting里的DNS已经正确设置)通过解析后将值赋给全局变量“a”,通过foreach指令查找qqgame地址列表下的IP地址是否有相同,如果相同变量“b”设置为1,否则b设置为0。
如果b值为0,即与qqgame地址列表的IP地址不同,则添加到qqgame地址列表中我们将脚本添加到计划任务中RouterOS第一次打开网页强制跳转到自己的网页,一开就跳绝对有效默认分类2011-03-09 22:04:40 阅读91 评论0 字号:大中小订阅网上极少有关于RouterOS的第一次打开网页强制跳转主页的方法,大多数都方法是将浏览某个域名的IP地址跳转到自己的主页,这种方法有时会失效。
还有一种方法就是当用户用80端口连接时,抓取源地址到地址列表,然后指定该地址的timeout时间,在做地址映射来达到强制跳转的目的,但是这种方法也会经常失效,某些即时通软件也会使用TCP 80端口来通讯。
BUG:循环脚本比较耗CPU,使用此方法时需要注意路由器硬件配置。
技巧教你如何用ROS限制土豆优酷等在线视频网站速度本人的网吧带宽紧张,偏偏碰上一些喜欢优酷,土豆的爷们,一到高峰期飞速土豆就显示出它的威力了。
汗。
为了更好的调节网吧的带宽,现在我向大家展示一下,如何在ROS里限制特定类型的传输速度。
第一步:我们明白其实土豆和优酷网上传播的都是FLV格式的视频。
OK,找到了这个规律就很好办事了。
在ROS的防火墙MANGLE里,有一个mark connection的功能,很显然,从字面上就能理解为“标记链接”它的功能就是让符合条件的链接都打上自己定义好的标记。
我们利用的就是这个功能,将所有链接为FLV格式的全部做标记为“flv”。
脚本如下/ip firewall mangleadd action=mark-connection chain=forward comment="" content=.flv disabled=no \\new-connection-mark=flv passthrough=yes src-address=10.128.7.0/24第二步:光标记的链接还没有用,我们还要对这个链接的数据包打上标记,让我们的路由知道哪些包是FLV格式的。
这就要使用到mark packet了,字面是理解,就是“标记包”,我们将所有被打上了"flv"标记的链接的数据包全部标上"flv2"脚本如下/ip firewall mangleadd action=mark-packet chain=forward comment=""connection-mark=flv disabled=\\no new-packet-mark=flv2 passthrough=yes src-address=10.128.7.0/24第三步:好了,我们已经找到所有需要的数据包了,现在就是对他们进行限速了,我们很自然的想到了QUEUE。
ros 3.30 虽说有radius,但没有到期自动提醒,需自己配置脚本,这可见ros的灵活性.本人经过研究,基本实现了.不多说了....首先建立两个地址池pool dq 192.168.2.0/24 到期和zc 192.168.3.0/24正常两个, 当3后到期就切换到到期pool,反之则切换到zc,上切换脚本切换到期地址池:foreach i in=[ /tool user-manager user find credit-left<=3d ] do={/tool user-manager user set [/tool user-manager user get $i name] pool-name=dq}切换正常地址池:foreach i in=[ /tool user-manager user find credit-left>3d ] do={/tool user-manager user set [/tool user-manager user get $i name] pool-name=zc}credit-left 指剩下多少时间就到期.这两个脚本添加到调度里.然后就是跳到指定web催费界面/ip firewall mangleadd action=change-mss chain=forward comment="" disabled=no new-mss=1440 \ protocol=tcp tcp-flags=synadd action=add-src-to-address-list address-list=src1 address-list-timeout=2s \chain=prerouting comment=TimeOut1 disabled=no dst-port=80 protocol=tcp \src-address-list=!src2add action=add-src-to-address-list address-list=src2 address-list-timeout=3h \ chain=prerouting comment=TimeOut2 disabled=no dst-port=80 protocol=tcp/ip firewall natadd action=masquerade chain=srcnat comment="3\CC\EC\B5\BD\C6\DA" disabled=no \ src-address=192.168.3.0/24add action=masquerade chain=srcnat comment="\D5\FD\B3\A3" disabled=no \ src-address=192.168.2.0/24add action=dst-nat chain=dstnat comment=ToAddress disabled=no dst-port=80 \ protocol=tcp src-address=!192.168.3.0/24 src-address-list=src1 \to-addresses=192.168.0.1 to-ports=80建立正常地址列表192.168.3.0/24 不然正常的也会自动跳转,建立这个是为了排除这个之外的所有地址进行跳转. 看上面脚本.。
ROS的一些解释ROS 路由器的一些解释routeros防火墙功能非常灵活。
routeros防火墙属于包过滤防火墙,你可以定义一系列的规则过滤掉发往routeros、从routeros发出、通过routeros转发的数据包。
在routeros防火墙中定义了三个防火墙(过滤)链(即input、forward、output),你可以在这三个链当中定义你自己的规则。
input意思是指发往routeros自己的数据(也就是目的ip是routeros接口中的一个ip地址);output意思是指从routeros发出去的数据(也就是数据包源ip 是routeros接口中的一个ip地址);forward意思是指通过routeros转发的(比如你内部计算机访问外部网络,数据需要通过你的routeros进行转发出去)。
禁止ping routeros,我们一般需要在input链中添加规则,因为数据包是发给routeros的,数据包的目标ip是routeros 的一个接口ip地址。
(当然如果你硬是要在output里建立一条规则过滤掉icmp 信息也能做到ping不通,当你ping的数据包到达routeos时,routeos能接收这个数据包并做出回应,当routeros回应给你的包要发出去的时候会检查output的规则并过滤掉回应你的包。
)在每条链中的每条规则都有目标ip,源ip,进入的接口(in interface),非常灵活的去建立规则。
比如ROS禁止PING,禁止外网ping你routeros,只需要在in interface中选择你连外部网络的接口。
禁止内部ping的话可以选择连你内部网络的接口。
如果禁止所有的ping的话,那么接口选择all。
当然禁止ping 协议要选择icmp,action选择drop或reject。
另外要注意的就是,icmp协议并不是就指的是ping,而是ping 是使用icmp协议中的一种(我们ping 出去发送的数据包icmp协议的类型为8 代码为0,在routeros中写为icmp-options=8:0;而我们对ping做出回应icmp类型为0 代码为0),还有很多东西也属于icmp协议。
近日最大的感觉是:让其他人说去吧环境:对于带宽紧张的网吧或者其他环境那些有100M光纤或30台+10M光纤的用户可以省略了,因为对你们来说这个没有必要了我现在做的是基于ADSL PPPOE的ROUTER OS 2.9.7 做的但是光纤用户一样适用我现在开始说说步骤第一:当然最前提的是你的ROUTER OS 软件路由器能工作了NAT共享上网成功第2步:在所有经过ROUTER OS的数据包+ 上MARK 就像猎人要杀猎物也要先找到目标阿2008-8-15修改:Mark connection 和Mark packet 的顺序搞反了官方手册首先mark connection 然后在mark packet其次mark connection 那里是点passthrough,而mark packet 那里是不点这个选项的第3步:在QUEUE菜单里面选择Queue Types 创作PCQ限速的子项这里就决定了你的限制每个IP多少K的速度(2.9系列可以直接用K单位2.8 的不行)这里多说2句2008-8-15 更新关于PCQ的块大小,官方默认值是每IP 20个链接计算的,理解下面这2张图非常关键第2张关于块的图是举例的网吧的带宽和银行道理一样总带宽不能平均处以IP数量这个公式不合适你可以想想网吧的客人不可能同时全部去下载或者全部去上传网吧的目标追求网络利用最大化这个IP的限制要看你自己的网吧的需要的1般来说每个IP限制下载最高512K;上传128K已经可以流畅游戏和视频----------------------------------------------------------------------------------------------------另外:这个也和你的开关频繁开启和关闭有关系如果设置得不合理网络带宽浪费严重客户也会对你的网吧的网络速度抱怨的!(这可是得不尝失)2008-8-15修改,注意parent 那里的选择是内网网卡和外网网卡当作总流量的控制点第4步:做好流量监视触发器就像1个条件过滤器注意2 和3 红色数字那里*要选择对你的外网线路*要注意ABOVE是> 的意思,就是大于多少K的时候启动这个限制,只要模糊数字就可以如果你的带宽是10M,你可以直接设置10000000*另外1个就是BELOW 当然就是< 小于的意思,这里很关键的地方就是你刚才设置的每IP限制数了你们看第2张图的2那里,你这个BELOW的数值一定要< 它不然你在限速的时候客户的机器就会1会快1会慢的,其中的道理你们慢慢体会就会理解第5步:做1个执行这个限制的脚本很简单的就2行,但是注意脚本的名字要和你的在第四张图EVEN里面的一致(如果你想我拷贝那几句命令出来给你,你就不要看了,这么懒的都有的!)做到这里这个PCQ 脚本限速就做好了以前斑竹也写过命令的我这里只不过用图片的形式写出来!!希望大家喜欢有些朋友说不会看GIF的图(其实可以缩放的用鼠标滚轮就可以)我特别作了1个图的包给大家下载(我可花了2个小时的时间作的)----------------------------------------------------------------------------------------------------- 最近有朋友说开关不正常或者限速不明显刚好另外1个论坛的版主也发了1个关于这个的文章大家可以在效果不好的时候参考人家版主的的做法以下内容是转贴的(刚才试验了1下他的环境应该是 2.8 系列的)-------------------------------------------------------------------------------------------------------怎么保证和按优先级管理流量?怎么保证和按优先级管理流量?概述队列树通常的应用,是用来限定特殊用户,协议和端口等等。
ROS限速、防syn、ip伪装、mac绑定、防火墙、屏蔽端口、教程大全、VPN、ROS端口映射2008-02-28 20:46节省磁盘资源!:foreach i in=[/system logging facility find local=memory ] do=[/system logging facility set $i local=none]RO防synip-firewall-connectionsTracking:TCP Syn Sent Timeout:50TCP syn received timeout:30限线程脚本::for aaa from 2 to 254 do={/ip firewall filter add chain=forwardsrc-address=(192.168.0. . $aaa) protocol=tcp connection-limit=50,32 action=drop}RO端口的屏蔽ip-firewall-Filer Rules里面选择forward的意思代表包的转发firewall rule-GeneralDst.Address:要屏蔽的端口Protocol:tcpAction:drop(丢弃)ros限速手动限速winbox---queues----simple queues点“+”,NAME里随便填,下面是IP地址的确定①Target Address 不管,Dst. Address里填你要限制的内网机器的IP,比如我这里有个 1号机器 IP为 192.168.1.101,那dst.address 里就填192.168.1.101 然后是/32(这里的32不是指掩码了,个人理解为指定的意思)!②interface里记着要选你连接外网那个卡,我这里分了“local和public”,所以选public③ 其他的不管,我们来看最重要的东西拉,Max limit ,这个东西是你限制的上限,注意的是这里的数值是比特位,比如我要限制下载的速度为 500K 那么就填入多少呢? 500 X 1000 X 8=400 0000=4M。
ROS QOS脚本1.复制代码另存qos_htb.rsc2.在电脑上选择qos_htb.rsc复制3.在winbox中Files4.在New terminal 中输入:im qos_htb.rsc5.修改实际带宽。
打开WinBox ----- Queues Max Limit 为最大速率Limit AT 为稳定速率Bursts Limit 为突发速率7.代码复制以下代码另存qos_htb.rsc# ros3.30-HTB流控 By:佛光菜根谭 QQ:304120225#### 说明: 网段为 192.168.1.0/24 默认带宽100M, 200台客户机请根据实际情况修改#/ip firewall address-listadd address=192.168.1.0/24 comment="" disabled=no list=wks/ip firewall mangleadd action=mark-connection chain=prerouting comment="*\B7\F0\B9\E2\B2\CB\B8\\F9\CC\B7* QQ:304120225 HTB + PCQ \B6\AF\CC\AC\C1\F7\BF\D8\$\$\$\\$\$\$\$\$< \B4\FA\BA\C5:\B2\BB\B6\AE\CE\C2\C8\E1 >\$\$\$\$\$\$\$\$ \\_ \CA\A5\CD\A2\B3\F6\C6\B7 \B1\D8\CA\F4\BE\AB\C6\B7 " disabled=no\limit=5,5 new-connection-mark=icmp passthrough=yes protocol=icmpadd action=mark-packet chain=postrouting comment="" connection-mark=icmp \ disabled=no limit=5,5 new-packet-mark=icmps passthrough=no \src-address-list=wksadd action=mark-packet chain=prerouting comment="" connection-mark=icmp \disabled=no limit=5,5 new-packet-mark=icmp passthrough=noadd action=mark-packet chain=postrouting comment=ALL_UP disabled=no \new-packet-mark=lanup passthrough=no src-address-list=wksadd action=mark-connection chain=prerouting comment="HTTP_\C1\B4\BD\D3" \connection-bytes=700000-0 disabled=no new-connection-mark=http \passthrough=yes protocol=tcp src-port=80add action=mark-packet chain=prerouting comment="" connection-mark=http \disabled=no new-packet-mark=http passthrough=noadd action=mark-connection chain=prerouting comment="WEB_\C1\B4\BD\D3" \connection-bytes=0-700000 disabled=no new-connection-mark=web \passthrough=yes protocol=tcp src-port=80add action=mark-connection chain=prerouting comment="" connection-rate=0-80k \disabled=no new-connection-mark=web passthrough=yes protocol=udp \src-port=53add action=mark-packet chain=prerouting comment="" connection-mark=web \disabled=no new-packet-mark=web passthrough=noadd action=mark-connection chain=prerouting comment="Games_\C1\B4\BD\D3" \ connection-rate=0-80k disabled=no new-connection-mark=game passthrough=\ yes protocol=tcp src-port=3724,6112,6114,1119,7777,10241add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=5692,7101-7103,28012,2349,8586,10001-10070,28008,31414,6299,5130 add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=\3110-3120,6217,2181,28880,8001,21800,8030,6020,6030,6877,4680,13000-13002 add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=\3110-3120,28993,29000,5816,6868,33567,39311,9600,1119,3025,31414,3470 add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=\6004,7004,5562,9010-9014,17703-17706,8801,1253,1346,1272,1203,3468add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=\25520-25521,25511,10906,30000-30010,8445-8451,3731-3735,7449,7237add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=7100-7200,7440,7491,7204,7400-7401,7500,7300,6040,6050,6661-6663 add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=27931,47611,1607,2175,6000,20002-20007,22001,13317add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=7100,7203-7204,7400,7417,6831-6832,6840-6847,8888add action=mark-connection chain=prerouting comment="" connection-rate=0-10k \disabled=no new-connection-mark=game passthrough=yes protocol=tcp \src-port=14500,8000,15000add action=mark-connection chain=prerouting comment="" connection-rate=0-59k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port=12000-13000,2349,5063,39311,1764,12721,3133,4550,3620add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="8861,1932,2287,14531,1897,2428,13735,1039,1100,1210,1381,1473,15\ 09,1785,18979"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="1140,1371,1510,16434,9865,2105,1497,31519,9000,1151,4311,1506,15\ 59,55952,59823"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="32404,32405,32406,1176,1076,1169,13791,1139,11337,9000,1511,2009\ 6,20059,27005-27030"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="7263,2408,2468,2117,1871,1429,2294,1520,57236,1429,2494,7625,155\ 2,1842,12411"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="1273,1061,65473,1940,2882,1501,4078,8369,4861,4964,8445-8452,708\ 1,30700-30711"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="32824,9646,8024,15966,18997,49386,15086,22634,35339,1610,1308,66\ 60,6600,1991,30195"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port="12345,6660,1610,6600,7002,15002-15004,3100,1059,4111,32424,32299\ ,15101-15104,14401"add action=mark-connection chain=prerouting comment="" connection-rate=0-20k \disabled=no new-connection-mark=game passthrough=yes protocol=udp \src-port=8000-8005,32407add action=mark-packet chain=prerouting comment="" connection-mark=game \disabled=no new-packet-mark=game passthrough=noadd action=mark-connection chain=prerouting comment="Heavy_\C1\B4\BD\D3" \ connection-bytes=200000-0 connection-rate=160k-200M disabled=no \new-connection-mark=heavy passthrough=yes protocol=tcpadd action=mark-connection chain=prerouting comment="" connection-bytes=\100000-0 connection-rate=100k-200M disabled=no new-connection-mark=heavy \passthrough=yes protocol=udpadd action=mark-packet chain=prerouting comment="" connection-mark=heavy \ disabled=no new-packet-mark=heavy passthrough=noadd action=mark-connection chain=prerouting comment="Small_\C1\B4\BD\D3" \ disabled=no new-connection-mark=small passthrough=yesadd action=mark-packet chain=prerouting comment="" connection-mark=small \ disabled=no new-packet-mark=small passthrough=no/queue typeset default kind=pfifo name=default pfifo-limit=50set ethernet-default kind=pfifo name=ethernet-default pfifo-limit=50set wireless-default kind=sfq name=wireless-default sfq-allot=1514 \sfq-perturb=5set synchronous-default kind=red name=synchronous-default red-avg-packet=1000 \red-burst=20 red-limit=60 red-max-threshold=50 red-min-threshold=10set hotspot-default kind=sfq name=hotspot-default sfq-allot=1514 sfq-perturb=\ 5add kind=pcq name=1m_down pcq-classifier=dst-address pcq-limit=50 pcq-rate=\ 1000000 pcq-total-limit=10000add kind=pcq name=0m_down pcq-classifier=dst-address pcq-limit=50 pcq-rate=0 \pcq-total-limit=10000add kind=pcq name=512k_up pcq-classifier=src-address pcq-limit=50 pcq-rate=\ 512000 pcq-total-limit=10000set default-small kind=pfifo name=default-small pfifo-limit=10/queue treeadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \ max-limit=80M name=HTB_DOWN parent=global-in priority=1add burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=5M \ max-limit=70M name="1_\CD\F8\C2\E7\D3\CE\CF\B7" packet-mark=game parent=\ HTB_DOWN priority=2 queue=1m_downadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=20M \ max-limit=70M name="2_\CD\F8\D2\B3\E4\AF\C0\C0" packet-mark=web parent=\ HTB_DOWN priority=3 queue=0m_downadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=20M \ max-limit=70M name="3_\D0\A1\B0\FC\CA\FD\BE\DD" packet-mark=smallparent=\HTB_DOWN priority=6 queue=1m_downadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=0 \ max-limit=40M name=HTB_UP packet-mark=lanup parent=global-out priority=7 \queue=512k_upadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10M \ max-limit=70M name="5_\CE\C4\BC\FE\CF\C2\D4\D8" packet-mark=heavyparent=\HTB_DOWN priority=8 queue=0m_downadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=10M \ max-limit=70M name="4_\D4\DA\CF\DF\CA\D3\C6\B5" packet-mark=http parent=\ HTB_DOWN priority=7 queue=0m_downadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=1M \ max-limit=1M name=ICMP_DOWN packet-mark=icmp parent=global-in priority=1 \queue=defaultadd burst-limit=0 burst-threshold=0 burst-time=0s disabled=no limit-at=1M \ max-limit=1M name=ICMP_UP packet-mark=icmps parent=global-out priority=1 \queue=default。
ROS的脚本多拨ros设置单⽹卡拨多ADSL 使⽤vrrp 有些版本有问题,使⽤5.2破解版本测试成功。
1.创建100个vrrp,并绑定到wan⼝下for i from 1 to 100 do={/interface vrrp add comment=("RP".$i) interface=wan interval=1 name=("vrrp".$i) vrid=$i}2.修改vrrp 协议for i from 1 to 100 do={/interface vrrp set v3-protocol=ipv6 numbers=("vrrp".$i)}3.创建pppoe,(这⾥需要注意你的adsl ⽤户和密码),并绑定到对应的vrrpfor i from 1 to 100 do={/interface pppoe-client add add-default-route=yes allow=pap,chap comment=($i) interface=("vrrp".$i) max-mtu=1480 name=("pppoe-out".$i) user=$i password=$i }设置pppoe 的为取消默认路由for i from 0 to 99 do={/interface pppoe-client set numbers=$i add-default-route=no }设置PCC负载均衡(原来的PPPOE需要取消默认路由,后边收到设置路由)1.设置NATfor i from 1 to 100 do={/ip firewall nat add chain=srcnat action=masquerade out-interface=("pppoe-out".$i) comment=("pppoe".$i)}2.设置inputfor i from 1 to 100 do={/ip firewall mangle add chain=input action=mark-connection new-connection-mark=("pppoe-out".$i."_conn") passthrough=yes in-interface=("pppoe-out".$i) comment=("input".$i)}3.设置outputfor i from 1 to 100 do={/ip firewall mangle add chain=output action=mark-routing new-routing-mark=("to_pppoe_out".$i) passthrough=yes connection-mark=("pppoe-out".$i."_conn") comment=("output".$i)}4.设置连接标记for i from 6 to 100 do={/ip firewall mangle add chain=prerouting action=mark-connection new-connection-mark=("pppoe-out".$i."_conn") passthrough=yes src-address=10.0.0.0/8 dst-address-type=!local in-interface=ether1-lan per-connection-classifier=("both-addresses:100/".$i-1) comment=("pcc".$i)}5.设置路由标记for i from 6 to 100 do={/ip firewall mangle add chain=prerouting action=mark-routing new-routing-mark=("to_pppoe_out".$i) passthrough=yes src-address=10.0.0.0/8 in-interface=ether1-lan connection-mark=("pppoe-out".$i."_conn") comment=("pcc".$i)}6.⼿动设置路由for i from 6 to 100 do={/ip route add comment=$i disabled=no distance=1 dst-address="0.0.0.0/0" gateway=("pppoe-out".$i) routing-mark= ("to_pppoe_out".$i) check-gateway=("ping")}7.设置路由ping 监控for i from 8 to 100 do={/ip route add check-gateway="ping" comment=("pppoe-out".$i) disabled=no distance="10" dst-address="0.0.0.0/0" gateway=("pppoe-out".$i)}。
ROS 网页优先的脚本
/ ip firewall mangle
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=msie content=MSIE disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=jpg content=.jpg disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=gif content=.gif disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=htm content=.htm disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=html content=.html disabled=no dst-port=80 \ protocol=tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=asp content=.asp disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=aspx content=.aspx disabled=no dst-port=80 \ protocol=tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=php content=.php disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=swf content=.swf disabled=no dst-port=80 protocol=\
tcp
add action=add-dst-to-address-list address-list=web80 address-list-timeout=5m \
chain=forward comment=shtml content=.shtml disabled=no dst-port=80 \ protocol=tcp
add action=mark-connection chain=forward comment=web80 disabled=no \ new-connection-mark=web passthrough=yes src-address-list=web80
add action=mark-connection chain=forward comment="" disabled=no \ dst-address-list=web80 new-connection-mark=web passthrough=yes
add action=mark-packet chain=forward comment="" connection-mark=web disabled=\
no new-packet-mark=web80 passthrough=no。