Hi,
I would like to establish a VPN connection between two MikroTik Routers v2.9.6 over Dynamic Public IP address because in my senario i could not get Static IP Address from my ISP. Thanx…
please upgrade to the latest version
THG
anything: eoip, pptp, etc. the problem is dynamic IP: afair, v2.9 doesn’t support ‘resolve’ command
Are you sure that RouterOS 2.9 cannot resolve IP addresses? I’m pretty sure that v2.8 could do that, and even earlier versions. Dynamic IP addresses is not a problem since MikroTik added scripting to RouterOS. There is plenty of script examples to resolve addresses.
whoops ))
But i am struggling due to dynamically change in my Public IP address.
Suppose: on Location A, i have ip address 115.186.3.238 which is assigned by DHCP server of ISP “X”
on Location B, i have ip Address 116.16.25.221 which is assigned by DHCP Server of ISP “Y”
Guide me that what should i do when both ip addresses changed by respective ISP’s.
Please Recommend a Script that can get current IP & replace it in Eoip Tunnel Settings etc…
Waiting for Experts… Views
Here is a script that updates the dynamic IP address. Change the interface name and the dynamic dns address (the first two lines). Add this script to /system/scripts and then set the time in the scheduler how often you want to run it.
Hint:
:global pptp-interface “pptp-out1”
:global pptp-connect-host “dynamic-dns-address.com”
This script only works in RouterOS version 2.9.x.
:global pptp-interface "pptp-out1"
:global pptp-connect-host "dynamic-dns-address.com"
:global pptp-host-ip [:resolve $pptp-connect-host]
:global pptp-connect-to [/interface pptp-client get $pptp-interface connect-to]
:if ($pptp-host-ip != $pptp-connect-to) do={
:log info "Updating VPN Server IP address"
/interface pptp-client set $pptp-interface connect-to=$pptp-host-ip}
Here is a simple script for RouterOS 3.x.
Same procedure as in the previous script, just modify the first two lines.
Hint:
:local interface “pptp-out1”
:local dyndns “dynamic-dns-address.com”
:local interface "pptp-out1"
:local dyndns "dynamic-dns-address.com"
:if ([interface pptp-client get $interface running] = false) do={
/ip dns cache flush
:local "current-ip" [:resolve $dyndns]
:local "old-ip" [/interface pptp-client get [/interface pptp-client find name="$interface"] connect-to]
:if ($"current-ip" != $"old-ip") do= {
:log info "VPN Server changed IP address from $"old-ip" to $"current-ip""
/interface pptp-client set [/interface pptp-client find name="$interface"] connect-to=$"current-ip"}}
Hello boys,
this is now my first post here!
After 1 week reading and testing @ my mikrotik RB750 my VPN-pptp Server is always running very stable.
My Problem now is that the pptp-out1 client can’t Resolve dyndns-IP to connect my Server.
When i tiped in Dial - Out blabla.dyndns.org it resolves the Ip and it works very well. the problem is by changing the ip !
I Testet all the scripts here i found but nothing is working.
My Router Os server has 4.16 OS and the client 4.11 OS.
If i start the script in Terminal he says me failure.
Sorry for my stupid english.
I hope anyone understand this crap what i said and Help me, i think i am a really Noob ![]()
Greetz Lominus
Example from the manual:
http://wiki.mikrotik.com/wiki/Manual:Scripting-examples#Check_if_IP_on_interface_have_changed
Also take a look in this thread.
http://forum.mikrotik.com/t/ppp-dial-out-server-with-dynamic-ip-address-solved/36299/1
Thank you very much for your answer!
I forgott to set the DNS server in IP/Dns
the mikrotik is behind a netgear router and i try internet of them !
If the DNS server is not set i can’t ping the web, an the rosolve command doesn’t work !
Best regrads
Lominus