手机
当前位置:查字典教程网 >网络 >路由器 >ROS常用脚本命令分享
ROS常用脚本命令分享
摘要:ROS一些常用脚本:/ipfirewallconnection{:foreachrin=[find]do={remove$r}}删除所有连接...

ROS 一些常用脚本:

/ ip firewall connection {:foreach r in=[find] do={remove $r}} 删除所有连接

:foreach i in=[/ip firewall filter find action=drop ] do=[/ip firewall filter disable $i] disable防火墙规则

firewall connection tracking syn sendtime 设置成50 rectime 设置成30 减轻syn攻击

/system scheduler add name=reboot interval=24h start-time=06: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 改变默认网关

/queue simple remove [find] 删除所有Simple Queues

:foreach i in=[/ip arp find dynamic=yes ] do={/ip arp add copy-from=$i} ARP绑定(静态ARP)

每个IP加一个simple queue的脚本

:foreach i in [/queue simple find]

do {:put (deleting . ... . [/queue simple get $i name]);

queue simple remove $i;}

for i from 1 to 254

do {

:if ($i!=100)

do {/queue simple add

name=(queue . $i)

limit-at=128000/128000

burst-threshold=384000/192000

max-limit=512000/256000

burst-limit=2000000/512000

burst-time=16s/8s

dst-address=(192.168.0. . $i);

:put (192.168.0. . $i . ... . added)}

}

ROS其他参数:

使用:

WinBox-System-Scripts-+

Name(脚本名程)

Source(脚本)

OK-选择要运行的脚本-Run Script

集体绑定ARP

:foreach i in=[/ip arp find dynamic=yes ] do={/ip arp add copy-from=$i}

集体帮定ARP,这样方便了很多,但是值得注意的是,用这命令绑定之后,要把外网的ARP解除了,要不然会出奇怪问题,反正我是遇见了!

限速脚本:

:for aaa from 2 to 254 do={/queue simple add name=(queue . $aaa) dst-address=(192.168.0. . $aaa) limit-at=0/0 max-limit=2000000/2000000}

说明:

aaa是变量

2 to 254是2~254

192.168.0. . $aaa是IP

上两句加起来是192.168.0.2~192.168.0.254

max-limit=2000000/2000000是上行/下行

删除所有连接

/ ip firewall connection {:foreach r in=[find] do={remove $r}}

disable防火墙规则

:foreach i in=[/ip firewall filter find action=drop ] do=[/ip firewall filter disable $i]

定时重起

/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

定时重起

/system scheduler add name=reboot interval=24h start-time=11:59:00 on-event={/system reboot} disabled=no

/sy reset 恢复路由原始状态

/sy reboot 重启路由

/sy showdown 关机

/sy ide set name=机器名 设置机器名

/export 查看配置

/ip export 查看IP配置

/sy backup 回车 save name=你要设置文件名 LOAD NAME=你要设置文件名 备份路由

/inte***ce print 查看网卡状态

0 X ether1 ether 1500 这个是网卡没有开启

0 R ether1 ether 1500 这个是正常状态

/int en 0 激活0网卡

/int di 0 激活0网卡

/ip fir con print 查看当前所有网络边接

/ip service set www port=81 改变www服务端口为81

/ip hotspot user add name=user1 password=1 增加用户

ROUTERos改本机网卡MAC的方法:

interface ethernet> set (网卡名) mac-address=(你想要的MAC)

机房经常提出这种要求,这节课要求上网,下节课就要求断网。以前就是拨网线,后来用了这个就不用了。并且可以上网时,也能控制学生上联众或者QQ。课后机房开放时即要能上网,还要能上QQ,把这些策略禁止掉就行了。

【ROS常用脚本命令分享】相关文章:

简单的猫和路由器连接安装方法分享

非常经典的30个路由器的问题收集分享

了解无线路由器组建无线网络应该注意的几个问题

连接贝尔金无线路由器时需要注意的几个常见问题

关于光猫连接无线路由设置经验分享

FAST迅捷路由器的安全保护措施分享

Cisco IP SLA 配置实例分享

分享史上最全华为路由器交换机配置命令大合集

思科路由器配置时的必需命令介绍

无线AP和无线路由有什么区别能和ADSL一起使用吗

精品推荐
分类导航