Welcome to Sysnet Board คู่มือ การใช้งานอุปกรณ์ Network. Please log in or sign up.
สมาชิกทั้งหมด
17,595
กระทู้ทั้งหมด
10,026
หัวข้อทั้งหมด
4,711

  • การ Set Dynanic DNS ในกรณีไม่ได้ให้ Mikrotik ออก Internet โดยตรง
    เริ่มโดย yod
    Read 11,970 times
0 สมาชิก และ 1 ผู้มาเยือน กำลังดูหัวข้อนี้
yod

 

 
สำหรับกรณีที่ใช้ Mikrotik RouterBoard เชื่อมต่อกับ Router Modem อีกทีครับ หรือต่อเข้ากับ gateway ตัวอื่นๆ วิธีนี้จะดีสำหรับเวลาเราจะ Remote เข้ามาตรวจสอบ Mikrotik หรืออุปกรณ์อื่นๆ โดย set forward port ที่ตัว Router Modem ด้วยนะครับ

ใช้ Script DDNS จากด้านล่าง แก้ไขค่า

YourUsername --> UserName ที่สมัครใน DynDNS.org
YourPassword  --> Password ที่สมัครใน DynDNS.org
DynDNSHostName --> ชื่อ Host ที่ตั้งไว้ใน DynDNS.org



# Set needed variables
:local username "YourUsername"
:local password "YourPassword"
:local hostname "DynDNSHostName"

:global dyndnsForce
:global previousIP

# print some debug info
:log info ("UpdateDynDNS: username = $username")
:log info ("UpdateDynDNS: hostname = $hostname")
:log info ("UpdateDynDNS: 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 "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 dyndnsForce true

# 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 ("UpdateDynDNS: Dyndns update needed")
   :log info ("UpdateDynDNS: Dyndns Update Result: ".$result)
   :put ("Dyndns Update Result: ".$result)
} else={
   :log info ("UpdateDynDNS: No dyndns update needed")
}




ถามนิดนึงนะครับ พอดีผมยังเป็นมือใหม่อยู่
สมมติว่า ถ้า RouterBoard ไม่ได้ออก Internet โดยตรง
แต่ว่าออกผ่าน Linksys RV042 ซึ่งสามารถ set Dynamic DNS ได้อยู่แล้ว
ผมยังจำเป็นที่จะต้องมา Set Service DDNS ใน RouterBoard อีกไหมครับ
ถ้าไม่ต้องแล้ว

ไม่ทราบว่า Port ที่จะต้องทำการ Forward มายัง IP ของ RouterBoard ที่จะเอาไว้ใช้
ในการเข้า Winbox.exe คือ Port อะไรเหรอครับ

โหนก

สำหรับ DDNS ถ้าเราทำที่ routerboard อีกก็จะเพิ่มความมั่นใจ แต่ hostname ต้องไม่ซ้ำกันนะครับ ทำ DDNS หลายๆ ค่ายด้วยก็ดี

ไม่ทราบว่า Port ที่จะต้องทำการ Forward มายัง IP ของ RouterBoard ที่จะเอาไว้ใช้
ในการเข้า Winbox.exe คือ Port อะไรเหรอครับ
winbox   port 8291
www     port  81

หรือเข้าไปดูที่  ip-->services


ถ้าต่อแบบ Bridge mode จาก Modem router  มา Router board จำเป็นต้อง Forward port จาก Modem router มา Router board อีกไหมครับ เพราะ ของผมไม่มีให้ตั้งค่าถ้าอยู่ใน Bridge mode.

AKTHAN

yod


สวัสดีครับ

ไม่ต้อง forward ครับ เพราะมันเป็น bridge อย่างเดียวแล้ว ไม่ได้ทำหน้าที่ nat ครับ


สอบถามหน่อยครับใน กรณีที่เราไม่ให้เล้าเตอร์บอร์ดออกเน็ต แล้วเราไปฟอเวิด ที่ตัวโมเด็ม ไอพีที่จะเข้าหาตัวอุปกรณ์นี้ เราใช้ไอพีอะไรครับ หรือว่าใช้ไอพี ที่เราตั้ง ในวงแรนขาใน ดูๆแล้ว ไอพี ที่เราสร้างมันไม่ตรงกับ โมเด็ม ผมยังงๆอยู่เลย