Wondering why my dumb access point doesn't seem to be asking for the date/time from the ntp server like my main router does. It is currently over 90 minutes off the real time. I have the dumb AP setup to do so and the daemon is running:
I finally gave up and added a time server to my local net.
On router and dumb AP I just point to the local server’s ip. Probably not needed, but I also run a cron every hour on the router to call ntpdate to step the clock.
Please run the following commands and paste the output here, using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have
ubus call system board
uci export system
uci export network
ls -l /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
head -n -0 /etc/resolv.* /tmp/resolv.* /tmp/resolv.*/*
nslookup 0.openwrt.pool.ntp.org
cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
if [ -x /root/update_date ]; then
at -f /root/update_date now+2minutes 2> /dev/null 1> /dev/null
fi
as I assume that when you restart your router you will not immediately be able to access resources on the internet
you can install the at command
opkg update; opkg install at
and edit your /etc/rc.local file
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
# these do not run APs
for i in firewall dnsmasq odhcpd wpad; do
if [[ -f /etc/init.d/$i ]]; then
if /etc/init.d/$i enabled; then
/etc/init.d/$i stop
/etc/init.d/$i disable
fi
fi
done
if [[ ! -f /root/.profile ]]; then
echo "[[ -x /usr/bin/zsh ]] && exec zsh" > /root/.profile
fi
### .zshrc
if [[ ! -f /root/.zshrc ]]; then
cat <<EOF > /root/.zshrc
echo -e "\x1B]2;root@\$(uname -n)\x07";
bindkey -v
PS1='%F{green}%n%f@%m %/ # '
uptime
uname -a
PATH=\$PATH:\$HOME/bin
HISTFILE=/root/.zsh_history
HISTSIZE=10000
SAVEHIST=10000
setopt append_history
setopt hist_expire_dups_first
setopt hist_ignore_space
setopt inc_append_history
setopt share_history
bindkey "^[[H" beginning-of-line
bindkey "^[[F" end-of-line
bindkey "^[[3~" delete-char
autoload -Uz up-line-or-beginning-search
autoload -Uz down-line-or-beginning-search
zle -N up-line-or-beginning-search
zle -N down-line-or-beginning-search
bindkey '\eOA' up-line-or-beginning-search
bindkey '\e[A' up-line-or-beginning-search
bindkey '\eOB' down-line-or-beginning-search
bindkey '\e[B' down-line-or-beginning-search
if [ -x /root/update_date ]; then
at -f /root/update_date now+2minutes 2> /dev/null 1> /dev/null
fi
exit 0
you need to set both the gateway and dns addresses on your dumb AP.
assuming your main router handles DNS for your network, and that your dumb AP has a static IP that you have configured, you will have to set DNS specifically.
go to lan interface config.
on general settings tab, make sure the gateway is set to your main router IP .
on the advanced tab: make sure 'custom dns' is set to your main router IP if it has not picked it up automatically (which it won't with static IP)
That is what I am not understanding. As it is configured, it works if sysntpd is manually triggered, so the DNS is getting discovered OK. Perhaps there is a race condition on boot or something that is starting sysntpd before that is setup?
EDIT: appending this to /etc/rc.local causes it to boot and have the correct time setup.
@ncompact - unless I am not understanding the purpose of the script you have provided, the vast majority has nothing to do with updating the time/date... I wouldn't recommend that anyone use this script, as it actually could cause more complications.
to set the dns server manually, uncheck 'use DNS serverss advertized by peer'
regarding static vs dynamic -you have stated that you have wanted to stay as dynamic IP. with the default dynamic configuration, what are your dumb AP interface settings showing for DNS?
from the CLI, can you ping and resolve pool.openwrt.ntp.org? it was not clear from your posts.
I simply reported the script used and posted by the user,
I added a command that the user already said worked...
Maybe I expressed myself badly in my first post,
in which I had already put what the user would have to do to execute a command at system startup, after the network had started to work (2 minutes seemed enough to me).
cat /etc/rc.local
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
if [ -x /root/update_date ]; then
at -f /root/update_date now+2minutes 2> /dev/null 1> /dev/null
fi
exit 0
Yeah... that's fine. But most of the script -- all of the zshrc history stuff, disabling dnsmasq, firewall, etc... those don't apply here and shouldn't be added to rc.d