<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
	<channel>
		<title>Mikrotik.moscow [тема: Скрипт Dyndns Netcup]</title>
		<link>http://mikrotik.moscow</link>
		<description>Новое в теме Скрипт Dyndns Netcup форума RouterOS на сайте Mikrotik.moscow [mikrotik.moscow]</description>
		<language>ru</language>
		<docs>http://backend.userland.com/rss2</docs>
		<pubDate>Sat, 01 Aug 2026 05:14:16 -0400</pubDate>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407257">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Привет! Я написал скрипт для RouterOS с небольшой помощью с этого форума. Можете смело пользоваться: <noindex><a href="https://github.com/toscdesign/netcup-ddns-for-mikrotik" target="_blank" rel="nofollow" >https://github.com/toscdesign/netcup-ddns-for-mikrotik</a></noindex> <br />
			<i>22.09.2023 12:04:00, tsc23.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407257</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407257</guid>
			<pubDate>Fri, 22 Sep 2023 12:04:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407256">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Я скорее думаю, что лучше использовать встроенную поддержку DDNS через /ip/cloud. Потом добавьте CNAME в настройках домена на Netcup, который будет указывать на DNS-имя облака Mikrotik (например, .mynetname.com). Смотрите <noindex><a href="https://help.mikrotik.com/docs/display/ROS/Cloud#Cloud-DDNS" target="_blank" rel="nofollow" >https://help.mikrotik.com/docs/display/ROS/Cloud#Cloud-DDNS</a></noindex> <br />
			<i>30.07.2023 19:25:00, Amm0.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407256</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407256</guid>
			<pubDate>Sun, 30 Jul 2023 19:25:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407255">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Да, в скрипте есть такие вещи: :global jsonRequestBody "{json request body с новым IP и другой необходимой информацией}". Это тоже не сработает. Не знаю, откуда у тебя этот скрипт, но, возможно, была какая-то помощь по его настройке для твоего провайдера… ведь, кажется, в скрипте нужно указать несколько конкретных деталей. <br />
			<i>30.07.2023 19:14:00, Amm0.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407255</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407255</guid>
			<pubDate>Sun, 30 Jul 2023 19:14:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407254">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Скрипт теперь запускается без ошибок. Но IP-адрес не обновляется. <br />
			<i>30.07.2023 19:02:00, dima1002.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407254</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407254</guid>
			<pubDate>Sun, 30 Jul 2023 19:02:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407253">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Не могу сказать, работает ли этот скрипт. НО способ добавления кода неправильный… нужно обернуть скрипт в source=“”, чтобы добавить его через CLI, и строки должны быть экранированы… «команда» типа add и её аргументы тоже должны идти вместе (например, на одной строке). В общем, проще использовать webfig или winbox, чтобы просто скопировать и вставить скрипт в поле «source» в интерфейсе. В командной строке приходится разбираться с экранированием и переносами строк. А если скопировать через UI, потом можно сделать «/system script export» через CLI — он покажет всё нужное экранирование, чтобы использовать где-то ещё (например, как ниже).<br /><br />Так вот:<br /><br />/system script add name=Netcup policy=read,write,test source=":global apikey \"KEY\"\r\n:global apipassword \"PASSWORD\"\r\n:global customerid \"CUSTOMERNR\"\r\n:global theinterface \"WAN1\"\r\n:global ddnshost \"subdomain.domain.de\"\r\n:global ipddns [:resolve \$ddnshost];\r\n:global ipfresh [ /ip address get [/ip address find interface=\$theinterface ] address ]\r\n:if ([ :typeof \$ipfresh ] = nil ) do={\r\n:log info (\"NetcupDDNS: Нет IP-адреса на \$theinterface.\")\r\n} else={\r\n:for i from=( [:len \$ipfresh] - 1) to=0 do={\r\n:if ( [:pick \$ipfresh \$i] = \"/\") do={\r\n:set ipfresh [:pick \$ipfresh 0 \$i];\r\n}\r\n}\r\n:if (\$ipddns != \$ipfresh) do={\r\n:log info (\"NetcupDDNS: IP-Netcup = \$ipddns\")\r\n:log info (\"NetcupDDNS: IP-Fresh = \$ipfresh\")\r\n:log info \"NetcupDDNS: Нужно обновить IP, отправляем UPDATE...!\"\r\n:global jsonRequestBody \"{json request body with new IP and other necessary info}\"\r\n/tool fetch url=\"https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON\" http-method=post http-data=\$jsonRequestBody mode=https dst-path=(\"/Netcup.\".\$ddnshost)\r\n:delay 1\r\n:global str [/file find name=\"Netcup.\$ddnshost\"];\r\n/file remove \$str\r\n:global ipddns \$ipfresh\r\n:log info \"NetcupDDNS: IP обновлён на \$ipfresh!\"\r\n} else={\r\n:log info \"NetcupDDNS: изменений не требуется\";\r\n} }" <br />
			<i>30.07.2023 18:05:00, Amm0.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407253</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407253</guid>
			<pubDate>Sun, 30 Jul 2023 18:05:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407252">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			И где здесь ошибка? К сожалению, это тоже не работает.<br /><br />/system script &nbsp;<br />add name=Netcup &nbsp;<br />policy=read,write,test &nbsp;<br />:global apikey "KEY" &nbsp;<br />:global apipassword "PASSWORD" &nbsp;<br />:global customerid "CUSTOMERNR" &nbsp;<br />:global theinterface "WAN1" &nbsp;<br />:global ddnshost "subdomain.domain.de" &nbsp;<br />:global ipddns [:resolve $ddnshost];  <br />:global ipfresh [ /ip address get [/ip address find interface=$theinterface ] address ]  <br />:if ([ :typeof $ipfresh ] = nil ) do={  <br /> &nbsp;:log info ("NetcupDDNS: Нет IP-адреса на интерфейсе $theinterface.") &nbsp;<br />} else={ &nbsp;<br /> &nbsp;:for i from=( [:len $ipfresh] - 1) to=0 do={  <br /> &nbsp; &nbsp;:if ( [:pick $ipfresh $i] = "/") do={  <br /> &nbsp; &nbsp; &nbsp;:set ipfresh [:pick $ipfresh 0 $i];  <br /> &nbsp; &nbsp;} &nbsp;<br /> &nbsp;} &nbsp;<br /> &nbsp;:if ($ipddns != $ipfresh) do={ &nbsp;<br /> &nbsp; &nbsp;:log info ("NetcupDDNS: IP-Netcup = $ipddns") &nbsp;<br /> &nbsp; &nbsp;:log info ("NetcupDDNS: IP-Fresh = $ipfresh") &nbsp;<br /> &nbsp; &nbsp;:log info "NetcupDDNS: Нужно обновить IP, отправляю ОБНОВЛЕНИЕ...!" &nbsp;<br /> &nbsp; &nbsp;:global jsonRequestBody "{json request body with new IP and other necessary info}" &nbsp;<br /> &nbsp; &nbsp;/tool fetch url="https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON" http-method=post http-data=$jsonRequestBody mode=https dst-path=("/Netcup.".$ddnshost) &nbsp;<br /> &nbsp; &nbsp;:delay 1 &nbsp;<br /> &nbsp; &nbsp;:global str [/file find name="Netcup.$ddnshost"];  <br /> &nbsp; &nbsp;/file remove $str &nbsp;<br /> &nbsp; &nbsp;:global ipddns $ipfresh &nbsp;<br /> &nbsp; &nbsp;:log info "NetcupDDNS: IP обновлён на $ipfresh!" &nbsp;<br /> &nbsp;} else={ &nbsp;<br /> &nbsp; &nbsp;:log info "NetcupDDNS: изменений не требуется"; &nbsp;<br /> &nbsp;} &nbsp;<br />} <br />
			<i>30.07.2023 16:50:00, dima1002.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407252</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407252</guid>
			<pubDate>Sun, 30 Jul 2023 16:50:00 -0400</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407251">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Похоже на код на LUA! Если у тебя роутер, который это поддерживает, всё равно стоит срочно обновить его из-за уязвимостей в безопасности. Языки скриптов меняли ещё до моего времени (возможно, в версии V5). MikroTik создали свой собственный язык скриптов в замену, и он используется уже больше 5 лет. <br /><br />Но в версиях V6 и V7 RouterOS можно использовать IP &gt; Cloud для DDNS, а затем в своём DNS добавить CNAME на этот адрес. Конечно, можно написать скрипт, который будет напрямую общаться с твоим DDNS-провайдером, но это более сложное решение. /ip/cloud с CNAME — довольно простой вариант. <br />
			<i>01.12.2021 19:41:00, Amm0.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407251</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407251</guid>
			<pubDate>Wed, 01 Dec 2021 19:41:00 -0500</pubDate>
			<category>RouterOS</category>
		</item>
		<item>
			<title>Скрипт Dyndns Netcup</title>
			<description><![CDATA[<b><a href="http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407250">Скрипт Dyndns Netcup</a></b> <i>RouterOS</i> в форуме <a href="http://mikrotik.moscow/forum/forum57/">RouterOS</a>. <br />
			Привет, может кто-то помочь мне подправить скрипт? Мне нужен скрипт с Dyndns для netcup. &nbsp;<br /><noindex><a href="https://www.netcup-wiki.de/wiki/API_Clients#Dynamisches_DNS" target="_blank" rel="nofollow" >https://www.netcup-wiki.de/wiki/API_Clients#Dynamisches_DNS</a></noindex> &nbsp;<br /><noindex><a href="https://github.com/hazzl/netcup-ddns" target="_blank" rel="nofollow" >https://github.com/hazzl/netcup-ddns</a></noindex> &nbsp;<br /><br />:global DOMAIN = "DOMAIN" &nbsp;<br />:global CUSTOMERNO = "NUMBER" &nbsp;<br />:global APIKEY = "KEY" &nbsp;<br />:global APIPASSWD = "APIPASS" &nbsp;<br /><br />:global cjson = require "luci.jsonc" &nbsp;<br />:global https = require "ssl.https" &nbsp;<br />:global ltn12 = require "ltn12" &nbsp;<br />:global socket = require "socket" &nbsp;<br />:global http = socket.http &nbsp;<br /><br />global function send_command(coms, ids) &nbsp;<br />	global postbod &nbsp;<br />	global resbod = {} &nbsp;<br />	global post = {} &nbsp;<br />	coms.param.apikey = APIKEY &nbsp;<br />	coms.param.customernumber = CUSTOMERNO &nbsp;<br />	if (ids) then &nbsp;<br />		coms.param.apisessionid = ids &nbsp;<br />	end &nbsp;<br />	postbod = cjson.stringify(coms) &nbsp;<br />	post = { &nbsp; <br />		method = "POST", &nbsp;<br />		url = "https://ccp.netcup.net/run/webservice/servers/endpoint.php?JSON", &nbsp;<br />		headers = { &nbsp;<br />			["content-length"] = tostring(#postbod)  <br />		}, &nbsp;<br />		source = ltn12.source.string(postbod), &nbsp;<br />		sink = ltn12.sink.table(resbod) &nbsp;<br />	} &nbsp;<br />	https.request(post) &nbsp;<br />	return cjson.parse(table.concat(resbod)) &nbsp;<br />end &nbsp;<br /><br />global function clear() &nbsp;<br />	global t = {} &nbsp;<br />	t.param = {} &nbsp;<br />	return t &nbsp;<br />end &nbsp;<br /><br />global com, id, response, ip4, modified &nbsp;<br /><br />response = {} &nbsp;<br />http.request{url = "http://v4.ident.me", sink = ltn12.sink.table(response)} &nbsp;<br />ip4 = table.concat(response) &nbsp;<br />if ip4 == "" then -- что-то пошло совсем не так. Сдаюсь. &nbsp;<br />	return &nbsp;<br />end &nbsp;<br /><br />response = socket.dns.toip(DOMAIN) &nbsp;<br />if ip4 == response then &nbsp; <br />	return &nbsp;<br />end &nbsp;<br /><br />global logfile = io.open("ddns.log", "a") &nbsp;<br />io.output(logfile) &nbsp;<br />io.write(os.date() .. " новый IP " .. ip4 .. "\n") &nbsp;<br /><br />com = clear() &nbsp;<br />com.action = "login" &nbsp;<br />com.param.apipassword = APIPASSWD &nbsp;<br />response = send_command(com, id) &nbsp;<br />id = response.responsedata.apisessionid &nbsp;<br /><br />com = clear() &nbsp;<br />com.action = "infoDnsRecords" &nbsp;<br />com.param.domainname = DOMAIN &nbsp;<br />response = send_command(com, id) &nbsp;<br />modified = false &nbsp;<br />for _, v in pairs(response.responsedata.dnsrecords) do &nbsp;<br />	if v.type == "A" and v.hostname ~= "mail" and v.destination ~= ip4 then &nbsp;<br />		v.destination = ip4 &nbsp;<br />		modified = true &nbsp;<br />	end &nbsp;<br />end &nbsp;<br /><br />if modified then &nbsp;<br />	com = clear() &nbsp;<br />	com.action = "updateDnsRecords" &nbsp;<br />	com.param.domainname = DOMAIN &nbsp;<br />	com.param.dnsrecordset = response.responsedata &nbsp;<br />	response = send_command(com, id) &nbsp;<br />	print(response.longmessage) &nbsp;<br />else &nbsp;<br />	print("все записи актуальны") &nbsp;<br />end &nbsp;<br /><br />com = clear() &nbsp;<br />com.action = "logout" &nbsp;<br />response = send_command(com, id) &nbsp;<br />io.close(logfile) <br />
			<i>14.11.2021 09:01:00, dima1002.</i>]]></description>
			<link>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407250</link>
			<guid>http://mikrotik.moscow/forum/forum57/86483-skript-dyndns-netcup/message407250</guid>
			<pubDate>Sun, 14 Nov 2021 09:01:00 -0500</pubDate>
			<category>RouterOS</category>
		</item>
	</channel>
</rss>
