Resolve dyndns name at PPTP-Client (solved)

Hello,

I have setup in my rb750g a PPTP-Client to connect in my office via VPN.
In my office i have a draytek vigor 2820 with dyndns account.

In Dial Out → Connect To → i put my dyndns name for example “mydydns.ath.cx”

I saw this script in wiki, but this is for radius.

http://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Resolve_host-name

What should i do for pptp-client?

Is this correct?

/system script add name="resolver" source= {

:local resolvedIP [:resolve "mydydns.ath.cx"];
:local pptpID [/interface pptp-client find comment="myPPTP"];
:local currentIP [/interface pptp-client get $pptpID connect-to];

:if ($resolvedIP != $currentIP) do={
   /interface pptp-client set $pptpID connect-to=$resolvedIP;
   /log info "dyndns ip updated";
}

}

Yes, seems to be correct.

Thank you mrz, i’ll try it.


One more question.

In vigor 2820 i put a dyndns account with username and password, and then i make remote dial in users with username and password.

Is it possible to do it with rb750g?

I’am very interesting for this because vigors are much more expensive and i use them a lot. I put them in all of my clients in order to have remote pptp vpn access in their networks.

Yes, you can update dyndns with a script, see this article
http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_dynDNS

Ok, thank you!