pptp connection 1-pinging fail do disconnect then reconnect

hi guys this is my first time doing scripting i m totally new on it

my pptp connection hanging every 3-5 hours
i have to disconnect then reconnect the then it works

from 1 year i m keep doing those clicks dayily

is there a automized script could fix this??

1st pinging the main pptp gateway (server ip which is static) if fail do disconnect and reconnect pptp-conection
please guys i need to travel in vication :slight_smile:

Use netwatch,
script is very simple ‘interface pptp-client disable/enable pppt-out1’.

good but sometimes even if i reconnect doesnt work so the netwatch will still down status


i want the script to keep trying untill the status become up


is there break command in the scripting

Put something like this in a script (named something like pptp-reset):

:local PPTP-INT [/int pptp-client find name=XXXX]

:while true do={
     /int pptp-client disable $PPTP-INT
     /int pptp-client enable $PPTP-INT
     :delay 10
}

Then in netwatch, do something like this:

On Down:

/system script run pptp-reset

On Up:

:local JOB [/system script job find script=pptp-reset]
/system script job remove $JOB

–Eric

gr8 work :smiley:

ok this time it will be hard script

here its my problem

i have pptp with dynamic ip
and i want to make a dmz host for the mail server

the problem that mikrotik seems doesnt support DMZ with dynamic ip i have to inter the ip manully

i want a script the on UP (using netrwatch)
i want to to change the dstnat ip to the pptp connection ip
is it possable??

Why not just leave the (match) address out of the dst-nat rule?

Match on incoming interface, protocol, and port; and you should be good to go.

–Eric