脚本-MikroTik RouterOS/ros-PCC自动纠错/自动更新

 
更多

定期检查有效pppoe-out数,自动更新PCC标记
脚本:


#脚本开始
{
:local status
:local i "5"
: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:".$x."/".$y) disable=no;:set y ($y+1)}}}}
#脚本结束

*:local i “5”中的5修改为你ROS中pppoe-out最大条数。
*适合RouterOS版本:3.x 4.x 5.x

打赏

本文固定链接: https://www.cxy163.net/archives/2541 | 绝缘体

该日志由 绝缘体.. 于 2013年12月30日 发表在 未分类 分类下, 你可以发表评论,并在保留原文地址及作者的情况下引用到你的网站或博客。
原创文章转载请注明: 脚本-MikroTik RouterOS/ros-PCC自动纠错/自动更新 | 绝缘体
关键字: , , , ,

脚本-MikroTik RouterOS/ros-PCC自动纠错/自动更新:等您坐沙发呢!

发表评论


快捷键:Ctrl+Enter