Community discussions

MikroTik App
 
donmirko
just joined
Topic Author
Posts: 18
Joined: Tue Oct 06, 2009 3:02 pm

VPN PPTP-Client connect-to problem

Mon Dec 07, 2009 10:02 am

I have setup VPN PPTP server for my several locations. All have ADSL connection and DynamicDNS domain names. Connections are nailed-up. My problem is when I set up PPTP-Client like this
name="connection" max-mtu=1460 max-mru=1460 mrru=disabled connect-to=user1.dyndns.org user="user1" password="passw234" 
      profile=default-encryption add-default-route=no dial-on-demand=no allow=pap,chap,mschap1,mschap2
every time when my IP address is changed on server location, this router can't connect on server again. When I enter connect-to field again router resolve it in IP and save that address instead domain name.

So is any way to save domain name without resolve, and then my problem will be solved. If some script can change this record every time when DDNS record is updated, I think that can work fine to.
Last edited by donmirko on Mon Dec 07, 2009 12:12 pm, edited 2 times in total.
As the philosopher Jagger once said, "You can't always get what you want"
----- Ambition is the last refuge of failure -----
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6080
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: VPN PPTP-Client connect-to problem

Mon Dec 07, 2009 10:14 am

You have to run a scheduled script, here is an example
http://wiki.mikrotik.com/wiki/Scripting ... _host-name
 
donmirko
just joined
Topic Author
Posts: 18
Joined: Tue Oct 06, 2009 3:02 pm

Re: VPN PPTP-Client connect-to problem

Mon Dec 07, 2009 11:41 am

I tried to set up my script, but I'm not sure that I succeed, probably because I'm rookie in this scripting.
Can you write me a script for dates I give you in post?

Thanks in advance!!!
As the philosopher Jagger once said, "You can't always get what you want"
----- Ambition is the last refuge of failure -----
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6080
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: VPN PPTP-Client connect-to problem

Mon Dec 07, 2009 12:50 pm

:local resolvedIP [:resolve "user1.dyndns.org "];
:local ID [/interface pptp-client find name="connection"];
:local currentIP [/interface pptp-client get $ID connect-to];

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

Who is online

Users browsing this forum: Google [Bot], sirlindqvist and 147 guests