best vpn to use using dynamic dns
Posted: Tue Sep 22, 2009 2:28 pm
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
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.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.
# 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
so i guess what i need right now is a script that will reconfigure the vpn configuration when the remote ip is changed.
: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"}
Hiso i guess what i need right now is a script that will reconfigure the vpn configuration when the remote ip is changed.This should get you going.Code: Select all: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"}