Ddns problem with local ip

Hello,
I am running openwrt 18.06.01 and runing ddns-scripts 2.7.8-1 and luci-app-ddns 2.4.9-3.
I have this error

163345       : Registered IP 'aa.bb.cc.dd' detected
 163345  WARN : Updating IP at DDNS provider failed - starting retry 7/0
 163346       : Detect local IP on 'wan'
 163346       : Local IP '192.168.178.22' detected on network 'wan'
 163346       : Update needed - L: '192.168.178.22' <> R: 'aa.bb.cc.dd'
 163347 ERROR : No or private or invalid IP '192.168.178.22' given! Please check your configuration
 163347 ERROR : No update send to DDNS Provider
 163348       : Waiting 600 seconds (Check Interval)
 164348       : Detect registered/public IP
 164348       : #> /usr/bin/nslookup my.ddns.info  >/var/run/ddns/myddns_ipv4.dat 2>/var/run/ddns/myddns_ipv4.err

My config file is:

config ddns 'global'
        option ddns_dateformat '%F %R'
        option ddns_loglines '100'
        option upd_privateip '0'

config service 'myddns_ipv4'
        option interface 'wan'
        option ip_source 'network'
        option ip_network 'wan'
        option service_name 'changeip.com'
        option username 'my@user.name'
        option password 'mypassword'
        option enabled '1'
        option domain 'my.ddns.info'
        option lookup_host 'my.ddns.info'
       

I am doing something wrong, but I do not see where the error is.
Help is appreciated.
Kind regards, Lucas

Looks like you've got a private IP assigned to your WAN interface and your DDNS provider is properly rejecting it.

1 Like

Thanks for the reply.
Yes, you are right, but how can I assign the proper IP to the wan interface?
Regards, Lucas

Is the WAN interface connected to your ISP? If so, it likely needs to be configured for DHCP (unless you have one or more static IPs assigned by the ISP, which is very uncommon for "home" users).

Hello Jeff,

Yes, my wifirouter (wndr3700) is connected to my ISP. The ISP modem has given, with DHCP, the local IP-dres. That is normal, I think.
I suppose I had to change something in the config-file. But I do not know what.
In the records ...

    option interface 'wan'
    option ip_source 'network'
    option ip_network 'wan'

... is going something wrong (I think, but I am not sure), but I cannot figure out what.
Help is appreciated.

Kind regards, Lucas

What type is the uplink of your ISP modem: cable/DSL/something else?
Is your ISP modem set to bridge mode? Does it have a page with status information or even adjustable settings?
Does your ISP offer IPv6, and could you use it instead of IPv4 for connections from outside?

Hello @mpa,

The ISP modem is a cable modem Ubee EVW3200 with status information and adjustable.

IPv6 is not offered.

Openwrt 18.06.01 STATUS gives:
Protocol: DHCP client
Address: 192.168.178.22
Netmask: 255.255.255.0
Gateway: 192.168.178.1
DNS 1: a.b.c.d
DNS 2: e.f.g.h

Kind regards, Lucas

If you can't ask the ISP modem what your external IP is then you have to ask a server on the outside or let changeip.com determine it by itself. On the advanced config page you can change IP address source to URL and use this: https://www.changeip.com/accounts/knowledgebase.php?action=displayarticle&id=6

You will probably need forward ports in the ISP modem as well. Have you checked that the server you want to be available works through the external IP? If not there is not much use in setting up DDNS.

1 Like

Switching the modem to "bridged" mode may make your configuration a lot more robust. When in bridge (or pass-through) mode, the public IP is assigned to your OpenWrt router and the modem does no NAT

You'll have to check on the Internet or other sources, but there may be an "advanced options" tab or the like where you can change it to bridged mode. You may need to "bump" the network on your OpenWrt box after you do that so it gets a new IP address on its LAN.

Hello @jeff,

Behind the ISP modem I have several wndr3700 wifi routers. Each router serves with or without wifi a network with a specific task. Therefore, I do not think it is wise to put the ISP modem on "bridge".

I have one router that functions as a vpn-443 "road warrior" solution. I use it for unsafe WiFi and when I am abroad and need a natonal ip. Because sometimes (not often) my ISP-IP (= wan_ip) changes, I want to apply ddns, at changeip, com I now have a ddns address that corresponds with my current wan_ip address. The dynamic dns gives you the possibility to always have the right wan_ip at home even if you are far away. My ddns provider says "you are comparing a local ip adres with a wan_ip adres and thats a error. he is right. So I search for a way to ask "what is my current wan ip and then I can compare it with the ddns-proveder ip.
So, is it possible to put a command in the config-file (or in the ddns-script) that reads the ip of wan? Or is that thinking too simple?
Kind regards, Lucas

It sounds like you've thought through your network topology and are comfortable with where and how NAT is being done.

There isn't a "trivial" way for the OpenWrt router to know your public IP(s), as they aren't interfaces on the device. I can see two ways of approaching it:

  1. Use a feature of your DDNS provider that uses the source IP of the connection, rather than something you put in the payload
  2. Make a request to one of the servers that will return the source IP it sees and base your request to the DDNS provider on that.

(1) is the simplest, if your DDNS provider supports it. That is what I would try first if in your situation.

On (2), I just used Google to find https://www.ipify.org/ (I have never used the service, nor do I know anything about its reliability, data stewardship practices, or the like). Based on that page, it looks very straightforward with both plain-text and JSON response formats available.

@Jeff, thank you for the advise.
I will try both options, thanks.
Kind regards, Lucas

Hello @Jeff,

Your first solution works.
My config:

service 'myddns_ipv4'
#       option interface 'wan'
        option ip_source 'web'
#        option ip_network 'wan'
        option ip_url 'http://ip.ChangeIP.com'
#
        option service_name 'changeip.com'
        option username 'my@user.name'
        option password 'mypassword'
        option enabled '1'
        option domain 'my.ddns.info'
        option lookup_host 'my.ddns.info'
#

It is alsoo possible to use Luci.

Thank you very much.

Kind regards, Lucas

1 Like

If your problem is solved, please consider marking this topic as [Solved]. (Click the pencil behind the topic...)

You can also mark the reply that solved your problem:
grafik

1 Like

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.