ข้ามไปที่เนื้อหาหลัก

การตั้งค่า Dynamic DNS ให้ MikroTik โดยใช้บริการของ dyn.com

ทำการใส่ script ตามด้านล่าง

# Set needed variables
:local username "xxxxxxxx"
:local password "xxxxxxxx"
:local hostname "xxxxxxxx.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
: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")
}

ทำการใส่ script เพื่อบังคับให้มันอัพเดท

:global dyndnsForce true
/system script run dyndns-update

กำหนดเวลาให้มันอัพเดท


ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

วิธีแก้ Canon MP287 ขึ้น E05

สำหรับวันนี้เรามีวิธีแนะนำเครื่องปริ้นเตอร์ Canon Pixma MP287 ขึ้น E05 อาการนี้เกิดจากตลับหมึกแต่อย่าพึ่งซื้อหัวใหม่นะ แต่เราหาวิธีแก้ได้แล้วครับสำหรับอาการ E05

วิธีเคลียร์ซับหมึก Canon ip2770

สำหรับเครื่องปริ้นเตอร์ รุ่น ip2770 ที่มีอาการไฟส้มกระพริบ 8 ครั้ง และ เขียว 1 ครั้ง นั้นแสดงว่าเครื่องปริ้นซับหมีกเต็ม เรามีวิธีมาแนะนำกัน สำหรับขั้นตอนแรกต้องเข้า Services mode ip2770 ให้ได้ก่อนก่อนครับ จะมีมีวิธีการดังนี้

วิธีเคลียร์ซับหมึก Brother MFC-J430w

วิธีเคลียร์ซับหมึก Brother MFC-J430w หรือ หน้าจอเครืองพิมพ์โชว์ว่า Ink Absorber Full  กดปุ่ม start ปุ่มเขียว (ปุ่มถ่ายเอกสารสี) กดค้างไว้ แล้วเสียบปลั๊ก รอจนเครื่องพิมพ์จอโชว์ว่า MAINTENANCE  เมื่อขึ้น MAINTENANCE ให้ทำการกดลูกศรเลื่อนขึ้น ลง จนตัวเลขเป็น 80 แล้ว กดปุ่ม OK  กดลูกศรขึ้น ลง ทำการเลือนหา PURGE: แล้วทำการกดตัวเลข 2783 แล้วดูว่า ค่าเป็น 0 แล้วหรือยัง  กดปุ่ม STOP/EXIT 1 ครั้ง เพื่อออกจาก maintenance mode ที่มา   refreshcartridges.co.uk