2.9.27 的脚本 3.22部分不能用(应该怎么改?)
我的现象是 这个脚本没有效果:local assign-address
:local new-address
:local status
:local x
:set x 2
: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 [:find $new-address "/"]]
:set assign-address address]
:set assign-address [:pick $assign-address 0 [:find $assign-address "/"]]
:if ($assign-address != $new-address) do={
/ip address set address=$new-address network=$new-address broadcast=$new-address
/ip route set gateway=$new-address
/ip fir nat set to-address=$new-address
}
}
} :local newaddress
:local status
:local x
:set x 3
:for i from=1 to=$x do={
:set status running]
:if ($status=true) do={
:set newaddress address]
:set newaddress [:pick $newaddress 0 ([:len $newaddress] -3)]
:set assignip address]
:set assignip [:pick $assignip 0 ([:len $assignip] -3)]
:if ($assignip != $newaddress) do={ /ip address set address=$newaddress network=$newaddress broadcast=$newaddress
/ip route set gateway=$newaddress
/ip fir nat set to-addresses=$newaddress
/ip route set gateway=$newaddress
}
}
}
:for i from=1 to=$x do={:set status running ]} 拿分走人 2楼的朋友。可不可以说出毛病出在哪?
页:
[1]