DDNS Error: Can not detect local IP

Hi All

I'm trying to configure DDNS on my D-Link DWR-921 (has an embedded LTE modem) running OpenWrt 19.07.1.

I registered a domain on dlinkddns (which uses dyn.com) and configured the Dynamic DNS tab from the LuCi interface as described in this link. When running, I got this error:

** Advanced Settings - IP address source [IPv4]: can not detect local IP. Please select a different Source combination**

I tried viewing the log file under Services > Dynamic DNS > Log File Viewer and found the following:

235840       : ************ ************** ************** **************
 235840  note : PID '2365' started at 2020-03-09 23:58
 235840       : ddns version  : 2.7.8-12
 235840       : uci configuration:
ddns.myddns_ipv4.domain='xyz.dlinkddns.com'
ddns.myddns_ipv4.enabled='1'
ddns.myddns_ipv4.interface='wan'
ddns.myddns_ipv4.ip_interface='br-wan'
ddns.myddns_ipv4.ip_network='guest'
ddns.myddns_ipv4.ip_source='network'
ddns.myddns_ipv4.lookup_host='xyz.dlinkddns.com'
ddns.myddns_ipv4.password='***PW***'
ddns.myddns_ipv4.service_name='dyn.com'
ddns.myddns_ipv4.username='koko123'
ddns.myddns_ipv4=service
 235840       : verbose mode  : 0 - run normal, NO console output
 235841       : check interval: 600 seconds
 235841       : force interval: 259200 seconds
 235841       : retry interval: 60 seconds
 235841       : retry counter : 0 times
 235841       : No old process
 235841       : last update: never
 235841       : Detect registered/public IP
 235841       : #> /usr/bin/nslookup hoopoedigital.dlinkddns.com  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 235841       : Registered IP '45.247.208.198' detected
 235841  info : Starting main loop at 2020-03-09 23:58
 235841       : Detect local IP on 'network'
 235841       : Local IP '192.168.182.1' detected on network 'guest'
 235842       : Update needed - L: '192.168.182.1' <> R: '45.247.208.198'
 235842 ERROR : No or private or invalid IP '192.168.182.1' given! Please check your configuration
 235842 ERROR : No update send to DDNS Provider
 235842       : Waiting 600 seconds (Check Interval)
 000842       : Detect registered/public IP
 000842       : #> /usr/bin/nslookup hoopoedigital.dlinkddns.com  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 000842       : Registered IP '45.247.208.198' detected
 000842  WARN : Updating IP at DDNS provider failed - starting retry 1/0
 000842       : Detect local IP on 'network'
 000842       : Local IP '192.168.182.1' detected on network 'guest'
 000842       : Update needed - L: '192.168.182.1' <> R: '45.247.208.198'
 000842 ERROR : No or private or invalid IP '192.168.182.1' given! Please check your configuration
 000843 ERROR : No update send to DDNS Provider
 000843       : Waiting 600 seconds (Check Interval)

My current LTE real IPv4 is (105.202.54.209) .. and the IP (45.247.208.198) that shows in the log file is a previous IP that I was assigned last time I was testing on a landline connection.

Any reason why I'm unable to run the DDNS over LTE?

The real issue is here:

You are telling the DDNS scripts that your internet connection comes through the "guest" network instead of "wan".

1 Like

But I indeed have selected "wwan" ..

Could this be a problem in LuCi? Do I need to change that over SSH?

I changed the configuration directly on the /etc/config/ddns file as follows:

config service 'myddns_ipv4'
        option ip_source 'network'
        option service_name 'dyn.com'
        option enabled '1'
        option lookup_host 'xyz.dlinkddns.com'
        option domain 'xyz.dlinkddns.com'
        option username 'koko123'
        option password '***PW***'
        option ip_network 'wwan'
        option interface 'wwan'
        option ip_interface 'wwan0'

I got this new error:

032945  note : PID '8526' started at 2020-03-10 03:29
 032945       : ddns version  : 2.7.8-12
 032945       : uci configuration:
ddns.myddns_ipv4.domain='xyz.dlinkddns.com'
ddns.myddns_ipv4.enabled='1'
ddns.myddns_ipv4.interface='wwan'
ddns.myddns_ipv4.ip_interface='wwan0'
ddns.myddns_ipv4.ip_network='wwan'
ddns.myddns_ipv4.ip_source='network'
ddns.myddns_ipv4.lookup_host='xyz.dlinkddns.com'
ddns.myddns_ipv4.password='***PW***'
ddns.myddns_ipv4.service_name='dyn.com'
ddns.myddns_ipv4.username='koko123'
ddns.myddns_ipv4=service
 032945       : verbose mode  : 0 - run normal, NO console output
 032945       : check interval: 600 seconds
 032945       : force interval: 259200 seconds
 032945       : retry interval: 60 seconds
 032945       : retry counter : 0 times
 032945       : No old process
 032945       : last update: never
 032945       : Detect registered/public IP
 032945       : #> /usr/bin/nslookup xyz.dlinkddns.com  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err
 032946       : Registered IP '45.247.208.198' detected
 032946  info : Starting main loop at 2020-03-10 03:29
 032946       : Detect local IP on 'network'
 032946 ERROR : Can not detect local IP using network_get_ipaddr 'wwan' - Error: '1' - TERMINATE
 032946  WARN : PID '8526' exit WITH ERROR '1' at 2020-03-10 03:29

The guest network @eduperez referred to is wwan, you just need to remove one 'w' so it will be wan.

2 Likes

@mike not really .. "WAN" is the Ethernet WAN, while "WWAN" is the LTE WAN. I'm using LTE connection as described earlier in the post.

I believe the problem is in the IP showing at the Virtual dynamic interface (DHCP client) .. this is not my real IPv4. I'm not running the QMI in the raw_ip mode.

Which of your interfaces has a public IP address?

These are all my WAN interfaces .. WWAN0 is the one that has an IPv4 but it's not the same as the public IP that I can see on whatismyipaddress ..

I'm not a QMI expert, but I believe the issue is that the obtained IP on the Virtual Dynamic Interface is not usable with DDNS .. I'm not sure how to obtain the actual IP .. ifconfig shows the following:

br-guest  Link encap:Ethernet  HWaddr 18:0F:76:CB:3C:70  
          inet6 addr: fd17:e5bf:f59b::1/60 Scope:Global
          inet6 addr: fe80::1a0f:76ff:fecb:3c70/64 Scope:Link
          UP BROADCAST RUNNING  MTU:1500  Metric:1
          RX packets:125730 errors:0 dropped:0 overruns:0 frame:0
          TX packets:109574 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:17151726 (16.3 MiB)  TX bytes:69845162 (66.6 MiB)

br-lan    Link encap:Ethernet  HWaddr 18:0F:76:CB:3C:70  
          inet addr:192.168.8.1  Bcast:192.168.8.255  Mask:255.255.255.0
          inet6 addr: fd17:e5bf:f59b:10::1/60 Scope:Global
          inet6 addr: fe80::1a0f:76ff:fecb:3c70/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68907 errors:0 dropped:0 overruns:0 frame:0
          TX packets:57189 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11018528 (10.5 MiB)  TX bytes:39534539 (37.7 MiB)

br-wan    Link encap:Ethernet  HWaddr AE:CA:7B:CE:72:9A  
          inet6 addr: fe80::acca:7bff:fece:729a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19529 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:6676998 (6.3 MiB)

eth0      Link encap:Ethernet  HWaddr AE:CA:7B:CE:72:9A  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19536 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:6678557 (6.3 MiB)
          Interrupt:5 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:2414 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2414 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:247507 (241.7 KiB)  TX bytes:247507 (241.7 KiB)

tun0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  
          inet addr:192.168.182.1  P-t-P:192.168.182.1  Mask:255.255.252.0
          inet6 addr: fe80::bd82:ab48:e96b:c2b9/64 Scope:Link
          UP POINTOPOINT RUNNING  MTU:1500  Metric:1
          RX packets:97234 errors:0 dropped:0 overruns:0 frame:0
          TX packets:114478 errors:0 dropped:351 overruns:0 carrier:0
          collisions:0 txqueuelen:100 
          RX bytes:14698778 (14.0 MiB)  TX bytes:75124007 (71.6 MiB)

wlan0     Link encap:Ethernet  HWaddr 18:0F:76:CB:3C:70  
          inet6 addr: fe80::1a0f:76ff:fecb:3c70/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68874 errors:0 dropped:0 overruns:0 frame:0
          TX packets:60216 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11982566 (11.4 MiB)  TX bytes:41394229 (39.4 MiB)

wlan0-1   Link encap:Ethernet  HWaddr 18:0F:76:CB:3C:71  
          inet6 addr: fe80::1a0f:76ff:fecb:3c71/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:125702 errors:0 dropped:0 overruns:0 frame:0
          TX packets:110369 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:18911386 (18.0 MiB)  TX bytes:72198455 (68.8 MiB)

wwan0     Link encap:Ethernet  HWaddr 2A:35:A0:E7:5B:82  
          inet addr:10.102.164.118  Bcast:10.102.164.119  Mask:255.255.255.252
          inet6 addr: fe80::2835:a0ff:fee7:5b82/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:110023 errors:0 dropped:0 overruns:0 frame:0
          TX packets:84429 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:109378225 (104.3 MiB)  TX bytes:14946600 (14.2 MiB)

I suspect it's related to not using raw_ip mode in QMI .. I tried to switch to it, but I couldn't even get connected to the internet, rather than obtaining an IP.

You are behind CG-NAT, so DDNS will not work in your case.
This is usually the case with LTE/3G/etc
This is not a spam :slight_smile:

3 Likes

@trendy so, what is your suggestion for remote access to the NAS device?

Change ISP, hire a VPS, ...

1 Like

Why is WAN in a bridge?

Even i have the same issue...were u able to solve it? @MohammadOmara