Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network

การ Config อุปกรณ์ เครือข่าย Network Device => อุปกรณ์ Mikrotik Router => หัวข้อที่ตั้งโดย: izone2u เมื่อ วันที่ 30 สิงหาคม 2015, 23:32:19

ชื่อ: สคริป dyn อัพ ip ไม่ตรงกับ เว็บ dyn
โดย: izone2u เมื่อ วันที่ 30 สิงหาคม 2015, 23:32:19
สคริป dyn ผมใช้สคริปนี้
อ้างถึง# Set needed variables
:local username "xxxxxxxx"
:local password "xxxxxxxxx"
:local hostname "xxxx.dyndns.org"

:global dyndnsForce
:global previousIP

# print some debug info
:log info ("dyndns-update: username = $username")
:log info ("dyndns-update: password = $password")
:log info ("dyndns-update: hostname = $hostname")
:log info ("dyndns-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 != $previousIP) || ($dyndnsForce = true)) do={
    :set dyndnsForce false
    :set previousIP $currentIP
    /tool fetch user=$username password=$password mode=http address="members.dyndns.org" src-path="/nic/update?hostname=$hostname&myip=$currentIP" dst-path="/dyndns.txt"
    :local result [/file get dyndns.txt contents]
    :log info ("dyndns-update: Dyndns update needed")
    :log info ("dyndns-update: Dyndns Update Result: ".$result)
    :put ("Dyndns Update Result: ".$result)
} else={
    :log info ("dyndns-update: No dyndns update needed")
}

ดูจากรูป ตัวสคริปมันก็อัพแล้วนะคับ ตรงกับ ip 3bb
แต่ทว่า ในเวบ dyn ผมลองปดู มันไม่ยอมอัพเดทตาม
เป็นเพราะสาเหตุใด มีวิธีแก้ไหมคับ 

(https://www.sysnetcenter.com/board/upload/files/images/ntwlwr-wireless-19a365.jpg)