fudge parameter not found in centos linux ntp.conf configuration

Recently, the server was forced to shut down once and suddenly wanted to get the time synchronization service all together (in an intranet environment, unable to connect to the Internet)

Why should I record this article?
It took me almost a day because it was so simple.
Always make mistakes, try to modify the configuration, continue to make errors, and then when I almost despair and want to spit out the linux ntpd garbage, it suddenly takes effect.
Just because a configuration interface listen was added, or perhaps because it happened to be time to wait.
I don't understand why the Internet says it will take a few minutes to take effect? I sync with ntpdate-d-v $IP, why give me
There was an error. I don't know how to fix it yet.
This linux is so hard to use.

ntpd server configuration (

vim ntp.conf

# For more information about this file, see the man pages
# ntp.conf(5), ntp_acc(5), ntp_auth(5), ntp_clock(5), ntp_misc(5), ntp_mon(5).

driftfile /var/lib/ntp/drift

# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default  nomodify notrap  nopeer noquery

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
restrict ::1

# Hosts on local network are less restricted.
#restrict mask nomodify notrap
restrict mask nomodify notrap

# Use public servers from the pool.ntp.org project.
# Please consider joining the pool (http://www.pool.ntp.org/join.html).
#server 0.centos.pool.ntp.org iburst
#server 1.centos.pool.ntp.org iburst
#server 2.centos.pool.ntp.org iburst
#server 3.centos.pool.ntp.org iburst
server burst true prefer
#fudge stratum 8
interface listen
#...omitted from the back

The key points are:

Active for specified LAN segment
restrict mask nomodify notrap
Set up the server itself to serve as a separate ntpd server
server burst true prefer
After the above configuration increases, it doesn't take effect yet. Amazingly, I found almost no one mentioned the configuration below. It seems to have worked
interface listen
I can't see this in the man manual. What's wrong?
fudge stratum 0

The fudge parameter does not appear to be valid

ntpd --version
ntpd 4.2.6p5

According to ntp.org's records, the latest version is the 4.2.8pX series, which should be a version problem;

ntp client configuration ( all uses time configuration

Clients are simple, and when I test ok, I do batch operations:

yum install ntpd -y
sed -i 's/^server/#server/g' /etc/ntp.conf 
line=`grep "#server" /etc/ntp.conf -n|tail -n 1|cut -d ':' -f 1`
if test -z "$line";then echo "not found server ";return;fi
sed -i -e "$line a server prefer iburst" /etc/ntp.conf 
systemctl enable ntpd||chkconfig --level 345 ntpd on
systemctl restart ntpd||service ntpd restart
ntpstat ; ntpq -p; ntpdate -d
ntpdate -v -d

Finally, it works. Start various ntpd services. It is best not to use crontab to write ntpdate timer commands. ntpdate is only suitable for manual operation.

Later, we checked that the original windows w32time service also supports ntpd, which can be configured as either ntpd server or ntp client
Link ntpd server (win s or linux, pass-through support), the most critical is that the configuration is simple and the use is simple.

So linux works really well.

REF: http://doc.ntp.org/
ntp.conf: Things rarely mentioned
interface listen configuration for ntp, binding listening

Tags: Linux CentOS vim network

Posted on Mon, 11 May 2020 21:10:17 -0400 by glodders