Community discussions

MikroTik App
 
maara
newbie
Topic Author
Posts: 44
Joined: Fri Jun 10, 2011 8:42 am

Script trigger after PPP dialout

Sun Jun 12, 2016 12:35 pm

Hi,

I am using a PPTP connection where my mikrotik acts as a client.
The connection is not very reliable and gets restarted occasionally. I am ok with the restarts but the problem is that I am having some mangle rules which get screwed after the vpn is reconnected (not critical but a simple rule Change MSS is replaced by 2 Change MSS rules with nonsence parameters automatically.....).
I can get around it quite easily using a script but how do I make the script to trigger automatically after the reconnect? - its a nonsense to have it scheduled to run lets say every 10 minutes and let it check the the status and run the commands for the rules if needed as the dropout might occur in matter of days....
Is there any way how could I trigger simply after the dioulout is finished as its the only point in time where run of this script makes sense...?

Thanks!
 
User avatar
rcourtney
Frequent Visitor
Frequent Visitor
Posts: 61
Joined: Wed May 22, 2013 10:55 pm

Re: Script trigger after PPP dialout

Thu Jun 16, 2016 2:40 am

Can you try single pinging a destination PPP address using a scheduled script.
If the ping times out, set an environment flag.
On next ping that you get a response and the flag is set,  make your changes and clear the flag.
 
User avatar
ZeroByte
Forum Guru
Forum Guru
Posts: 4047
Joined: Wed May 11, 2011 6:08 pm

Re: Script trigger after PPP dialout

Thu Jun 16, 2016 3:39 am

Event-triggered scripts are very useful- I wish ROS featured many more of them. Scheduled tasks that watch for changes really annoy me (especially when folks use them and an automatic dynamic adaptive configuration is easily doable)

Another obvious use of an on-connect script would be to update DynDNS entries. (And on-lease-acquire/renew for DHCP client)
 
maara
newbie
Topic Author
Posts: 44
Joined: Fri Jun 10, 2011 8:42 am

Re: Script trigger after PPP dialout

Thu Jun 16, 2016 10:04 am

The scheduled ping is a solution but still - its a scheduled workaround instead of a simple event base trigger :-(
So really no hook there?

Odesláno z mého SM-G920F pomocí Tapatalk

Who is online

Users browsing this forum: No registered users and 5 guests