Community discussions

MikroTik App
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

auto modify the 0 route

Sat Mar 15, 2014 12:13 pm

I need help with something

I need a script that will identify the 0.0.0.0/0 route that all the default traffic is going out on, read the route and see what interface it is using and then be able to change that to a different interface depending on what it finds
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12558
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: auto modify the 0 route

Sat Mar 15, 2014 1:00 pm

What do you want obtain with that?
Last edited by rextended on Mon Mar 20, 2023 5:55 pm, edited 1 time in total.
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

Re: auto modify the 0 route

Sat Mar 15, 2014 8:34 pm

actually scratch my last request, it may be too complicated. i'm thinking of a far simpler idea but its going o require a less variable volatile system.
Is there a way to get a script to read and write a variable to a txt file
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12558
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: auto modify the 0 route

Sat Mar 15, 2014 9:47 pm

Yes

WARNING!!!
On RouterOS the maxmimum length of a String variable are 4096 Byte
also the maximum dimension of one file used a variable storage are 4096 Byte
and any Array have maximum size of "the sum of lenght of all single elements on Array" + "number of Array elements" <= 4096 Byte!!!
Last edited by rextended on Mon Mar 20, 2023 5:56 pm, edited 1 time in total.
 
efaden
Forum Guru
Forum Guru
Posts: 1708
Joined: Sat Mar 30, 2013 1:55 am
Location: New York, USA

Re: auto modify the 0 route

Sat Mar 15, 2014 10:13 pm

actually scratch my last request, it may be too complicated. i'm thinking of a far simpler idea but its going o require a less variable volatile system.
Is there a way to get a script to read and write a variable to a txt file
What exactly are you trying to do?
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

Re: auto modify the 0 route

Sun Mar 16, 2014 7:35 am

This is what I'm trying to do.

My ucapped adsl gets throttled if abused too much but that throttle is based on a 10 day rolling window. So I have 2 of these account and roll them every 10 days.

Basically I was going to have both the accounts dialed and have the script change the 0 routes dst every 10 days but then I came up with a better idea. Have one disabled and the other enabled. This way I have two 0 routes and won't conflict. Then have the script just diable and enable the accounts however it would need to be sure of what account it enable last even if the router were to lose power
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12558
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: auto modify the 0 route

Sun Mar 16, 2014 10:27 am

Why do not you have asked right away what you want?

For be disabled or enabled the rules on route list must be static.
Last edited by rextended on Mon Mar 20, 2023 5:56 pm, edited 1 time in total.
 
User avatar
shadowskippie
Member Candidate
Member Candidate
Topic Author
Posts: 213
Joined: Tue Dec 21, 2010 6:20 pm

Re: auto modify the 0 route

Sun Mar 16, 2014 3:36 pm

Because this time I went straight to the point. Normally I try to explain what I'm doing and still confuse ppl so I tried something different.

Eitherway I open my mouth and ppl get confused

Who is online

Users browsing this forum: No registered users and 17 guests