Page 1 of 1

OpenVPN client connecting to dynamic dns host

Posted: Tue Jul 03, 2012 6:22 pm
by tesna
I have openvpn client running sucessfully on my RouterBoard 751G. But I'm facing a little problem. The openvpn server (not an routeros machine) has dynamic IP which has its A record automatically updated (dynamic dns, I use afraid.org) if the IP is changed. I have several remote location using dd-wrt and tomato firmware with openvpn enabled and has able to re-establishes connection automatically if the openvpn server IP is changed.

But not the case with RouterBoard. It appears when I enter a hostname in the connect to field its automatically convert it to the current A record of that DNS record, so when the dns record is updated routeros still trying to connect with the same IP without lookingup the dns records. Is there any way to fix this?

Re: OpenVPN client connecting to dynamic dns host

Posted: Thu Jul 05, 2012 12:09 am
by bassist
Yeah, I found this for a few fields where I would have liked to of put the DNS record in there rather than the IP address.

Re: OpenVPN client connecting to dynamic dns host

Posted: Thu Jul 05, 2012 5:54 pm
by Feklar
There is currently no magic way to use host names in MikroTik when using services like that. What you can do however is script it to update every so often.
    :local DDNSip 0;
    :set DDNSip [:resolve host.afraid.org]
    interface ovpn-client set connect-to=$DDNSip
Run this every so often to update the IP address. You could also make the script more sophisticated by storing the host IP in a global variable and only updating the openvpn client when it changes. Look at some user supplied scripts to see how to do this, namely the DDNS update scripts.

Re: OpenVPN client connecting to dynamic dns host

Posted: Sat Dec 08, 2012 3:15 pm
by giuseppe01
i have same problem. But the simple script don't work.
Can you help me?
thanks.

Re: OpenVPN client connecting to dynamic dns host

Posted: Fri Dec 14, 2012 8:11 pm
by giuseppe01
i'm solved
:local DDNSip 0; :set DDNSip [:resolve "quetepasa.dyndns.org"]; interface ovpn-client set connect-to=$DDNSip numbers=0
just add number connection