MikrotTik

Hilfe bei der Einrichtung unsere DDNS Dienste in Routern und anderen Geräte sowie Updateclients
Post Reply
EvilMoe
Posts: 5
Joined: Mon 30. Dec 2019, 23:20

MikrotTik

Post by EvilMoe »

Moin zusammen!

Gibts auch ein funktionierendes Script für Mikrotik?
Das im Download Bereich ist leider nur für ipv4.

LG und guten Rutsch!
AndreRose
Posts: 209
Joined: Thu 25. Oct 2018, 09:38

Re: MikrotTik

Post by AndreRose »

bitte in der Zeile:
:local IpCurrent [/ip address get [find interface=$WANInter] address];

aus /ip ein /ipv6 machen dann funktioniert es

:local IpCurrent [/ipv6 address get [find interface=$WANInter] address];
mfg
André Rose
EvilMoe
Posts: 5
Joined: Mon 30. Dec 2019, 23:20

Re: MikrotTik

Post by EvilMoe »

Leider nein. Auf die Idee kam ich auch:

[Sven@router] > :pick [/ipv6 address get [find interface=$WANInter] address];
no such item

find scheint nicht mit IPV6 zu funktionieren. Ich umgehe das Problem aktuell, indem ich die ID direkt angebe. Trotzdem ist es nicht schön.
Ch-MG
Posts: 1
Joined: Sat 11. Jan 2020, 11:12

Re: MikrotTik

Post by Ch-MG »

Hallo,

ich habe folgendes Script bei mir laufen.

Code: Select all

# Set needed variables
:local username "123456"
:local password "abcdefg"
:local hostname "hostname.feste-ip.net"
:local ipv6pool "DHCPv6-Pool"

# temp variables
:global dyndnsForce
:global previousIP

# print some debug info 
:log debug ("Update Feste-IP.net: username = $username")
:log debug ("Update Feste-IP.net: hostname = $hostname")
:log debug ("Update Feste-IP.net: previousIP = $previousIP")

# get the current IP address from the internet (in case of double-nat)
/tool fetch mode=http url=("http://v6.checkip.feste-ip.net/") 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 debug ("Update Feste-IP.net: currentIP = $currentIP")

# Determine if dyndns update is needed
:if (($currentIP != $previousIP) || ($dyndnsForce = true)) do={
    :set dyndnsForce false
    :set previousIP $currentIP
    :local subnet [/ipv6 pool used get [ find pool=$ipv6pool ] prefix]
    /tool fetch user=$username password=$password mode=http url=("http://members.feste-ip.net/nic/update?system=dyndns&hostname=".$hostname."&myip=".$currentIP."&subhostprefix=".$subnet) dst-path="/dyndns.txt"
    :local result [/file get dyndns.txt contents]
    :log info ("Update Feste-IP.net: Dyndns update needed")
    :log info ("Update Feste-IP.net: Dyndns Update Result: ".$result)
    :put ("Dyndns Update Result: ".$result)
} else={
    :log debug ("Update Feste-IP.net: No dyndns update needed")
}
Das Script ist noch nicht ganz fertig.
Ich plane noch die IPv4 IP bei DualStack Anschlüssen zu updaten.
Post Reply