Page 1 of 1

L2tp o PPTP -server with dynamic ip

Posted: Mon Mar 29, 2010 3:01 am
by manoloon
People , good morning , i have a problem, maybe is a sillyness but meanwhile is a problem, I am working in a two point offices and I want to connect them with a vpn L2TP would be the best but I can work even with PPTP , but the problem is that the command : connect-to= has to be a ip , it doesnt accept an url like office.changeip.net . someone knows how to deal with this? Thanx in advance

Re: L2tp o PPTP -server with dynamic ip

Posted: Mon Mar 29, 2010 9:58 am
by mrz
You have to write a script and run it from time to time

http://wiki.mikrotik.com/wiki/Manual:Sc ... _host-name

Re: L2tp o PPTP -server with dynamic ip

Posted: Mon Mar 29, 2010 7:54 pm
by manoloon
Thanx , this is the script made for this task : thanks to the support people of mikrotik !
the script :
:local resolvedIP [:resolve "xxxx.changeip.net"];
:local l2tpid [/interface find comment="l2tpid"];
:local currentIP [/interface l2tp-client get l2tpid connect-to];

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

Index : l2tpid : is the comment name that I gave to the interface