Page 1 of 1

Script trigger after PPP dialout

Posted: Sun Jun 12, 2016 12:35 pm
by maara
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!

Re: Script trigger after PPP dialout

Posted: Thu Jun 16, 2016 2:40 am
by rcourtney
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.

Re: Script trigger after PPP dialout

Posted: Thu Jun 16, 2016 3:39 am
by ZeroByte
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)

Re: Script trigger after PPP dialout

Posted: Thu Jun 16, 2016 10:04 am
by maara
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