Hello Everyone, I am using mikrotik crs328p. What i want to do achieve is
if interface=ether1 is enable and in running state then interface=ether2 should be disabled
if interface=ether1 is enabled but link status is down then interface=ether2 should be enabled automatically
if the interface=ether1 comes in running state back then interface=ether=2 should go in disabled state
can i achieve this using script and scheduler
if yes i am unable create a script that works
any help would be much appreciated.
Very Basic Script-Exemple…
:if ((![/interface ethernet get ether1 disabled]) && ([/interface ethernet get ether1 running])) do={
# Interface is Enabled AND Interface is Running
/interface ethernet set ether2 disabled=yes
} else={:if ((![/interface ethernet get ether1 disabled]) && (![/interface ethernet get ether1 running])) do={
# Interface is Enabled and NOT Running
/interface ethernet set ether2 disabled=no
}
}
Same code, just rewritten some:
/interface ethernet
:if ((![get ether1 disabled]) && ([get ether1 running])) do={
# Interface is Enabled AND Interface is Running
set ether2 disabled=yes
} else={
:if ((![get ether1 disabled]) && (![get ether1 running])) do={
# Interface is Enabled and NOT Running
set ether2 disabled=no
}
}
Thank you @Jotne
It really makes the Script less bloated and easier to read!!