ปัญหาคือ RouterOS ส่ง IP ไปอัปเดทกับ DynDns แล้วเกิดไม่อัปเดทเป็นบางครั้ง ทำให้ Host name ไม่อัปเดทเป็นบางครั้ง จะแก้อย่างไรดีครับ
1.ขอสคิปและวิธีลงสคริป เพื่อให้ RouterOS ส่ง IP ไปอัปเดทที่ DynDns และ E-mail ทั้ง2ทาง ด้วยครับ
2.เราสามารถแก้จากที่ส่ง IP ไป DynDns.com เปลี่ยนเป็นส่งไปที่ No-IP.com แทนได้ไหม
3.เข้า Winbox ผ่าน WAN แล้ว ทำไมถึงเข้า เมนู New Terminal ไม่ได้ แต่เมนูอื่นๆก็เข้าได้ปกติ แล้วเราจะสั่ง Run Script ผ่าน WAN ได้อย่างไรครับ
Script ของทางพี่กฤษดาครับ สำหรับ update no-ip
# No-ip DNS control automatic updates
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# EDIT YOUR DETAILS / CONFIGURATION HERE
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:local username "No-IP Username"
:local password "No-IP Password"
:local hostname "Your No-IP Hostname"
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# END OF USER DEFINED CONFIGURATION
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:global dyndnsForce2
:global previousIP2
# print some debug info
#:log info ("No-IPddns-update: username = $username")
#:log info ("No-IPddns-update: password = $password")
#:log info ("No-IPddns-update: hostname = $hostname")
#:log info ("No-IPddns-update: previousIP = $previousIP")
# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http address="checkip.dyndns.org" src-path="/" dst-path="/dyndns.checkip.html"
:local result [/file get dyndns.checkip.html contents]
# parse the current IP result
:local resultLen [:len $result]
:local startLoc [:find $result ": " -1]
:set startLoc ($startLoc + 2)
:local endLoc [:find $result "</body>" -1]
:local currentIP [:pick $result $startLoc $endLoc]
:log info "dyndns-update: currentIP = $currentIP"
# Determine if dyndns update is needed
# more dyndns updater request details available at
http://www.dyndns.com/developers/specs/syntax.html (http://www.dyndns.com/developers/specs/syntax.html)
:if (($currentIP != $previousIP2) || ($dyndnsForce = true)) do={
:set dyndnsForce2 false
:set previousIP2 $currentIP
/tool fetch user=$username password=$password mode=http address="dynupdate.no-ip.com" src-path="/nic/update?hostname=$hostname&myip=$currentIP"
:local result [/file get dyndns.txt contents]
:log info ("No-IPddns-update: No-IPddns update needed")
:log info ("No-IPddns-update: No-IPddns Update Result: ".$result)
:put ("No-IPddns Update Result: ".$result)
} else={
:log info ("No-IPddns-update: No No-IPddns update needed")
}
}
ส่ง email ผมทำไว้เรียบร้อยแล้วครับ
https://www.sysnetcenter.com/board/index.php/topic,1612.0.html (https://www.sysnetcenter.com/board/index.php/topic,1612.0.html)
เมื้อกี้ผมลองทดสอบ dynamic dns ก็ใช้ได้ปกตินะครับ uptime มา 13 วัน
[https://www.sysnetcenter.com/images/fromboard/dyndns-update.jpg[/img]