用了自动获取网关IP脚本不定时掉线,大家帮忙看看
:local assign-address:local new-address
:local status
:local x
:set x 5
:for i from=1 to=$x do={
:set status running]
:if ($status=true) do={
:set new-address address]
:set new-address [:pick $new-address 0 ([:len $new-address] -3)]
:set assign-address address]
:set assign-address [:pick $assign-address 0 ([:len $assign-address] -3)]
:if ($assign-address != $new-address) do={
/ip address set address=$new-address network=$new-address broadcast=$new-address
/ip route set gateway=$new-address
}
}
}
页:
[1]