guys,can anyone tell me which among the types of vpn will work best with dynamic dns or can be used to setup dynamic to dynamic vpn, thank you
I don’t think it matters which vpn you want to use with a dynamic dns. You just need a script, that regularly checks if the remote dynamic ip has changed, and then edits the config.
If you want, I can post my script for openvpn.
sure can you post it please? right now im using change-ip as my dynamic dns provider and im also using a scheduler on that script, so i guess what i need right now is a script that will reconfigure the vpn configuration when the remote ip is changed.
The script was rewritten from the original changeip script.
# Define User Variables
:global ovpnhost "Put remote ovpn server DNS hostname here"
:global ovpnif "Put local ovpn client interface name here"
# Define Global Variables
:global ovpnip
:global ovpnlastip
:if ([ :typeof $ovpnlastip ] = nil ) do={ :global ovpnlastip "0" }
# Grab the current IP address of server.
:global ovpnip [:resolve $ovpnhost]
:global ovpnlastip [ /interface ovpn-client get $ovpnif connect-to ]
# Did we get an IP address to compare?
:if ([ :typeof $ovpnip ] = nil ) do={
:log info ("OVPN: Cannot resolve " . $ovpnhost . ", please check.")
} else={
:if ($ovpnip != $ovpnlastip) do={
:log info ("OVPN: Updating " . $ovpnif . " IP address from " . $ovpnlastip . " to " . $ovpnip )
/interface ovpn-client disable $ovpnif
:delay 2
/interface ovpn-client set $ovpnif connect-to=$ovpnip
:delay 2
/interface ovpn-client enable $ovpnif
} else={
:log info "OVPN: No update required."
}
}
# End of script
:global "vpn-interface-name" "pptp-vpn"
:global "vpn-dns-name" "remotevpn.yourdomain.com"
:global "new-vpn-ip" [:resolve $"vpn-dns-name"]
:global "current-vpn-ip" [/interface pptp-client get $"vpn-interface-name" connect-to]
:if ($"current-vpn-ip" != $"new-vpn-ip") do={ /interface pptp-client set [find name=$"vpn-interface-name"] connect-to=$"new-vpn-ip"}
This should get you going.
Hi
How do I use this with a Open Vpn setup ?
Looking at the last two lines I guess I have to change the interface type so that it will “read” the ovpn interface that I specify in line one… I tried both “ovpn-out” and “ovpn-client”, but it doesnt seem to work.