1827385 Members
4455 Online
109963 Solutions
New Discussion

About NTP!

 
SOLVED
Go to solution
xujun
Advisor

About NTP!

How can I provide NTP service?Please tell me step by step!
12 REPLIES 12
Printaporn_1
Esteemed Contributor

Re: About NTP!

simple configuration
at server:
1. edit /etc/ntp.conf
uncomment
server 127.127.1.1

at client:
2. /etc/ntp.conf
input
server

at both server
3. edit /etc/rc.config.d/netdaemons
export NTPDATE_SERVER=
export XNTPD=1
export XNTPD_ARGS=
enjoy any little thing in my life
John Strang
Regular Advisor

Re: About NTP!

Do as "printaporn" suggested, but you will also need to start the daemon.
Type
/sbin/init.d/xntpd start

To monitor the status of ntp use
ntpq -p

Within the /etc/ntp.conf file you can also specify additional servers or peers.

HTH

John

If you never make a mistake you'll never make anything.
xujun
Advisor

Re: About NTP!

Thanks for Printaporn and John Strang !

When I use command /sbin/init.d/xntpd start, one wrong message displays:
no server suitable for synchronization found.

your answer is same as what I have read on books, but it doesn't work correctly.

Wim Rombauts
Honored Contributor

Re: About NTP!

To have a NTP server that does not synchronize to an external time source, you need following line in /etc/ntp.conf

"server 127.127.1.1 prefer"

The "prefer" option is necessary for a valid internal synchronization !

If you have a large number of clients on one subnet, you can broadcast from the server :

broadcast version 3

and on your clients : "broadcastclient yes"

Or you can configure your clients to request time from the server on a regular base:

"server version 3"
xujun
Advisor

Re: About NTP!

It also doesn't work correctly after I enter the entry in /etc/ntp.conf .
server 127.127.1.1. prefer
Stefan Schulz
Honored Contributor

Re: About NTP!

HI,

this message is no hard error. Its more like a warning.

As you configured your NTP server to use its local clock as a source there is no external timesource to synchronize with.

And thats all this message says.

Hope this helps

Regards Stefan
No Mouse found. System halted. Press Mousebutton to continue.
Wim Rombauts
Honored Contributor

Re: About NTP!

The dot after the last "1" should not be there.

And what is the response from "ntpq -p" a few minutes after you have (stopped and) started the xntpd ?
Animesh Chakraborty
Honored Contributor
Solution

Re: About NTP!

NTP Time server
===========
# cd /etc/
# /sbin/init.d/xntp stop
# vi ntp.conf
((modify the parameter accordingly & save it; broadcast adddress can be
obtained by running the command" ifconfig lan0, get the last entry which
shows something like: 192.23.24.255)):

server 127.127.1.1 minpoll 3 maxpoll 4 prefer
fudge 127.127.1.1 stratum 10
broadcast

# /sbin/init.d/xntp start

NTP Client
======
# cd /etc/rc.config.d
# /sbin/init.d/xntp stop
# vi netdaemons
((modify accordingly)):
export NTPDATE_SERVER=ctxpss
export XNTPD=1

# ntpdate
# /sbin/init.d/xntp start

Wait for about 5-8 min, run the follwoing to check the status:
# ntpq -c rv
chk for output of "reftime" it shld not be zero if the servers are in sync.
Did you take a backup?
Animesh Chakraborty
Honored Contributor

Re: About NTP!

Hi,
You need to edit /etc/ntp.conf for ntp client also.

server (ntp server)
broadcastclient yes
Did you take a backup?
Bill Hassell
Honored Contributor

Re: About NTP!

Before you do anything about starting NTP, you must find a working NTP server. If you are behind a firewall, many network administrators will configure the firewall to provide NTP services, so ask your adminstrator. Similarly, the network administrator may need to open the NTP port on your firewall.

To see if a given server is running NTP, use the NTP query command:

# ntpq -p some-ntp-system.com

If it replies, the list will be the NTP source(s) used by the server. That is the server-name to put into the /etc/rc.config.d/netdaemons file. Until ntpq -p works, you won't be able to use NTP other than as a source to other systems (all machines sync to a local machine).


Bill Hassell, sysadmin
xujun
Advisor

Re: About NTP!

Thanks for all of you!
Every time after I use command /sbin/init.d/xntpd start on the server , the I immediately also run the same command on the client ,the I wait and wait, that's the reason.