FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE

14455 questions

17168 answers

28195 comments

0 members

We are migrating to our new platform at https://community.teltonika.lt. Moving forward, you can continue discussions on this new platform. This current platform will be temporarily maintained for reference purposes.
0 votes
461 views 6 comments
by anonymous

Hi,

upgrading the system from Legacy to the latest firmware version (00.07.2), the same DDNS configuration doesn't work (DDNS provider: ovh.com; IP address source: Private). Below I report the errors inside myddns.log:

 131741  info : Starting main loop at 2022-05-30 13:17
 131741       : Detect local IP on 'interface'
 131741       : #> ip -o addr show dev  scope global >/var/run/ddns/myddns.dat 2>/var/run/ddns/myddns.err
 131742 error : ip Error: '255'
 131742       : Error: either "dev" is duplicate, or "global" is a garbage.
 131743       : Data detected:
 131743       : 
 131743  warn : Get local IP via 'interface' failed - retry 1/0 in 60 seconds
 131844  crit : Error in 'get_local_ip()' - unhandled ip_source 'interface' - terminate
 131844  warn : pid '856' exit with error '1' at 2022-05-30 13:18

Can anyone help me understand why the script can't get the IP of the interface? It seems that isn't able to select the right interface name to insert into the "ip addr" command. My goal is to always have the last WAN IP (wired or mobile, depending on failover status) on my DNS

Thanks in advance.

BR

1 Answer

0 votes
by anonymous
Hello,

Could you try to set up a new DDNS instance on the router and see if that solves your issue, because it might be, that the FW version you upgraded from had some configuration that is not anymore compatible with the new 7.2 FW and that is why you are having this issue.
by anonymous

Hi,

Thank you for your reply :)

I did reset before upgrading the firmware and then inserted the same options into the DDNS GUI page.

I was checking the ddns scripts and I found that the issue is in the dynamic_dns_functions.sh (at row 596)

elif [ -n "$ip_interface" -a "$ip_source" = "interface" ]; then
local __DATA4=""; local __DATA6=""
ip_interface=""
for i in $(route -n | awk '$4 == "UG" {print $8,"\n"}' | tr -d $'\n'); do
res=$(ping -c 1 -I $i 8.8.8.8 > /dev/null 2> /dev/null; echo $?)
if [ "$res" = "0" -a -z "$ip_interface" ]; then
ip_interface=$i
fi
done

If I check my route table, I don't have any route with flag "UG". Below the result of "route -n"

root@Teltonika-RUT950:~# route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         0.0.0.0         0.0.0.0         U     4      0        0 wwan0
10.27.218.51    0.0.0.0         255.255.255.255 UH    4      0        0 wwan0
192.168.1.0     0.0.0.0         255.255.255.0   U     3      0        0 br-lan
by anonymous

Could you try to set the DDNS to get the public IP address by curling to a link and see if this works for your use case, as for how the script works and other things, I will try to consult with our RnD on this, as to what is happening. 

This would be an example configuration:

by anonymous
Hi Paulius,

thanks for your collaboration.

Let me know when you will have a fix for this.

Thanks in advance,

BR
by anonymous
Did it solve you issue?
by anonymous
With "Public" option the script works (exits without errors), but it doesn't work as I want due to possible NAT.
by anonymous

Hi Paulius,

do you have any updates about this topic?

Thanks in advance