(8 revisi antara oleh satu pengguna tak ditampilkan) | |||
Baris 1: | Baris 1: | ||
− | Gunakan script berikut ini untuk supaya perangkat Mikrotik dapat melakukan update Dynamic DNS secara otomatis: | + | Gunakan salah satu script berikut ini untuk supaya perangkat Mikrotik dapat melakukan update Dynamic DNS secara otomatis: |
+ | |||
+ | == Alternatif Pertama == | ||
<source lang="text"> | <source lang="text"> | ||
Baris 12: | Baris 14: | ||
# the name of interface that gets dynamic IP address | # the name of interface that gets dynamic IP address | ||
− | :local dyndnsinterface " | + | :local dyndnsinterface "your interface" |
## do not modify after this line | ## do not modify after this line | ||
Baris 29: | Baris 31: | ||
</source> | </source> | ||
− | [[Kategori: | + | Script di atas adalah adaptasi dari script Dynamic DNS untuk No-IP yang ada pada [http://wiki.mikrotik.com/wiki/Dynamic_DNS_Update_Script_for_No-IP_DNS Mikrotik Wiki]. |
+ | |||
+ | == Alternatif Kedua == | ||
+ | |||
+ | Versi ini kompatibel untuk Mikrotik versi lama (3.x). | ||
+ | |||
+ | <source lang="text"> | ||
+ | ## Dynamic DNS script for indoglobal.com services | ||
+ | |||
+ | # User variables | ||
+ | :local dyndnsupdatehostname "mail.example.net" | ||
+ | :local dyndnsuser "username" | ||
+ | :local dyndnspass "password" | ||
+ | :local dyndnsinterface "interface" | ||
+ | |||
+ | # Get the current IP address | ||
+ | :local curip [ /ip address get [/ip address find interface=$dyndnsinterface ] address ] | ||
+ | |||
+ | # Strip the net mask | ||
+ | :for i from=( [:len $curip] - 1) to=0 do={ | ||
+ | :if ( [:pick $curip $i] = "/") do={ | ||
+ | :set curip [:pick $curip 0 $i] | ||
+ | } | ||
+ | } | ||
+ | |||
+ | # Did we get an IP address to compare? | ||
+ | :if ([ :typeof $curip ] = nil ) do={ | ||
+ | :log info ("Dynamic DNS: No IP address present on " . $dyndnsinterface) | ||
+ | } else={ | ||
+ | :local dnsip [:resolve $dyndnsuser]; | ||
+ | :if ($curip != $dnsip) do={ | ||
+ | :log info ("Dynamic DNS: Sending update " . $dnsip) | ||
+ | /tool fetch address="dyndnsupdatehostname" src-path="nic/update\3Fhostname=$dyndnsuser&myip=$curip" user=$dyndnsuser password=$dyndnspass keep-result=no | ||
+ | } else={ | ||
+ | :log info "Dynamic DNS: No update required" | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
+ | |||
+ | Script di atas adalah adaptasi dari script dynamic DNS untuk No-IP dari [http://amigaprj.blogspot.com/2013/06/the-blog-is-called-amiga-projects-but.html Amiga Projects]. | ||
+ | |||
+ | ==Alternatif Ketiga== | ||
+ | |||
+ | Berikut adalah script lain yang sangat sederhana: | ||
+ | |||
+ | <source lang="text"> | ||
+ | # Update DNS on Mikrotik Router | ||
+ | |||
+ | :global urlupdate "Full Update URL" | ||
+ | |||
+ | /tool fetch url=$urlupdate | ||
+ | </source> | ||
+ | |||
+ | Script sumbangan dari Yusuf Ayuba dari akper-luwuk.ac.id. | ||
+ | |||
+ | [[Kategori:Setting Aplikasi Dynamic DNS]] |
Gunakan salah satu 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 "your interface" ## 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" } } }
Script di atas adalah adaptasi dari script Dynamic DNS untuk No-IP yang ada pada Mikrotik Wiki.
Versi ini kompatibel untuk Mikrotik versi lama (3.x).
## Dynamic DNS script for indoglobal.com services # User variables :local dyndnsupdatehostname "mail.example.net" :local dyndnsuser "username" :local dyndnspass "password" :local dyndnsinterface "interface" # Get the current IP address :local curip [ /ip address get [/ip address find interface=$dyndnsinterface ] address ] # Strip the net mask :for i from=( [:len $curip] - 1) to=0 do={ :if ( [:pick $curip $i] = "/") do={ :set curip [:pick $curip 0 $i] } } # Did we get an IP address to compare? :if ([ :typeof $curip ] = nil ) do={ :log info ("Dynamic DNS: No IP address present on " . $dyndnsinterface) } else={ :local dnsip [:resolve $dyndnsuser]; :if ($curip != $dnsip) do={ :log info ("Dynamic DNS: Sending update " . $dnsip) /tool fetch address="dyndnsupdatehostname" src-path="nic/update\3Fhostname=$dyndnsuser&myip=$curip" user=$dyndnsuser password=$dyndnspass keep-result=no } else={ :log info "Dynamic DNS: No update required" } }
Script di atas adalah adaptasi dari script dynamic DNS untuk No-IP dari Amiga Projects.
Berikut adalah script lain yang sangat sederhana:
# Update DNS on Mikrotik Router :global urlupdate "Full Update URL" /tool fetch url=$urlupdate
Script sumbangan dari Yusuf Ayuba dari akper-luwuk.ac.id.
Sosial
Facebook
Twitter
Google Plus
Temukan kami di Google+