Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :local probeIP "77.88.8.8";
- :local probeMARK "to-maximus-test";
- :local routeCOM "maximus";
- :local p [ping $probeIP routing-table=$probeMARK count=5]; :put $p;
- # if ping failed and route is not disabled, disable it
- local crd [:len [/ip route find where comment=$routeCOM disabled=no]];
- :if ($p = 0 && $crd > 0 ) do={
- /log error "Routing via R marked as $probeMARK - is fail! Disabling route!";
- /ip route disable [find where comment=$routeCOM];
- }
- # if ping succeeded and route is not enabled, enable it
- local cre [:len [/ip route find where comment=$routeCOM disabled=yes]];
- :if ($p = 5 && $cre > 0 ) do={
- /log error "Routing via R marked as $probeMARK - is success! Enabling route!";
- /ip route enable [find where comment=$routeCOM];
- }
Advertisement
Add Comment
Please, Sign In to add comment