What's new

DDNS custom script for use with asus.com

  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Code:
ASUSWRT-Merlin RT-AC88U 380.66-6 Wed Jun 21 19:07:32 UTC 2017
admin@RT-AC88U-97F8:/tmp/home/root# cd /jffs/scripts
admin@RT-AC88U-97F8:/jffs/scripts# ls
ASUSddns2.sh  ddns-start    ddns_loop.sh
admin@RT-AC88U-97F8:/jffs/scripts# ./ASUSddns2.sh
Usage: mac wps host (register|update) (logger|console|silent)

mac format: 00:11:22:33:44:55     (asus mac address) [to get it from nvram: nvram get et0macaddr]
wps format: 12345678              (your wps code) [to get it from nvram: nvram get secret_code]
host format: testestest           (your hostname without .asucomm.com)

Program output:
logger   -->  /var/log/messges
console  -->  console
silent   -->  mute output

example to register and update testestest.asuscomm.com:
./ASUSddns2.sh 00:11:22:33:44:55 12345678 testestest register console
./ASUSddns2.sh 00:11:22:33:44:55 12345678 testestest update logger

Launch 'register' the first time to register the new domain with your mac address.
Launch 'update' each 5 minutes (eg: with cron jobs) to keep dns updated.

ASUSddns script by BigNerd95 (https://github.com/BigNerd95/ASUSddns)
admin@RT-AC88U-97F8:/jffs/scripts#

I tried ./ASUSddns2.sh and got the usage information as above because it needs arguments....but the question is why you get the "not found" error.

I'm wondering if it is a user, ownership and permission issue. Note that I am logged in via ssh as "admin" when I do this, whereas you see to be a user "killer"?

Can you do this as user admin or even root?

Thanks
:)
 
@Leechpool the root user on all Asus routers is the username you log into it, admin being the default name.
killeriq changed it to killer.
 
yeah thats my login name into ASUS router...is there a way how to become root? tried sudo su and got error.
 
yeah thats my login name into ASUS router...is there a way how to become root? tried sudo su and got error.
You are root with that user name.
Enter this into the terminal when in the /jffs/scrips/ directory.
Substitute both number 1 with the lower case letter l (Cloudfare prohibits writing that command):
Code:
1s -1a
Then post the output.
 
So what i did (small cheat) copied the content of the ASUSddns2.sh and copied into ASUSddns.sh - now it work i can run it via the ssh
now i can edit "ddns_loop.sh" and change "/jffs/scripts/ASUSddns2.sh" to "/jffs/scripts/ASUSddns.sh"

run it and seems that Attributes are the same.

upload_2017-10-28_23-46-39.png


When is now set and modified with this "cheat" what are the next steps? Just reboot and it should work or i need to run something in SSH?

EDIT: the Cheat was the issue with file encoding - has Windows CR LF and it needed to be changed to Unix LF in notepad++

thanks
 
Last edited:
ez-ipupdate has Asusddns support, you don't need a script to use it.
 
So how to make it run?
when all scripts are in and i reboot router seems like is not starting:
upload_2017-10-29_10-0-35.png


Ive tried to run "ddns-start.sh" manually and status changed to connected (but i need to be on the WAN->DDNS page otherwise it wont start)

upload_2017-10-29_10-59-32.png


ive tried to check
upload_2017-10-29_11-3-4.png

1. it gives me the IP of my provider, but im behind his NAT, so now i need to get the VPN IP bounded to that DDNS host.
2. Seems like its not starting automatically after reboot
upload_2017-10-29_11-17-9.png


Slowly we are getting there :)
 
Killeriq,
Do you have ddns settings in asus merlin set to "custom"...this automatically runs ddns-start.sh when it boots (I think).
If all else is correct, you shouldn't have to do anything else...
The ddns should look after itself (mine does).
If you have the vpn port forwarded to the asus router running the vpn server, incoming vpn connections to the host.asuscom.com url should work (mine do).
:)
 
Last edited:
RMerlin,
Could you confirm that "ez-ipupdate" will install on an asus running merlin and work in a double NAT situation?
Because I would much rather use a solution like that than create and fiddle with custom scripts?
I've quickly tried searching and can't find instructions on what to do to get it working etc...is it part of merlin firmware or does it have to be installed somehow?
:)
 
Last edited:
Yes its set (screen 1 before reboot):
upload_2017-10-29_16-23-45.png


But soon as i reboot it wont connect - i need to run the "ddns-start.sh" manually...
When i click OK then it shows the "screen 1" , but is still not connected (screen2)
upload_2017-10-29_16-28-41.png

If i click Apply it just "applying" forever...
upload_2017-10-29_16-34-16.png

Even i run it, im not able to Access the devices on VPN Public IP - in the test link, it shows the Provider IP , not the VPN IP

upload_2017-10-29_11-3-4-png.10828


So how i set it up to take the VPN IP?

Thanks
 
Not sure what you mean by "But soon as i reboot it wont connect"?
I just checked, apart from the fact that my forced refresh interval is set to 1 day, my settings look the same as yours.
I just rebooted by router and looked in the system log and there was a reference to ddns having run. So it should start the ddns-start script automatically!? (I suggest to reboot....then do nothing but look in system log for a reference to ddns...it's just a line saying that it's run...if it's not there you need to work out why).
My ddns screen looks like your top one....I don't know what the other two screens you posted are. I haven't played with my router in months...I just set it all up and it sits there working, so I'm not that familiar with everything.
If the system log shows the ddns has run try looking up the host.asuscom.com and if it matched your external IP (get by googling "whatsmyip" or otherwise), then ddns is working ok....
:)
 
OK...I looked a bit closer. In my post earlier (and on my machine) the "ddns-start" file doesn't have ".sh" on the end. You have put a ".sh" on the end. The asus is probably trying to run "ddns-start" during boot or when you set ddns to custom but you don't have one. Suggest removing the ".sh"....
The other two files do need ".sh" on the end of thier file names but "ddns-start" does not.
:)
 
Damn...yeah that was it :D ".sh" needed to be removed ...

So now i get "connected" but this when i test http://iplookup.asus.com/nslookup.php i get my Provider IP not the VPN IP

Are you on VPN as i am? or you have Public IP directly?
---

I found this script which should work o Double NAT (probably my case)

https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS

Need to review it how do i set it up in my case as i dont use "openvpn-event "script but all is set via Merlin UI.
Any clue? someone ...Merlin perhaps? :)
 
Could you confirm that "ez-ipupdate" will install on an asus running merlin and work in a double NAT situation?

ez-ipupdate is part of the firmware, it's what the router uses for DDNS services already.

I don't know if it will work in double NAT with the Asus DDNS service, you will have to try it.
 
I am not permanently connected to an external VPN. I have one but only use it from specific machines on my LAN when I need to. I assume that if the VPN connection is permanent, and all traffic passes through it, specifically the traffic used by the ddns script to detect your external IP, then when the ddns script detects the external IP it should find the "VPN" one and update the host.asuscom.com url dns with the VPN IP. So it should work assuming I'm understanding what you are trying to do...are you giving it long enough to settle down. The ddns update to dns records will not ripple around the internet instantly. Try leaving it for several hours and seeing if it works....:)
 
I am not permanently connected to an external VPN. I have one but only use it from specific machines on my LAN when I need to. I assume that if the VPN connection is permanent, and all traffic passes through it, specifically the traffic used by the ddns script to detect your external IP, then when the ddns script detects the external IP it should find the "VPN" one and update the host.asuscom.com url dns with the VPN IP. So it should work assuming I'm understanding what you are trying to do...are you giving it long enough to settle down. The ddns update to dns records will not ripple around the internet instantly. Try leaving it for several hours and seeing if it works....:)

I have only few IPs set for VPN.
So even its connected permanently its only set for defined local IP.

i assume i need to add additional script as stated here https://github.com/RMerl/asuswrt-merlin/wiki/Custom-DDNS , but not sure where the "open-vpn-event" script should be located, or do i have to create it and save into "/jffs/scripts/" as others?
upload_2017-10-29_18-23-59.png
 
Thanks RMerlin,
I thought that the asusmerlin by default only did ddns updates if the WAN IP changed, meaning that if the WAN IP was a LAN IP, such that it didn't change, the default ddns implementation would never detect a public IP change and so never update the dns records. This is why I created the scripts Killer is tying to use.
Am I wrong? has the default behaviour changed (e.g. it no longer relies on a WAN IP change to trigger update)? My problem is I'm using a home hub router / modem in the UK to connect to the internet so can't avoid double NAT. The home hub is provided free by the ISP, but has very little functionality and I'd have to go out of my way to get a dedicated modem (not modem / router) to connect such that merlin firmware default ddns implementation would work.
I love asusmerlin because it can give me a vpn server etc. but the way many ISPs provided free modem routers in the uk makes ddns difficult as you tend to be double NAT.
Thanks
:)
 
so guys how do i mod it?

i assume:
Code:
ez-ipupdate -S dyndns -u user:password -h host.dyndns.org -a $VPNIP #update dyndns with VPN IP
into
Code:
ez-ipupdate -S Custom -u MyUser:124515 -h MyUser.asuscomm.com -a $VPNIP #update dyndns with VPN IP

but no clue where is that "openvpn-event" script file to add it there

Or is somewhere guide how to do it? as the description on the scripts is not helping me much
 
has the default behaviour changed (e.g. it no longer relies on a WAN IP change to trigger update)?

No, it's still tied to the WAN IP changing. If you need to handle different situations, then you might need to use a cron job to periodicly check the IP, and update it if it changed.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!
Top