AlexKV
April 29, 2015, 8:51pm
1
Where is the issue?
Scheduler and winbox not run the script, but it works when I manual run.
[adm1@ZZMT0] > system scheduler print
Flags: X - disabled
# NAME START-DATE START-TIME INTERVAL ON-EVENT RUN-COUNT
0 schedule-ip apr/30/2015 02:00:00 20h ip10 0
> system script print
Flags: I - invalid
0 name="ip10" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive
source=
ip firewall nat set numbers=0 to-addresses=10.1.1.254
> ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 ;;; NAT
chain=srcnat action=src-nat to-addresses=10.1.1.254 src-address=192.168.10.10 out-interface=WAN1 log=no log-prefix=""
By winbox script ip10 doesn’t run, by scheduler doesn’t run, but manual - run fine!
system script run ip10
Try this:
Give a comment in your ip - firewall - nat rules that want to change by script, example:
ip10
Change your script to this:
:foreach i in=[/ip firewall nat find comment=ip10] do={/ip firewall nat set $i to-addresses=10.1.1.254};
AlexKV:
Where is the issue?
Scheduler and winbox not run the script, but it works when I manual run.
[adm1@ZZMT0] > system scheduler print
Flags: X - disabled
# NAME START-DATE START-TIME INTERVAL ON-EVENT RUN-COUNT
0 schedule-ip apr/30/2015 02:00:00 20h ip10 0
> system script print
Flags: I - invalid
0 name="ip10" owner="admin" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive
source=
ip firewall nat set numbers=0 to-addresses=10.1.1.254
> ip firewall nat print
Flags: X - disabled, I - invalid, D - dynamic
0 ;;; NAT
chain=srcnat action=src-nat to-addresses=10.1.1.254 src-address=192.168.10.10 out-interface=WAN1 log=no log-prefix=""
By winbox script ip10 doesn’t run, by scheduler doesn’t run, but manual - run fine!
system script run ip10
AlexKV
April 30, 2015, 5:38am
4
Thanks, it works!
Can you help me little more? )
I need change IP to-addresses every 2 hours to some new IP (10.1.1.254, 10.1.1.253, 10.1.1.252 and other), and I have 12 scripts/ It can make all at one script?