Welcome to Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network. Please log in.
สมาชิกทั้งหมด
17,948
กระทู้ทั้งหมด
9,930
หัวข้อทั้งหมด
4,627

  • สคริปสำหรับ DDNS ตัวใหม่ครับ
    เริ่มโดย wong62
    Read 102,663 times
0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้
yuttapong

tawatchai_mwf
ขอความช่วยเหลือครับ...ผมไม่สามารถ Set Dynanic DNS ลงบน Mikrotik ได้ครับ ผบลองทุกเวอร์ชั่นแล้วครับ ไม่ทราบผมผิดขั้นตอนไหนครับ ผมทำตามคำแนะนำในเว็บแล้วครับ
ขอคำแนะนำด้วยครับ มือใหม่ครับ

ขอบคุณครับ

yuttapong
#12

ลองทำตามหัวข้อนี้หรือยังครับ  ตอนนี้ host ของ no-ip ใช้ได้ปกติแล้วครับ
https://www.sysnetcenter.com/board/index.php/topic,991.0/
แต่ถ้าไม่อยากเขียนสคลิป ก็อัพเป็น V6.14 ขึ้นไปครับ จะมี Dynamic DNS ให้ครับ ทำตามหัวข้อนี้ได้เลยครับ
https://www.sysnetcenter.com/board/index.php?topic=2581.0

yod

tawatchai_mwf
ขอบคุณมากครับ คุณ ยุทธพงษ์ สำหรับคำแนะนำดีๆ
 แต่ผมได้สมัคร Dyndns รายปีไวัแล้ว ผมอยากใช้ตัวนี้ ผมต้องทำอย่างไรบ้างครับ


tawatchai_mwf
สวัสดีครับคุณ ยอด
  ผมรบกวนคุณยอดช่วยแนะนำการวางสคริปสำหรับ DDNS ตัวใหม่ให้ผมสักหน่อยได้มั้ยครับ ผมมือใหม่มากครับ แต่ใจรักทางนี้ครับ

ขอบคุณล่วงหน้าไว้ณ.ที่นี้ครับ

yod
ไม่แน่ใจว่าเหมือนของเดิมหรือเปล่า ผมเปลี่ยนไปมาเพราะชนกับตัวแปลที่เป็น global ของ script อันอื่น แต่ใช้งานได้แน่นอนครับ เพราะผมใช้อยู่ ทำ vpn ระหว่างบ้านกับที่ร้านในเซียร์

เปลี่ยนตรง xxxx ครับ


# Set needed variables
:local username "xxxx"
:local password "xxxx"
:local hostname "xxxx"

:global AdyndnsForce
:global ApreviousIP

# print some debug info
#:log info ("UpdateDynDNS: username = $username")
#:log info ("UpdateDynDNS: password = $password")
#:log info ("UpdateDynDNS: hostname = $hostname")
#:log info ("UpdateDynDNS: ApreviousIP = $ApreviousIP")

# 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"
:delay 1
: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]
#:local currentIP get [/ip address find interface=pppoe-out1]
:log info "UpdateDynDNS: currentIP = $currentIP"

# Remove the # on next line to force an update every single time - useful for debugging,
# but you could end up getting blacklisted by DynDNS!

:set AdyndnsForce true

# Determine if dyndns update is needed
# more dyndns updater request details http://www.dyndns.com/developers/specs/syntax.html

:if (($currentIP != $ApreviousIP) || ($AdyndnsForce = true)) do={
  :set AdyndnsForce false
  :set ApreviousIP $currentIP
  :log info "$currentIP or $ApreviousIP"
  /tool fetch user=$username password=$password mode=http address="members.dyndns.org" src-path="nic/update?system=dyndns&hostname=$hostname&myip=$currentIP&wildcard=no" dst-path="/dyndns.txt"
  :delay 1
  :local result [/file get dyndns.txt contents]
  :log info ("UpdateDynDNS: Dyndns update needed")
  :log info ("UpdateDynDNS: Dyndns Update Result: ".$result)
  :put ("Dyndns Update Result: ".$result)
} else={
  :log info ("UpdateDynDNS: No dyndns update needed")
}

tawatchai_mwf
#17
คุณ ยอด ครับ

ผมได้ลองเอาสคริปตัวใหม่ใหม่ที่คุณยอดให้มา แล้วทำตามขั้นตอนของหัวข้อ " การ Set Dynanic DNS บน Mikrotik โดยใช้ Service DynDNS.org " ได้ลองเข้าดูใน dyndns.com ค่า IP Address ไม่ตรงกันครับ ผมผิดขั้นตอนไหนครับ มีคำแนะนำเพิ่มเติมมั๊ยครับ ผมแนบรูปมาด้วยครับ

ขอบคุณมากครับ

yod


ฝั่งขา wan ของ Mikrotik เป็น IP อะไรครับ

tawatchai_mwf
คุณ ยอดครับ

ณ. ตอนนี้ IP Address 115.87.115.7 ครับ