分类目录归档:RouterOS Script

CAPsMAN设置教程

命令行配置AC
/interface bridge add name=APbridge
/interface bridge port add interface=cap1 bridge=APbridge
/ip address add interface=APbridge address=10.10.0.1/24
/ip pool add name=APDHCP ranges=10.10.0.2-10.10.0.254
/ip dhcp-server add name=APDHCP interface=APbridge address-pool=APDHCP lease-time=1d disabled=no
继续阅读

ROS 6.X 流量过高发送邮件。

直接贴代码:

:do {
:local arx
:local btx 
interface monitor-traffic pppoe-out1 once do={
:set arx $"rx-bits-per-second"
:set btx $"tx-bits-per-second" 
}
:local rxud ($arx  /1000000)
:if ($rxud>50) do={
:local smtp "smtp.qq.cn"
:local smtps [:resolve $smtp]
:local ports "25"
:local Mailings "e-mail@qq.cn"
:local pass "123456"
:local Collection "1432868020@qq.com"
:local Themes "警告!AD100M当前下载流量超过50M/s"
/tool e-mail set address=$smtps port=$ports from=$Mailings user=$Mailings password=$pass
/tool e-mail send to=$Collection from=$Mailings subject=$Themes body=("达到预设流量阀值 50Mbit/s\n当前下载流量 $rxud Mbit/s")
:log warning "下载流量超过设置阀值70Mbit/s 当前下载速率$rxud Mbit/s"
}
}