diyernet 发表于 2010-3-12 22:31:45

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
}
}
}

yunwa0429 发表于 2010-3-12 23:37:39

: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 ]}

renzu 发表于 2010-3-13 08:14:44

拿分走人

diyernet 发表于 2010-3-13 13:53:45

2楼的朋友。可不可以说出毛病出在哪?
页: [1]
查看完整版本: 2.9.27 的脚本 3.22部分不能用(应该怎么改?)