Mikrotik automatically switch PPPOE dialup

molesza

Active Member
Joined
Jan 24, 2012
Messages
81
Reaction score
3
I have a mikrotik that dials out over a modem connected to ether 1. I have two accounts. One with afrihost capped and a vox bolt on uncapped. I would like to use the capped account from 6am to 6pm and then have the mikrotik automatically disconnect that account and connect to my uncapped account at 6pm. Obviously swap back again in the morning.

Or is there a way that both accounts can be dialed into and then change routing at those times to the specific pppoe account?
 
Easier to just enable/disable the interface, you can do it with routing but that can get a bit complicated

Name your ppp interface vox and afrihost

/system script
add name=afrihost source={
/interface disable vox;
/interface enable afrihost;
};

/system script
add name=vox source={
/interface disable afrihost;
/interface enable vox
}

/system scheduler
add name="vox_connect" on-event=vox start-date=jan/01/2006 start-time=18:00:00 interval=1d comment="enable vox" disabled=no

/system scheduler
add name="afrihost_connect" on-event=afrihost start-date=jan/01/2006 start-time=06:00:00 interval=1d comment="enable vox" disabled=no
 
Last edited:
Easier to just enable/disable the interface, you can do it with routing but that can get a bit complicated

Name your ppp interface vox and afrihost

/system script
add name=afrihost source={
/interface disable vox;
/interface enable afrihost;
};

/system script
add name=vox source={
/interface disable afrihost;
/interface enable vox
}

/system scheduler
add name="vox_connect" on-event=vox start-date=jan/01/2006 start-time=18:00:00 interval=1d comment="enable vox" disabled=no

/system scheduler
add name="afrihost_connect" on-event=afrihost start-date=jan/01/2006 start-time=06:00:00 interval=1d comment="enable vox" disabled=no

Great stuff! Thanks for your help!
 
The scripts work perfectly! All I have to do now is wait and make sure it works at 6pm.

Can this script be changed so that on friday at 6pm it changes to vox and then only changes back to afrihost on monday 6am? Just now realised that the uncapped bolt on is good for all weekend!
 
Yes you can with a workaround, Mikrotik cannot schedule only on day of week, so what we do is we run the script each day and only enable/disable mon-friday, math is our friend and we use him to calculate the day of week. Lucky for us the work was shared.

copy the following script
http://wiki.mikrotik.com/wiki/Script_to_find_the_day_of_the_week

At the end add

:if ($result = "sat" || $result = "sun") do={
:log info "I am not going to do anything, it is weekend!";
} else={
/interface disable isp1
/interface enable isp2
}

do the same for both scripts, changes isp1/2 to correct values

The idea
mon - friday change interfaces
sat nothing is changed and since it is on the uncapped account all should be fine

Or you could do the following
http://forum.mikrotik.com/viewtopic.php?t=1853
 
Last edited:
Yes you can with a workaround, Mikrotik cannot schedule only on day of week, so what we do is we run the script each day and only enable/disable mon-friday, math is our friend and we use him to calculate the day of week. Lucky for us the work was shared.

copy the following script
http://wiki.mikrotik.com/wiki/Script_to_find_the_day_of_the_week

At the end add

:if ($result = "sat" || $result = "sun") do={
:log info "I am not going to do anything, it is weekend!";
} else={
/interface disable isp1
/interface enable isp2
}

do the same for both scripts, changes isp1/2 to correct values

The idea
mon - friday change interfaces
sat nothing is changed and since it is on the uncapped account all should be fine

Or you could do the following
http://forum.mikrotik.com/viewtopic.php?t=1853

What a legend! Thank you very much. If I had of asked the same question on the mikrotik forums I probably would have got a reply with a link to a manual. I really appreciate your help!
 
Sorry for the hijack here guys but can anybody point me in the direction of a mikrotik device purchasable in SA that can do this?It looks awesome
 
Thanks guys.Any particular model I should look out for specifically?
Decide want you want to do with it then start culling the list.

e..g.
. wireless (yes/no)
. Ethernet speed (10/100 or 10/100/1000)
. power over ethernet (yes/no)
. must have a case (yes/no)

Just filling in the above questions should cut down the list to 1/2 choices. Then it is up to what your wallet is willing to part with.
 
Top
Sign up to the MyBroadband newsletter
X