请问ROS软路由怎么进行双线切换,怎么限速。。。
发布网友
发布时间:2022-05-26 08:38
我来回答
共1个回答
热心网友
时间:2023-10-09 17:55
ROS 2.9.27做成双线后的自动切换的脚本
/ system script
add name="dxup" source="/ip route set \[/ip route find comment=tel\] \
gateway=电信网关;
\n/ip route set \[/ip route find comment=tel\] \
disable=no;" policy=ftp,reboot,read,write,policy,test,winbox,password
add name="cncup" source="/ip route enable \[/ip route find \
gateway=网通网关\]" \
policy=ftp,reboot,read,write,policy,test,winbox,password
add name="dxdown" source="/ip route set \[/ip route find comment=tel\] \
gateway=网通网关" \
policy=ftp,reboot,read,write,policy,test,winbox,password
add name="cncdown" source="/ip route disable \[/ip route find \
gateway=网通网关\]" \
policy=ftp,reboot,read,write,policy,test,winbox,password
复制上面的脚本在WINBOX中选new terminal 中右键paste回车就可以了~~
回车一下。。检测线路状态策略添好了~~
/ system script
;线程脚本
add name="a" source=":for aaa from 1 to 35 do={/ip firewall filter add \
chain=forward src-address=\(192.168.1. . \$aaa\) protocol=tcp \
connection-limit=50,32 action=drop}" \
policy=ftp,reboot,read,write,policy,test,winbox,password
------------------------------------------------------------------------------
;限速脚本
add name="A" source=":for aaa from 1 to 20 do={/queue simple add \
name=\(0_ . \$aaa\) dst-address=\(192.168.7. . \$aaa\) interface=ether1 \
limit-at=256000/64000 max-limit=512000/128000 burst-limit=1024000/256000 \
burst-threshold=512000/128000 burst-time=50s/50s }" \
policy=ftp,reboot,read,write,policy,test,winbox,password
------------------------------------------------------------------------------
;防ARP,自动COPY
add name="IP" source=":foreach i in=\[/ip arp find dynamic=yes \] do={/ip arp \
add copy-from=\$i}\n\n" \
policy=ftp,reboot,read,write,policy,test,winbox,password
------------------------------------------------------------------------------
*速度脚本
/system/script
:for aaa from 5 to 20 do={/queue simple add name=(A . $aaa) dst-address=(192.168.1. . $aaa) interface=all limit-at=1000000/64000 max-limit=1000000/128000 burst-limit=1024000/256000 burst-threshold=512000/128000 burst-time=50s/50s }