What's new

Entware ntpd on Stock Firmware for GS-AX3000?

  • 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!

dwp

Regular Contributor
Hello and thanks in advance for any help offered...

I have a GS-AX3000 running stock AsusWrt. I have managed to install/run some Entware utilities on the USB drive stuck in the router - especially tcpdump but also less, netstat, and I execute a script in /jffs/scripts via the nvram variable script_usbmount that mounts /opt on the root of the USB drive and enters a job in /var/spool/cron/crontabs/admin. I managed to find online references for doing all of this although it is a far cry from actually understanding all I am doing.

I would like very much to run a local ntp server on this router so I can completely disconnect some of my IOT devices from the internet by blocking internet access at the router level. When I do this now, those devices cannot get time sync'ed and that can be a problem.

I can see, using opkg list | grep ntpd, that there seems to be an "ntp suite" available that includes ntpd. And I wonder if I can use this somehow to accomplish what I want? I can see that Merlin offers this built-in but sadly there is no support for this model router in Merlin.

If this can possibly work and do what I want, I am not quite sure how to proceed, how to configure, and how/if I need to disable the built-in ntp client in the stock firmware. I have noticed in this thread that the OP ended up clearing the ntp servers from nvram using

Code:
nvram set ntp_server0=""
nvram commit

And I see, using nvram getall | grep ntp, the following on my router:

Code:
ntp_ready=1
ntp_server0=pool.ntp.org
ntp_server1=time.nist.gov
ntp_server_tried=pool.ntp.org

So perhaps I will have to clear all of these?

Anyhow, I have never configured an ntp server and have no idea what to do for that or what is the best way to start the server. So any pointers are helpful. Thanks!
 
And I see, using nvram getall | grep ntp, the following on my router:

Code:
ntp_ready=1
ntp_server0=pool.ntp.org
ntp_server1=time.nist.gov
ntp_server_tried=pool.ntp.org

So perhaps I will have to clear all of these?
Leave those alone. They are the servers that the router's NTP client connects to. If you disable that your router will not be able to set it's own clock.

If your router's built-in NTP client doesn't have the ability to also run as a server I'd suggest you try using Entware's chrony package rather than ntpd as that has the option (-x) to run as a server only without interfering with the router's clock.
 
Last edited:
Leave those alone. They are the servers that the router's NTP client connects to. If you disable that your router will not be able to set it's own clock.

If your router's built-in NTP client doesn't have the ability to also run as a server I'd suggest you try using Entware's chrony package rather than ntpd as that has the option (-x) to run as a server only without interfering with the router's clock.
Thanks. I was not even aware to chrony. Will look into it more. Cheers
 
Thanks. I was not even aware to chrony. Will look into it more. Cheers
See if your router's built-in NTP client can also be a server. I don't know what client your router uses but do something like this and look for a server option. It might save you the hassle of installing a separate server package.

Rich (BB code):
# ps | grep [n]tp
 2661 admin     3852 S    /usr/sbin/ntp -t -S /sbin/ntpd_synced -p time.google.com -p time.windows.com -l -I br0

# /usr/sbin/ntp -?
/usr/sbin/ntp: invalid option -- '?'
BusyBox v1.25.1 (2022-03-25 10:23:25 EDT) multi-call binary.

Usage: ntp [-dnqNwtl -I IFACE] [-S PROG] [-p PEER]...

NTP client/server

        -d      Verbose
        -n      Do not daemonize
        -q      Quit after clock is set
        -N      Run at high priority
        -w      Do not set time (only query peers), implies -n
        -t      Trust network and server, no RFC-4330 cross-checks
        -S PROG Run PROG after stepping time, stratum change, and every 11 mins
        -p PEER Obtain time from PEER (may be repeated)
                If -p is not given, 'server HOST' lines
                from /etc/ntp.conf are used
        -l      Also run as server on port 123
        -I IFACE Bind server to IFACE, implies -l
 
See if your router's built-in NTP client can also be a server. I don't know what client your router uses but do something like this and look for a server option. It might save you the hassle of installing a separate server package.

Rich (BB code):
# ps | grep [n]tp
 2661 admin     3852 S    /usr/sbin/ntp -t -S /sbin/ntpd_synced -p time.google.com -p time.windows.com -l -I br0

# /usr/sbin/ntp -?
/usr/sbin/ntp: invalid option -- '?'
BusyBox v1.25.1 (2022-03-25 10:23:25 EDT) multi-call binary.

Usage: ntp [-dnqNwtl -I IFACE] [-S PROG] [-p PEER]...

NTP client/server

        -d      Verbose
        -n      Do not daemonize
        -q      Quit after clock is set
        -N      Run at high priority
        -w      Do not set time (only query peers), implies -n
        -t      Trust network and server, no RFC-4330 cross-checks
        -S PROG Run PROG after stepping time, stratum change, and every 11 mins
        -p PEER Obtain time from PEER (may be repeated)
                If -p is not given, 'server HOST' lines
                from /etc/ntp.conf are used
        -l      Also run as server on port 123
        -I IFACE Bind server to IFACE, implies -l
Thanks once again. On my router, the ntp binary is located in /sbin and is symlinked to /sbin/rc. Executing ntp in any way seems to yield nothing. I have checked the busybox and found it is installed in /bin and is version 1.24.1 but ntp is not in its list of currently defined functions. So I guess the simple solution will not work here. Cheers
 
There's no ntpd in the stock firmware.
 

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

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