[WONTFIX] DDNS issues w/ Tmo home internet / CGNAT

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Goto page 1, 2, 3  Next

Release more frequent DDNS updating via GUI
YES
50%
 50%  [ 1 ]
NO
50%
 50%  [ 1 ]
Total Votes : 2

Author Message
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Sat Oct 15, 2022 21:49    Post subject: [WONTFIX] DDNS issues w/ Tmo home internet / CGNAT Reply with quote
SHORT QUESTION
Can the GUI be modified to allow setting (very) frequent DDNS checks? Like force it every 5min not 1/day?

Yes yes... I've read that "I should not have to update so often" but hear me out, b/c normal settings are not leaving me satisfied, my dd-wrt seeems lost and doesn't know when the "real wan" 3 networks up in GCNAT has changed.

Start of rant...
I've seen some posts about why you shouldn't have to... but it seems I DO have to because living behind CGNAT is great, and causing DNS records to be expired, DDNS logs even say "no update needed (from cache)... with or without external IP check enabled when in fact, it DOES need updated. I did a nightly reboot/keep alive but even this was still resulting in out of date DNS records through the day.


Rant continues...Short story longer
The 1 day minimum force update interval seems to be causing me problems. For now I've solved the issue out of desperation and resorting to hobbling 50 google results into a script and cron job to update "the duck" to know who I am (duckdns) by forcing a 2min update via custom script and enabling a cron task via GUI... but can't I just set this up easier?!


Other Background
Why do i even care if my external IP is out of sync for a few hours or day?
- NextDNS web filtering breaks when the IP is out of sync so the household can see all the nitty gritties of the internet on purpose or on accident
- Remote access... if i ever defeat CGNAT (w/o admin rights to remote computers)
- Because it should just work, right?


My solution (to-date).... feel free to suggest the issues w/ my philosphy but not without suggesting why the default behavior is failing me if I dare request such a thing.

Saved script via admin/commands/save custom
#!/bin/sh
echo url="https://www.duckdns.org/update?domains=<my subdomain>&token=<my token>&ip=" | curl -k -o ~/tmp/duck.log -K -

Saved cron (admin/management/cron)
*/2 * * * * root /tmp/.rc_custom

This took a long time (as I'm a lowly mechanical engineer hammering on coding screws)... and it just felt like if I could use the GUI to force a more frequent DNS update I wouldn't have wasted hours learning things I will soon forget... like vi commands.

I'm also wondering why the default behavior is failing, even w/ external IP check enabled? Is the an alternate (and easy) way to make DD-WRT aware of the "real" WAN IP to trigger the auto-dns-update magic upon WAN update?


Last edited by hatcreek68 on Mon Oct 24, 2022 1:56; edited 1 time in total
Sponsor
mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Sun Oct 16, 2022 15:19    Post subject: Re: DDNS issues w/ Tmo home internet / CGNAT Reply with quote
hatcreek68 wrote:
SHORT QUESTION
Can the GUI be modified to allow setting (very) frequent DDNS checks? Like force it every 5min not 1/day?

Yes yes... I've read that "I should not have to update so often" but hear me out, b/c normal settings are not leaving me satisfied, my dd-wrt seeems lost and doesn't know when the "real wan" 3 networks up in GCNAT has changed.

Start of rant...
I've seen some posts about why you shouldn't have to... but it seems I DO have to because living behind CGNAT is great, and casuing DNS records to be expired, DDNS logs even say "no update needed (from cache)... with or without external IP check enabled when in fact, it DOES need updated. I did a nightly reboot/keep alive but even this was still resulting in out of date DNS records through the day.

No harm adding such an option in the WEBUI, *BUT* your DDNS service provider might just ignore your request to update, unless your IP really changed!! Your DDNS service provider might consider your forced update as hammering its server. Smile

I am using no-ip.com, and I have never felt the need to do so...

Also, by adding such an option, DD-WRT would need to run inadyn with timer to contact your DDNS service provider? I dunno how much effort would be needed.


_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Sun Oct 16, 2022 18:33    Post subject: Reply with quote
I guess the other question really is... Can I get automatic WAN monitoring working better behind cgnat modem to ditch the need for custom scripts?

-

As you can see in the attachement below, I can trigger this mismatch between real IP and outdated IP by rebooting my T-mobile modem... via reboot or via breif power outage (rural area)... and the mismatch likely continues for 1 day until the 1 day force update occures. I'd rather the duck gets the new IP within minutes not a full day later!

-

Top domain updated within 2min via script, dd-wrt external ip check (yes) test just never realizes that the WAN is new after modem reboot!



Screenshot 2022-10-16 145100.png
 Description:
 Filesize:  119.12 KB
 Viewed:  1866 Time(s)

Screenshot 2022-10-16 145100.png


mwchang
DD-WRT Guru


Joined: 26 Mar 2013
Posts: 1855
Location: Hung Hom, Hong Kong

PostPosted: Fri Oct 21, 2022 4:53    Post subject: Reply with quote
hatcreek68 wrote:
I guess the other question really is... Can I get automatic WAN monitoring working better behind cgnat modem to ditch the need for custom scripts?

-

As you can see in the attachement below, I can trigger this mismatch between real IP and outdated IP by rebooting my T-mobile modem... via reboot or via breif power outage (rural area)... and the mismatch likely continues for 1 day until the 1 day force update occures. I'd rather the duck gets the new IP within minutes not a full day later!

-

Top domain updated within 2min via script, dd-wrt external ip check (yes) test just never realizes that the WAN is new after modem reboot!

Does your custom script just restarts DD-WRT's DDNS daemon inadyn, so as to detect the new WAN IP?

From your were saying, the WAN IP expired very frequently every day? Definitely more frequent than what inadyn's config was expecting? Could "Force Update Interval" help?

Also, it seemed that you had 2 DDNS domain names (in DD-WRT's DDNS tab, "Hostname"). I don't think DD-WRT's DDNS can support that now, and I think I saw some recent changesets related to that. But do you have 2 T-mobile modems?

Are you using build 50500?



dd-wrt.ddns.jpg
 Description:
 Filesize:  60.48 KB
 Viewed:  1812 Time(s)

dd-wrt.ddns.jpg



_________________
Router: Asus RT-N18U (rev. A1)

Drink, Blink, Stretch! Live long and prosper! May the Force and farces be with you!

Facebook: https://www.facebook.com/changmanwai
Website: https://sites.google.com/site/changmw
SETI@Home profile: http://setiathome.berkeley.edu/view_profile.php?userid=211832
GitHub: https://github.com/changmw/changmw
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Oct 21, 2022 9:08    Post subject: Reply with quote
Re: update interval, you already figured it out by the command you setup (that's the override you need for edge cases), otherwise there is nothing to be done UI wise.

Your DDNS provider has likely terms and conditions specifying this update interval, like an abuse policy or similar, so, for this we allow sane intervals only by default.

Certain providers may need a lower update interval to avoid deleting your domain, this is what the interval is for mostly.

Learning new skills is never a bad thing, no matter if you use it once or often, this is what a notepad is for -- documenting these new things and refer to them later as needed.

RE: The changes to DDNS that recently went in is pretty much validation for input fields, because before we were allowing empty fields and could lead to some crap returns that shouldn't happen on clicking save/apply/OK on e.g. freedns.afraid.org.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Oct 21, 2022 10:00    Post subject: Reply with quote
There are actually two intervals.

The forced update with a minimum of one day which always updates and the other update interval which checks if the WAN interface has changed against a cached value this check should run for some providers every 600 sec and for some every 900 sec.

There was one user who reported that the forced update was not working, I checked that ( by setting the forced update to 30 min and setting log level high, yes I can do that Smile, changing my DNS record with the provider and waiting till it updates, when I tested it, it really updated my DNS every 30 min, so forced update works.

Your question is about the check of the WAN IP, I did not check that but will put it on my list to check in the near future. But I think the check for WAN ip should run every 10 or 15 min.


Edit: forgot to mention, even after the DNS record is updated with your DDNS provider it can take some time (10-15 minutes, sometimes more in my testing) before that change trickled through to other DNS servers and an nslookup reflects the change (also due to caching etc.)

Edit 2: You should also check your lease time and see if the router really is already using its new IP address (Status -> WAN)

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Oct 21, 2022 10:57    Post subject: Reply with quote
I did a quick test

Router internal R6400v1 running build 50551
The router gets its WAN ip address as static lease from main DDWRT router.

The normal static lease address is 192.168.0.4.
I changed the static lease to 192.168.0.14 and after 10 minutes back again.

The DDNS log shows the changes:
Fri Oct 21 12:51:54 2022: INADYN: Started 'INADYN Advanced version 1.96-ADV' - dynamic DNS updater.
Fri Oct 21 12:51:54 2022: INADYN: IP read from cache file is '192.168.0.14'. No update required.
Fri Oct 21 12:51:54 2022: I:INADYN: IP address for alias 'egcpn.hopto.org' needs update to '192.168.0.4'
Fri Oct 21 12:51:54 2022: I:INADYN: Alias 'egcpn.hopto.org' to IP '192.168.0.4' updated successfully.

I also checked the IP address on my DDNS provider noip.com and it was indeed reflecting the changes first from 192.168.0.4 to 192.168.0.14 and after 10 minutes it changed back again.

So at least on my setup with noip.com it works as intended

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Fri Oct 21, 2022 18:13    Post subject: Reply with quote
OK GURUS! Thanks for reviewing the issue. However, I see this was flagged a "will not fix", and I have a different angle to try and solve this issue. Should I put a new post w/ the new angle or keep this thread going?

New angle:
Why is WAN in DD-WRT (in the GUI) not equal to my actual public IP (per google)? T-mobile is to blame w/ CG-NAT, BUT can DD-WRT defeat CG-NAT and monitor my actual external IP for changes? If DD-WRT can monitor the proper external IP, then perhaps all the existing code will work just fine and keep my DDNS up to date, and no custom scripts are needed.


Other follow-ups:

Quote:

Does your custom script just restarts DD-WRT's DDNS daemon inadyn, so as to detect the new WAN IP?

My script just sends a "ping" to the DDNS URL which has my info subdomain/token, and duckdns detects where the ping came from.

Quote:

From your were saying, the WAN IP expired very frequently every day? Definitely more frequent than what inadyn's config was expecting? Could "Force Update Interval" help?

The min update is 1 day, which is not solving my problem.

Quote:

Also, it seemed that you had 2 DDNS domain names (in DD-WRT's DDNS tab, "Hostname"). I don't think DD-WRT's DDNS can support that now, and I think I saw some recent changesets related to that. But do you have 2 T-mobile modems?

1 DNS is updated via the GUI settings (to keep a running test)
1 DNS is updated via the custom script, as to compare / demonstrate that DD-WRT 'built in' DDNS updating is failing behind CG-NAT

Quote:

Are you using build 50500?

I will have to confirm when i get home but it's more like a build 43xxx or 46xxx range.
[/quote]
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Oct 21, 2022 18:22    Post subject: Reply with quote
I do not have cgnat but did you try to Enable external ip check?
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Fri Oct 21, 2022 18:30    Post subject: Reply with quote
Yes, I tried using "external IP check: YES" while running the test, and it failed to keep my dns up to date (test ran for several days).

But if it's simply monitoring the WAN posted in the web GUI, then that is why it's failing (I think)! It gets the same IP from the T-mo router whether or not the upstream IP has updated.

I need DD-WRT to compare the "google result" of "what's my ip", and compare that to the last record, whatever IP DD-WRT thinks I have is not the correct one.

Can anyone share the "check external IP" script/code and I can tinker with that and see if there's some way to break through CG-NAT and get a real external IP returned to me?

I could tinker and just run changes via "admin/commands" and report back.
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Fri Oct 21, 2022 19:05    Post subject: Reply with quote
I also found this... what is the "service" that is used? Can I SSH to the code to try and read/understand it? I feel like this external service is what is letting me down and not returning my true external IP.


Capture.JPG
 Description:
 Filesize:  43.71 KB
 Viewed:  1724 Time(s)

Capture.JPG


the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Oct 21, 2022 19:26    Post subject: Reply with quote
code starts there

https://github.com/mirror/dd-wrt/blob/master/src/router/inadyn/src/dyndns.c#L1020

but thats C code, you cant run that in commands tab, well you can, if you want to kill kittens, drown babies and set houses on fire. We always need more people on the Arkham asylum.

_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12837
Location: Netherlands

PostPosted: Fri Oct 21, 2022 19:53    Post subject: Reply with quote
External ip check queries an external website. This should also work with cgnat

You can use from command line:
curl checkip.amazonaws.com

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
the-joker
DD-WRT Developer/Maintainer


Joined: 31 Jul 2021
Posts: 2146
Location: All over YOUR webs

PostPosted: Fri Oct 21, 2022 19:58    Post subject: Reply with quote
our inadyn is ancient also, by god, its older than my gray hairs and Im not even religious.
_________________
Saving your retinas from the burn!🔥
DD-WRT Inspired themes for routers
DD-WRT Inspired themes for the phpBB Forum
DD-WRT Inspired themes for the SVN Trac & FTP site
Join in for a chat @ #style_it_themes_public:matrix.org or #style_it_themes:discord

DD-WRT UI Themes Bug Reporting and Discussion thread

Router: ANus RT-AC68U E1 (recognized as C1)
hatcreek68
DD-WRT Novice


Joined: 29 Nov 2016
Posts: 27

PostPosted: Sat Oct 22, 2022 2:21    Post subject: Reply with quote
egc wrote:

You can use from command line:
curl checkip.amazonaws.com


From ssh I get my correct external IP. Is the DDNS code supposed to be using checkip.amazonaws.com to log/use the external IP? If so... why is it going days w/o noticing the new WAN and sending an update to duckdns?

Quote:

root@DD-WRT:~# curl checkip.amazonaws.com
172.58.8.22x
Goto page 1, 2, 3  Next Display posts from previous:    Page 1 of 3
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum