找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: zooyo

[脚本] 多ADSL负载--掉线后自动修改pcc/nth参数 保证网络畅通[修正版]

  [复制链接]
发表于 2011-2-24 16:59:56 | 显示全部楼层
不错,是好东西
routeros
回复

使用道具 举报

发表于 2011-2-24 19:31:48 | 显示全部楼层
如果是6条AD,一条光纤的呢?又怎么做啊?
routeros
回复

使用道具 举报

发表于 2011-2-24 20:07:22 | 显示全部楼层
很需要,不错,顶一下,我经常遇到这样的问题
routeros
回复

使用道具 举报

发表于 2011-2-25 01:08:02 | 显示全部楼层
ros 4.10测试 无效??
routeros
回复

使用道具 举报

发表于 2011-2-25 11:38:35 | 显示全部楼层
这东西一定要学习一下..以后用的着..mark一下.
routeros
回复

使用道具 举报

发表于 2011-2-25 13:12:17 | 显示全部楼层
哈哈。。公布出来啦。。。。。
routeros
回复

使用道具 举报

发表于 2011-2-25 13:18:29 | 显示全部楼层
支持@!!!!!!!!!
routeros
回复

使用道具 举报

发表于 2011-2-25 16:54:34 | 显示全部楼层

  又学到东西了!!
routeros
回复

使用道具 举报

发表于 2011-2-26 11:11:51 | 显示全部楼层
标记下。有时间多学习!!
routeros
回复

使用道具 举报

发表于 2011-2-26 11:28:48 | 显示全部楼层
做个标记..
routeros
回复

使用道具 举报

发表于 2011-2-26 21:40:17 | 显示全部楼层
呵呵,这是个好东西
routeros
回复

使用道具 举报

发表于 2011-2-27 10:09:47 | 显示全部楼层
本帖最后由 注册马 于 2011-2-27 10:11 编辑

变量太多了~看得头晕~能说下每个变量的定义吗
routeros
回复

使用道具 举报

发表于 2011-2-27 12:03:28 | 显示全部楼层
ddddddd
dddddddddddddd
routeros
回复

使用道具 举报

发表于 2011-2-27 13:15:09 | 显示全部楼层
我的是3。30的为什么我看不到per connection Classifier这一项,还有是不是我的PCC有问题放上去后ROS没感觉到.
/ip firewall mangle
add action=change-mss chain=forward comment="" disabled=no new-mss=1400 protocol=tcp tcp-flags=syn
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out1 new-connection-mark=pppoe-out1_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out2 new-connection-mark=pppoe-out2_conn passthrough=yes
add action=mark-connection chain=input comment="" disabled=no in-interface=pppoe-out3 new-connection-mark=pppoe-out3_conn passthrough=yes


add action=mark-routing chain=output comment="" connection-mark=pppoe-out1_conn disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out2_conn disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes
add action=mark-routing chain=output comment="" connection-mark=pppoe-out3_conn disabled=no new-routing-mark=to_pppoe-out3 passthrough=yes

add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=pppoe-out1_conn passthrough=yes per-connection-classifier=both-addresses:3/0 src-address=192.168.2.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=pppoe-out2_conn passthrough=yes per-connection-classifier=both-addresses:3/1 src-address=192.168.2.0/24
add action=mark-connection chain=prerouting comment="" disabled=no dst-address-type=!local new-connection-mark=pppoe-out3_conn passthrough=yes per-connection-classifier=both-addresses:3/2 src-address=192.168.2.0/24


add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out1_conn disabled=no new-routing-mark=to_pppoe-out1 passthrough=yes src-address=192.168.2.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out2_conn disabled=no new-routing-mark=to_pppoe-out2 passthrough=yes src-address=192.168.2.0/24
add action=mark-routing chain=prerouting comment="" connection-mark=pppoe-out3_conn disabled=no new-routing-mark=to_pppoe-out3 passthrough=yes src-address=192.168.2.0/24

/ip route
add comment=adsl1 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out1 routing-mark=to_pppoe-out1
add comment=adsl2 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out2 routing-mark=to_pppoe-out2
add comment=adsl3 disabled=no distance=1 dst-address=0.0.0.0/0 gateway=pppoe-out3 routing-mark=to_pppoe-out3

add check-gateway=ping comment=adsl1 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out1
add check-gateway=ping comment=adsl2 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out2
add check-gateway=ping comment=adsl3 disabled=no distance=10 dst-address=0.0.0.0/0 gateway=pppoe-out3


/ip firewall nat
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out1
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out2
add action=masquerade chain=srcnat comment="" disabled=no out-interface=pppoe-out3


routeros
回复

使用道具 举报

发表于 2011-2-27 13:16:57 | 显示全部楼层
我是三条ADSL的,这样改不知有没有问题
{
:local status
:local i "3"
:local x "0"
:local y "0"
:local z "0"
:for ii from=1 to=$i do={
:set status [/interface get [find name=("pppoe-out"."$ii")] runing]
:if ($status=true) do={:set x ($x+1)}}
:if ($x>0 && $x<$i) do={
:for ii from=1 to=$i do={
:set status [/interface get [find name=("pppoe-out"."$ii")] runing]
:if ($status=true) do={
/ip fir man set [find new-connection-mark=$ii] per-connection-classifier=("both-addresses:"."$x"."/"."$y") disable=no;:set y ($y+1)}
:if ($starus!=true) do={/ip fir man set [find new-connection-mark=$ii] disable=yes}}}
:if ($x=$i) do={
:for ii from=1 to=$i do={
:set status [/ip fir man get [find new-connection-mark+$ii] disable]
:if ($z>0) do={
:for ii from=1 to=$i do={
/ip fir man set [find new-connection-mark=$ii] per-connection-classifier=(both-addresses:"."$i"."/"."$y") disable=no;:set y ($y+1)}}}
:if ($x=0) do={
:for ii from=1 to=$i do={/ip fir man set [ find new-connection-mark=$ii] disable=yes}}}
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-11-22 03:22 , Processed in 0.060030 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表