ros脚本
更改标记为cnc的路由表(更改的包括0.0.0.0/0和后边的路由表)
/ip route set [/ip route find comment=cnc] dst-address=0.0.0.0/0 gateway=221.1.214.209 scope=255 target-scope=10 \
comment="cnc" disabled=no
更改标记为cnc的路由表为10.0.2.1
/ip route set [/ip route find comment=cnc] gateway 10.0.2.1
定时重起
/system scheduler add name=reboot interval=24h start-time=11:59:00 on-event={/system reboot} disabled=no
改变默认网关
/ip route set [/ip route find dst-address=0.0.0.0/0] gateway=xxx.xxx.xxx.xxx
ROS定时重起
/system scheduler add name=reboot interval=24h start-time=06:59:00 on-event={/system reboot} disabled=no
开启标记为cnc的路由条目
/ip route set [/ip route find comment=cnc] disabled=no
屏蔽标记为cnc的路由条目
/ip route set [/ip route find comment=cnc] disabled=yes
自动获取绑定arp
:foreach szwm in=[/ip arp find dynamic=yes int=lan] do=[/ip arp add copy-from=$szwm]
屏蔽标记为hh的接口
/int set [/interface find comment=hh] dis=yes
打开标记为hh的接口
/int set [/interface find comment=hh] dis=no
屏蔽名称为tel的网卡
/int dis [/int find name="tel"] 打开为en
白天开PPPOE
/ppp secret en [find comment=4]
晚上关PPPOE
/ppp secret disable [find comment=4]
开网站
/ip firewall nat en [find comment=dd]
关网站
/ip firewall nat dis [find comment=dd]
两条adsl的均衡负载。
先赋予adsl自动获取ip的脚本
:local assign-address
:local new-address
:local status
:local x
:set x 2
:for i from=1 to=$x do={
:set status [/interface get [/interface find name=("pppoe-out" . $i)] running]
:if ($status=true) do={
:set new-address [/ip address get [/ip address find dynamic=yes interface=("pppoe-out" . $i)] address]
:set new-address [:pick $new-address 0 ([:len $new-address] -3)]
:set assign-address [/ip address get [/ip address find dynamic=no interface=("pppoe-out" . $i)] address]
:set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
:if ($assign-address != $new-address) do={ /ip address set [/ip address find comment=$i] address=$new-address network=$new-address broadcast=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
/ip fir nat set [/ip fir nat find comment=$i] to-addresses=$new-address
/ip route set [/ip route find comment=$i] gateway=$new-address
}
}
}
赋予标记为“lan”的内网网卡ip为192.168.1.250
/ip address add address=192.168.1.250/255.255.255.0 interface=lan comment=lan
赋予DNS为202.102.128.68和202.102.134.68
/ip dns set primary-dns=202.102.128.68 secondary-dns=202.102.134.68 allow-remote-requests=yes
修改mss值为clamp to pmtu
/ip firewall mangle add chain=forward protocol=tcp tcp-flags=syn action=change-mss new-mss=clamp to pmtu
建立pppoe-client(adsl拨号 用户名为hzjc001密
ROS 脚本大全(通用) 一:限速脚本 :for wbsz from 1 to 254 do={/queue simple add name=(wbsz . $wbsz) dst-address=(192.168.0. . $wbsz) limit-...
ros 脚本详细解释 +++ 在3.22下:put ((221.232.119.228 & 255.255.255.0)./24) 并不能得到221.232.119.0/24 正确的方法是:put ((221.232.119....
ROS封杀常用P2P策略脚本: / ip firewall filter add chain=input protocol=udp dst-port=137-138 action=drop comment="drop udp137-138" # 讯雷 add chain=...
ROS 脚本大全(可通用) 本文总结了一些常用的 ROS 脚本,希望对大家有帮助! 禁止 ip 上网脚本: :for aaa from 2 to 254 do={/ip firewall filter chain=forw...
ROS脚本命令详解_IT/计算机_专业资料。四种变量 global - 定义全局变量, 可以要所有的脚本中调用共享 local - 定义本地变量,只能在其所要的脚本下调用,不能被其...
(做完ROS后,先不绑,打开所有电脑后,在执行下面的命令。直接复制到WINBOX终端运行就可以了) / interface ethernet set lan arp=reply-only 解除ARP绑定 lan 为...
ROS脚本语法使用教程_计算机硬件及网络_IT/计算机_专业资料。ROS脚本语法使用教程 ,快速学习ROS脚本手册:脚本编写 1 手册:脚本编写 适用RouterOS版本: v3, v4及以上...
ros防火墙脚本_计算机硬件及网络_IT/计算机_专业资料。企业专用ros防火墙脚本,经测试稳定ROS防火墙脚本 经常需要用的ros脚本的朋友可以看下 # feb/18/2006 22:28:...
ROS基本防护脚本_IT/计算机_专业资料。简单的一些文档本适用于 ROS 2.9.2.7 保存以下脚本后缀改为 rsc,用 winbox 上传到路由上, 用命令:import 文件名 导入...
热门文档