蓝色动力网络

 找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 1857|回复: 0

实用脚本 ros3.30 PCC断线自动更改脚本!

[复制链接]
发表于 2012-1-1 14:51:59 | 显示全部楼层 |阅读模式
  1. # 多条ADSL断线后 自动更改PCC脚本!===========
  2. # X为线路数
  3. :global assign
  4. :global new
  5. :global status
  6. :global x
  7. :gl y
  8. :gl z
  9. :set x 4
  10. :set z -1
  11. :for i from=1 to=$x do={
  12. :set status [/interface get [/interface find  name=("pppoe-out" . $i)] running]
  13. :if ($status=true) do={
  14. :set y [:len [/interface pppoe-client find running=yes]]
  15. :set z ($z+1)
  16. /ip fir man en [find comment=$i]
  17. /ip fir man set [find comment=$i] per-connection-classifier=("both-addresses:".$y."/".$z)
  18. #:put ("OK Running!".$y)
  19. #:set new [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
  20. #:set new [:pick $new 0 ([:len $new] -3)];\
  21. # /interface set [find name=("wan" . $i)] comment=("\CD\E2\CD\F8" . $i . "\B2\A6\BA\C5\B3\C9\B9\A6!IP: " . $new)
  22. } \
  23. #else={:put ("NO runing plese check! " . $i)}
  24. else={/ip fir man dis [find comment=$i]}
  25. }
复制代码
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

蓝色动力网络微信平台
网站管理,业务合作联系邮箱: admin#lansedongli.com    QQ:13412492 限网站业务问题.
网站帐号、密码、密保找回请使用注册邮箱,发送邮件至 password#lansedongli.com ,否则不予受理.
免责声明:本论坛所有文字和图片仅代表其个人观点.
本站某些资料或文章来自于互联网,不代表本站观点,如果侵犯了您的权益,请来信告知,我们会在三天内删除.
为了给大家一个更好的交流场所,请勿在本论坛发表与中华人民共和国法律相抵触的言论,请合作,谢谢!
Copyright © 2007-2019 Corporation Powered by网吧系统 版权所有    转载请注明!
浙ICP备11043737号 程序:Discuz! x3.4

湘公网安备 43018102000145号

手机版|Archiver|蓝色动力网络   

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