Page 1 of 1

auto modify the 0 route

Posted: Sat Mar 15, 2014 12:13 pm
by shadowskippie
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

Re: auto modify the 0 route

Posted: Sat Mar 15, 2014 1:00 pm
by rextended
What do you want obtain with that?

Re: auto modify the 0 route

Posted: Sat Mar 15, 2014 8:34 pm
by shadowskippie
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

Re: auto modify the 0 route

Posted: Sat Mar 15, 2014 9:47 pm
by rextended
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!!!

Re: auto modify the 0 route

Posted: Sat Mar 15, 2014 10:13 pm
by efaden
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?

Re: auto modify the 0 route

Posted: Sun Mar 16, 2014 7:35 am
by shadowskippie
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

Re: auto modify the 0 route

Posted: Sun Mar 16, 2014 10:27 am
by rextended
Why do not you have asked right away what you want?

For be disabled or enabled the rules on route list must be static.

Re: auto modify the 0 route

Posted: Sun Mar 16, 2014 3:36 pm
by shadowskippie
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