mikrotik ¿¡¼­ dyndns ÀÚµ¿ IP ¾÷µ¥ÀÌÆ®

Leo   
   Á¶È¸ 7632   Ãßõ 1    

안녕Ȣ16;세요.

그ᇼ1;안 계속 ǣ16;르다가 1060;1228;야 1312;금 1692;1060; 생겨서 올/140;봅니다.
dynamic  DNS 서비스를 Ǻ12;디를 할까 고0124;1012; 해봤lj16;데, 그래도 큰 업체가 낫1648; dz10;Ǻ12;서 dyndns.com 1012; 사용Ȣ16;고 1080;습니다.
큰 업체다 보니 1088;료 찾기가 수월Ȣ16;기도 Ȣ16;구요.
mikrotik 에서 dyndns 에 1088;ᇼ1;1004;/196; 업데1060;트 Ȣ16;lj16; 스크립트를 찾아보면 아래 사1060;트 링크가 뜹니다.
그런데 문1228;lj16; 1060; 내용1060; 매우 오래.108; 내용1060;라 실1228;/196; 1201;용해보면 1096; 안.121;니다.
1228;가 사용Ȣ16;lj16; 버1204;1008; mikrotik routerOS v6.10 1060;고 Ȣ16;드웨Ǻ12;lj16; RB450G 1077;니다.

그래서 아래 Ǹ16;/112;드를 열심7176; 뒤1276;습니다. 1200;같1008; ǥ16;들1060; 많더군요.

그리고 ኧ1;번1032; 시행착오 결과.. 아래와 같1008; 스크립트를 1089;ᇼ1;시Ȗ12;lj16;데 성공했습니다.
:local username "<dyndns user id>";
:local password "<dyndns password>";
:local hostname "<dyndns registered address>";
:local inetinterface "ether1-gateway";
:local sysdate [/system clock get date];
:local systime [/system clock get time];
:local sysname [/system identity get name];

:local dyndnsForce;

#:set dyndnsForce true;

# Print debug info
#:log info ("DynDNS: username = $username");
#:log info ("DynDNS: password = $password");
#:log info ("DynDNS: hostname = $hostname");

# Check if WAN interface is running
&#160;:if ([/interface get $inetinterface value-name=running]) do={

# Get the current IP on the WAN interface
:local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address];

# Strip the net mask off the IP address
&#160;:set currentIP [:pick $currentIP 0 [:find $currentIP "/"]];
&#160;:log info ("DynDNS: current WAN IP = $currentIP");

# Get resolved IP
&#160;:local resolvedIP [:resolve domain-name=$hostname server=8.8.8.8];
&#160;:log info ("DynDNS: resolved IP = $resolvedIP");

# Determine if dyndns update is needed
&#160;:if (($currentIP != $resolvedIP) || ($dyndnsForce = true)) do={
&#160; :set dyndnsForce false;
&#160;/tool fetch &#160;user=$username password=$password url="http://eurodyndns.org/update/?hostname=$hostname&myip=$currentIP" dst-path="/eurodns.txt";
&#160; :delay 1;
&#160; :local result [/file get dyndns.txt contents]
&#160; :log info ("DynDNS: Update needed")
&#160; :log info ("DynDNS: Update Result: ".$result)
} else={
&#160; :log info ("DynDNS: No update needed");
}
} else={
&#160; &#160; :log info ("DynDNS: $inetinterface is not currently running");
}

위 스크립트를 /system script 에 DynDNS 라lj16; 1060;름1004;/196; 1200;1109;해 .160;고, &#160;116;마다 한번씩 1088;ᇼ1; 실행Ȣ16;도/197; 아래 명/161;1012; 넣습니다.
/system scheduler add name=DynDNS interval=00:10 on-event="/system script run DynDns\r\n"
/log print 해보면 해NJ17; 명/161;1060; 1096; 실행.104;lj16; ,152; 볼 수 1080;습니다.
참고Ȣ16;세요. :)



´ë´ÜÇϽʴϴÙ..
¹éÁø¼® 2014-03
¼öÁ¤»çÇ×ÀÌ Àֳ׿ä. »ó±â
/tool fetch  user=$username password=$password url="http://eurodyndns.org/update/?hostname=$hostname&myip=$currentIP" dst-path="/eurodns.txt";
ºÎºÐÀ» ¾Æ·¡¿Í °°ÀÌ ¼öÁ¤ÇØÁÖ½Ã´Â°Ô ÁÁÀ» µí ÇÕ´Ï´Ù.
/tool fetch user=$username password=$password url="http://members.dyndns.org/nic/update\?hostname=$hostname&myip=$currentIP&wildcard=NOCHG&mx=NOCHG&backmx=NOCHG" dst-path="/dyndns.txt";

ÇÙ½ÉÀº ? ¾Õ¿¡ \ ¸¦ ºÙÀÌ´Â °Í°ú, dst-path="/dyndns.txt" ÀÔ´Ï´Ù.
ÀÌ·¸°Ô ÇØ¾ß log °¡ Á¦´ë·Î ÂïÈ÷´Â±º¿ä.


Á¦¸ñPage 8/94
2016-08   7343   ¿ù»êÀÌ
2016-08   9798   ¹Ú°Ç
2017-06   6273   Àª¶ó¸ä
2017-07   8889   ¾ÆÀÌ¿Àµò
2017-08   17793   ÇÏÀÌÇÏÀÌ
2023-06   13582   °õ»ïÃÌ
2015-06   5246   µ¹¹®ÆÒ
2016-01   8563   ȸ¿øK
2016-05   9187   witbox
2016-08   13318   ¾Æ¸®¿¡³ªÀÌ
2017-12   11018   Chrome
2020-03   5143   °õ»ïÃÌ
2021-12   3140   ¾ÈöÇö
2022-08   4058   À¯Æ©ºê¶óÀ̺ê
2015-02   8793   °õ»ïÃÌ
2015-06   8306   ³ª±â³É
2015-11   10635   ±èµ¿Çõ1
2016-08   11897   goodsense
2017-05   8623   ¿·¿Õ
2023-11   13963   Àַ̼¹½ºÆ¼