indoglobal.com
Langsung ke: navigasi, cari

Mikrotik

Gunakan script berikut ini untuk supaya perangkat Mikrotik dapat melakukan update Dynamic DNS secara otomatis:

## Dynamic DNS script for indoglobal.com service
 
## Script Settings
 
# get these from usage information in control panel
:local dyndnsupdateurl "http://mail.example.net/nic/update"
:local dyndnsuser "your username"
:local dyndnspass "your password"
 
# the name of interface that gets dynamic IP address
:local dyndnsinterface "MikroTik Router WAN Interface Name"
 
## do not modify after this line
 
:local dyndnsdomain "$dyndnsuser"
:local IpCurrent [/ip address get [find interface=$dyndnsinterface] address];
:for i from=( [:len $IpCurrent] - 1) to=0 do={ 
  :if ( [:pick $IpCurrent $i] = "/") do={ 
    :local NewIP [:pick $IpCurrent 0 $i];
    :if ([:resolve $dyndnsdomain] != $NewIP) do={
      /tool fetch mode=http user=$dyndnsuser password=$dyndnspass url="$dyndnsupdateurl\3Fhostname=$dyndnsdomain&myip=$NewIP" keep-result=no
      :log info "Dynamic DNS Update: $dyndnsdomain - $NewIP"
     }
   } 
}