创新|开发|定制
专注于软路由|网络技术领域

ROS多线adsl负载掉线后自动修改pcc/nth参数

1.自动修改PCC参数脚本:

{
 :local status
 :local i 6
 :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 “6” (我这里有6条adsl,所以我写为6)

2.自动修改NTH参数脚本:

{
 :local status
 :local i 6
 :local x 0
 :local y 1
 :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] nth=($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] nth=($x.”,”.$y) disable=no;:set y ($y+1)}}}}
赞(3) 打赏
转载请注明出处:Ros资源网 » ROS多线adsl负载掉线后自动修改pcc/nth参数

评论 抢沙发

评论前必须登录!

 

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏