Mikrotik RouterOS¿ë DNSEver ¾÷µ¥ÀÌÆ® ½ºÅ©¸³Æ®

   Á¶È¸ 52382   Ãßõ 0    

update-ddns.txt (1.7K), Down : 30, 2013-11

noip용 스크립트를 버그 좀 잡고 dnsever용으로 수정했습니다.
userId는 dnsever 아이디
authCode는 dnsever 업데이트용 authCode
hosts는 업데이트할 호스트. 여러개일 때 콤마로 구분합니다. 빈 공백은 넣지 마세요.
gatewayInterface는 공인 아이피를 받는 인터페이스입니다. 보통 ether1-gateway이므로 그대로 두면됩니다.
수정하시고 스케줄러에 몇분 간격으로 실행되게끔 넣어주면 됩니다.

=============================================================================
:local userId "myUserId";
:local authCode "myAuthCode";
:local hosts [:toarray "mydomain1.com,mydomain2.com"];
:local gatewayInterface "ether1-gateway";

:global previousIpAddress;

:if ([/interface find where name=$gatewayInterface running=yes] != "") do={
# Get the current IP on the interface
    :local currentIpAddress [/ip address get [find interface="$gatewayInterface" disabled=no] address];
# Strip the net mask off the IP address
    :for i from=( [:len $currentIpAddress] - 1) to=0 do={
        :if ( [:pick $currentIpAddress $i] = "/") do={ 
            :set currentIpAddress [:pick $currentIpAddress 0 $i];
        } 
    }
   
    :if ($currentIpAddress != $previousIpAddress) do={
        :log info "ddns: Current ip address ($currentIpAddress) is not equal to previous ip address, update needed";
        :set previousIpAddress $currentIpAddress;

        :local hostQueryString "";
        :foreach host in=$hosts do={
   :if ([:len $hostQueryString] > 0) do={
                :set hostQueryString ($hostQueryString . "&");
            }
# %5B is percent encoded hex for '['. %5D is percent encoded hex for ']'.
            :set hostQueryString ($hostQueryString . "host%5B$host%5D=$currentIpAddress");
        }
# The update URL. Note the "\3F" is hex for question mark (?). Required since ? is a special character in commands.
        /tool fetch url="http://dyna.dnsever.com/update.php\3F$hostQueryString" user=$userId password=$authCode;
        :log info "ddns: Hosts updated on DNSEver with ip address ($currentIpAddress).";
    }
} else={
    :log error "ddns: Interface ($gatewayInterface) is invalid or not currently running.";
}
Pain is your friend.
ªÀº±Û Àϼö·Ï ½ÅÁßÇÏ°Ô.
¾ç½ÂÈ£ 2013-11
¹ÌÅ©·Îƽ »ç¿ëÀÚ·Î½á ³Ê¹« ÁÁÀº Á¤º¸ °¨»çµå¸³´Ï´Ù.!!!!
ÀÏÀü¿¡ ¹è»ó¿ø´Ô²²¼­ ¾Ë·ÁÁֽŠ½ºÅ©¸³Æ®µµ Àִ´ë...
»õ·Î¿î ½ºÅ©¸³Æ® °¨»çÇÕ´Ï´Ù^^
http://2cpu.co.kr/bbs/board.php?bo_table=QnA&wr_id=377399
     
¿À¿Ï¿µ 2013-11
³× Àúµµ ºÃ½À´Ï´Ù. ±Ùµ¥ Àú´Â ¿©·¯ È£½ºÆ®¸¦ ¾÷µ¥ÀÌÆ® ÇØÁà¾ßÇؼ­ µû·Î ¸¸µé¾ú½À´Ï´Ù.
          
^^ ÀÏÀü¿¡´Â 1°³·Î ¼³Á¤Çؼ­ DNSEver¿¡¼­ µµ¸ÞÀκ°¸íÀ¸·Î ¼³Á¤Çߴµ¥...
Àúµµ À̹ø¿¡ ½ºÅ©¸³Æ® º¯°æÇß³»¿ä...


PDS
Á¦¸ñPage 57/77
2014-05   4947347   Á¤ÀºÁØ1
2015-12   1484006   ¹é¸Þ°¡
2015-03   35957   ¶ó¿ÂÁ¦³ª
2015-03   34187   ¾ÈÁ¤¿ì
2015-03   36212   µÕ±Û°Ô
2015-03   35687   Á¦¿À´Ï
2015-04   46946   catstyle
2015-08   21238   Villanus
2015-08   17497   ±è½Â±Ç
2015-12   13881   º¹½Ç°­¾ÆÁö
2015-12   10566   ¼Ò¸Á»ç¶û71
2015-12   15158   ¼Ò¸Á»ç¶û71
2015-12   16667   ¼Ò¸Á»ç¶û71
2015-12   17637   ¼Ò¸Á»ç¶û71
2015-12   17761   ¼Ò¸Á»ç¶û71
2015-12   20546   ¼Ò¸Á»ç¶û71
2016-01   13606   ¹Ú¹®Çü
2016-01   18380   DoubleSH
2016-01   13877   ÆĶõ²Þ
2016-01   14759   ¾çÇü¼®
2016-01   16269   ¾çÇü¼®
2016-01   17198   ¾çÇü¼®