Community discussions

MikroTik App
 
AZak
just joined
Topic Author
Posts: 13
Joined: Wed Jul 17, 2019 11:08 am

Script to Enable Mangle Rule When route is unreachable

Mon Jun 27, 2022 1:15 pm

Dear All,

I kindly need help in configuring a script that enables an Mangle rule when static default route is unreachable,

Thanks in advance!
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Script to Enable Mangle Rule When route is unreachable

Tue Jun 28, 2022 7:57 am

While such a script is quite an easy one, there is no way to trigger it by the change of the default route availability - you have to use some kind of scheduling or other triggering mechanism (/tool netwatch). But the script you ask for is just a method to reach some actual goal; can you describe that actual goal? Maybe it could be reached without the script?
 
AZak
just joined
Topic Author
Posts: 13
Joined: Wed Jul 17, 2019 11:08 am

Re: Script to Enable Mangle Rule When route is unreachable

Thu Jun 30, 2022 10:18 pm

While such a script is quite an easy one, there is no way to trigger it by the change of the default route availability - you have to use some kind of scheduling or other triggering mechanism (/tool netwatch). But the script you ask for is just a method to reach some actual goal; can you describe that actual goal? Maybe it could be reached without the script?
I have 2 ISPs, one with public IP and the other is DHCP. Sometimes the ISP with Public IP face some issues, so I want to remove the route mark on the DHCP Internet and enable a mangle rule on a private IP to be able to access remotely using anydesk or any other remote desktop application
 
sindy
Forum Guru
Forum Guru
Posts: 10206
Joined: Mon Dec 04, 2017 9:19 pm

Re: Script to Enable Mangle Rule When route is unreachable

Thu Jun 30, 2022 10:39 pm

For that, it should be sufficient to use the automatic failover based on recursive next-hop search. With this in place, Anydesk/TeamViewer/whatever software will re-establish the connection to the cloud once the primary WAN fails, and it will also re-establish the connection via the primary WAN again once it recovers (unless it uses UDP, as that would require additional measures).
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 19321
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: Script to Enable Mangle Rule When route is unreachable

Thu Jun 30, 2022 11:20 pm

For that, it should be sufficient to use the automatic failover based on recursive next-hop search. With this in place, Anydesk/TeamViewer/whatever software will re-establish the connection to the cloud once the primary WAN fails, and it will also re-establish the connection via the primary WAN again once it recovers (unless it uses UDP, as that would require additional measures).
Or if that thread makes you feel sick........
Read sub para I. here ---> viewtopic.php?t=182373

Who is online

Users browsing this forum: Experimentator, johnb175a, Sob, TeWe and 59 guests