Code: Select all
#=========================
# IONOS DNS updater script
#=========================
# Set IONOS api-key here
:local apikey "PLACE-API-KEY-HERE"
# Set pppoe interface for v4
:local pppoeint "pppoe-out1"
# Set DMZ interface for v6 here (There's only one host connected to this port -> Server within DMZ)
:local dmzint "ether7"
#==========================================
# Determine public ipv4 and v6 addresses
:local pubv4 [/ip/address/get [find where interface=$pppoeint] value-name=address]
:local pubv6
:do {
:set pubv6 [/ipv6/neighbor/get [find interface=$dmzint && address~"^[^fe80]|^[^ff02]"] address]
} on-error={
:log warning "Could not determine IPv6 address"
:set pubv6 "e"
}
# Remove CIDR subnat from v4 address
:set pubv4 [:pick $pubv4 0 ([:len $pubv4] - 3)]
# Logging to console
:log info "IONOS DNS updating with IPv4=$pubv4 and IPv6=$pubv6"
# Build urls for making api key request
:local rawurl "https://ipv4.api.hosting.ionos.com/dns/v1/dyndns?"
:local paramurl
:if ($pubv6 = "e") do={
:set paramurl ($rawurl."q=".$apikey."&ipv4=".$pubv4)
} else={
:set paramurl ($rawurl."q=".$apikey."&ipv4=".$pubv4."&ipv6=".$pubv6)
}
:local result [/tool/fetch http-method=get mode=https url="$paramurl" as-value output=user]
:if ($result->"status" = "finished") do={
:log info "IONOS DNS update successful"
} else={
:log warn "IONOS DNS update failed"
}
Code: Select all
/ipv6/neighbor/get
For instance, here is the output of the ip -6 address command:
The correct address is the first one in the list 2003:d9:d722449b:a59b:4114:ed37/64 but this one does not appear within the Router's Neighbors list. Only one of the old ones below with the "deprecated" flag. Any ideas on this? Do I have to set some special kernel parameters?2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 state UP qlen 1000
inet6 2003:d9:d722449b:a59b:4114:ed37/64 scope global temporary dynamic
valid_lft 603444sec preferred_lft 84734sec
inet6 2003:d9:d7221efd:8ff:fe74:a984/64 scope global dynamic mngtmpaddr proto kernel_ra
valid_lft 2591958sec preferred_lft 604758sec
inet6 2003:d9:d725:ae02:c3d5:469b:9a8c:b6ba/64 scope global temporary deprecated dynamic
valid_lft 598861sec preferred_lft 0sec
inet6 2003:d9:d725:ae028ff:fe74:a984/64 scope global deprecated dynamic mngtmpaddr proto kernel_ra