找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: zooyo

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

  [复制链接]
发表于 2011-2-27 18:59:41 | 显示全部楼层
这个看了不回复对不起人了,太经典了,收起来了感谢版主了!
routeros
回复

使用道具 举报

发表于 2011-2-28 01:02:28 | 显示全部楼层
这个要顶............
routeros
回复

使用道具 举报

发表于 2011-2-28 02:50:50 | 显示全部楼层
腰花超版。。。反映问题。。。ROS4.10上测试无效呀
routeros
回复

使用道具 举报

 楼主| 发表于 2011-2-28 10:38:47 | 显示全部楼层
routeros
回复

使用道具 举报

发表于 2011-2-28 15:40:21 | 显示全部楼层
这个要顶起来 呵呵
routeros
回复

使用道具 举报

发表于 2011-3-1 01:00:22 | 显示全部楼层
再顶一下
在4.13测试成功
再次感谢版主
routeros
回复

使用道具 举报

发表于 2011-3-1 01:07:27 | 显示全部楼层
发现刷cpu很强劲,可能是我mangle里规则太多的原因
routeros
回复

使用道具 举报

发表于 2011-3-1 10:04:52 | 显示全部楼层
这个真的要顶,好东西哦。
routeros
回复

使用道具 举报

发表于 2011-3-1 14:36:34 | 显示全部楼层
不错!学习了!
routeros
回复

使用道具 举报

发表于 2011-3-1 15:52:21 | 显示全部楼层
不错不错 哼好很好 学习
routeros
回复

使用道具 举报

发表于 2011-3-2 00:00:04 | 显示全部楼层
回复 zooyo 的帖子

LZ真好,感谢!收藏起来学习。顺便想问下LZ,ROS中用的是什么脚本语言编写的脚本?
routeros
回复

使用道具 举报

发表于 2011-3-5 22:09:09 | 显示全部楼层
呵呵  文字版和图片版
routeros
回复

使用道具 举报

 楼主| 发表于 2011-3-20 13:04:12 | 显示全部楼层
脚本修改了一下。放出代码。
routeros
回复

使用道具 举报

发表于 2011-3-20 22:55:17 | 显示全部楼层
本帖最后由 kyer2012 于 2011-3-20 23:40 编辑
zooyo 发表于 2011-3-20 13:04
脚本修改了一下。放出代码。


/ip firewall mangle
add action=mark-connection chain=prerouting comment="" disabled=no new-connection-mark=1 passthrough=yes per-connection-classifier=both-addresses:4/0 \
    src-address=192.168.0.0/16
add action=mark-connection chain=prerouting comment="" disabled=no new-connection-mark=2 passthrough=yes per-connection-classifier=both-addresses:4/1 \
    src-address=192.168.0.0/16
add action=mark-connection chain=prerouting comment="" disabled=no new-connection-mark=3 passthrough=yes per-connection-classifier=both-addresses:4/2 \
    src-address=192.168.0.0/16
add action=mark-connection chain=prerouting comment="" disabled=no new-connection-mark=4 passthrough=yes per-connection-classifier=both-addresses:4/3 \
    src-address=192.168.0.0/16
add action=mark-routing chain=prerouting comment="" connection-mark=1 disabled=no new-routing-mark=1rou passthrough=no src-address=192.168.0.0/16
add action=mark-routing chain=prerouting comment="" connection-mark=2 disabled=no new-routing-mark=2rou passthrough=no src-address=192.168.0.0/16
add action=mark-routing chain=prerouting comment="" connection-mark=3 disabled=no new-routing-mark=3rou passthrough=no src-address=192.168.0.0/16
add action=mark-routing chain=prerouting comment="" connection-mark=4 disabled=no new-routing-mark=4rou passthrough=no src-address=192.168.0.0/16
以上是我的负载均衡脚本,为啥使用你的代码后无法自动禁用呢!i 我设置为 4 了啊!

{
:local status
:local i "4"
:local x "0"
:local y "0"
:local z "0"
:set x [:len [/interface pppoe-client find running=yes]]
:if ($x<$i) do={
:for ii from=1 to=$i do={
:set status [/interface get [find name=("pppoe-out"."$ii")] running]
: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)} else={
/ip fir man set [find new-connection-mark=$ii] disable=yes}}}
:if ($x=$i) do={
:set z [:len [/ip fir man find action="mark-connection" disabled=yes chain=prerouting]]
:if ($z>0) do={
:for ii from=1 to=$i do={
/ip fi man set [find new-connection-mark=$ii] per-connection-classifier=("both-addresses:"."$i"."/"."$y") disable=no;:set y ($y+1)}}}}



请指点下。
routeros
回复

使用道具 举报

发表于 2011-3-20 22:57:05 | 显示全部楼层
感谢分享。。。。
routeros
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 06:07 , Processed in 0.202150 second(s), 5 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

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