1824976 Members
3887 Online
109678 Solutions
New Discussion юеВ

NTP Server

 
Sirius Black
Regular Advisor

NTP Server

Hi All,
I want to ask you if there is anyone who knows how we have to do to develop a NTP server on our HP - UX 11.i . We have not any idea on what we have to do !
So if someone has a procedure to do it I will thank him!
Thanks
Fabrizio
6 REPLIES 6
Todd McDaniel_1
Honored Contributor

Re: NTP Server

You need to have a source with a reliable time such as is the case with the Navy.

Here is the link you can use to select a host to add to your config for NTP to use as the master reference for time sync.

http://tycho.usno.navy.mil/ntp.html
Unix, the other white meat.
Jeff Schussele
Honored Contributor

Re: NTP Server

Hi Fabrizio,

To set up an NTP server you first have to select an external time source that it will draw it's time from. This can be a recognized time server out on the internet - preferrably somewhere near - or a radio device that receives broadcasts from a satellite.
Once that is selected & tested with the ntpq command you set the date off that device with the ntpdate command and set up the /etc/ntp.conf file. Then edit the /etc/rc.config.d.netdaemons, set NTPDATE_SERVER & XNTPD = 1 and run /sbin/init.d/xntpd start.
That's all there is to it.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Jeff Schussele
Honored Contributor

Re: NTP Server

I should point out that you set up the ntp.conf file to point to the selected external device.
And that netdaemons file location should be
/etc/rc.config.d/netdaemons - I typod it.

Rgds,
Jeff
PERSEVERANCE -- Remember, whatever does not kill you only makes you stronger!
Todd McDaniel_1
Honored Contributor

Re: NTP Server

Forgot you also need to turn on xntpd by makeing sure you have an exe file in /sbin/init.d linked to a Start script in /sbin/rc2.d and a kill script linked to /sbin/rc1.d...

Just create links in rc2.d for start and a link in rc1.d for kill... and make sure the /sbin/init.d is executable... that should be about it.

You also need a config file in /etc/ntp.conf... should be one there most likely with ips of servers as primary and secondary...Called Stratum...

Hope this helps somewhat...
Unix, the other white meat.
Stuart Abramson_2
Honored Contributor

Re: NTP Server

A. PHILOSOPHY
1. Here's the basic process:

Have two of your machines connect to two different offsite
"timeservers". Connect the rest of your machines to these
two.

2. There is a web page at:

http://tycho.usno.navy.mil/time.html
http://www.eecis.udel.edu/~ntp

that discusses the subject of setting time.

3. Stratum(s)

Stratum 1 Gets time from UTC time servers.
Stratum 2 Gets time from Stratum 1 servers..
Stratum 3 Gets time from Stratum 2 servers..

4. There are 5 files connected with ntp:

-r--r--r-- 1 bin bin 2471 Feb 10 14:17 /etc/rc.config.d/netdaemons
-rw-r--r-- 1 root sys 5078 Nov 13 21:42 /etc/ntp.conf
-rw-r--r-- 1 root sys 17179 Sep 12 19:05 /etc/ntp.conf.example
-rw-r--r-- 1 root root 8 Feb 19 14:23 /etc/ntp.drift
-r-------- 1 bin bin 1578 Jun 7 1996 /etc/ntp.keys


B. CONFIGURATION
1. First you must identify your plan:

a. Identify two offsite time servers.
b. Identify two local machines to be your local servers.
c. Set up all other local machines to be clients of the time servers.

2. In our case:

a. External time servers:

10.100.51.211 # antares
10.3.65.67 # horus

b. Local time servers:

gbo349-d
gbo345-d

3. Set local clients and servers to initiate ntp at boot time:

vi /etc/rc.config.d/netdaemons

export NTPDATE_SERVER=Time server name or IP address
(this parameter is optional...)
export XNTPD=1
export XNTPD_ARGS=

4. /etc/ntp.conf for a "client"

driftfile /etc/ntp.drift
restrict default notrust nomodify
restrict 151.208.28.49
restrict 151.208.28.45
server 151.208.28.49
server 151.208.28.45

5. /etc/ntp.conf for a "local timeserver", gbo349-d:

server 10.100.51.211 prefer # Antares
server 10.3.65.67 # horus
driftfile /etc/ntp.drift
restrict default notrust nomodify
restrict 10.100.51.211
restrict 10.3.65.67
peer 151.208.28.45
broadcast 151.208.28.255

6. /sbin/init.d/xntpd start


U. USEFUL COMMANDS

ntpq -p List peers
xntpdc -p List peers
xntpdc
sysinfo
peers
help
ntpdate # Set server time hard
Server must be set up as ntp server
xntpd must NOT be running on client

9. If you want to change xntpd setup on the fly:

/sbin/init.d/xntpd stop
cp /etc/ntp.conf /etc/ntp.conf.old
vi /etc/ntp.conf
/sbin/init.d/xntpd start

I think you can also:

kill
cp /etc/ntp.conf /etc/ntp.conf.old
vi /etc/ntp.conf
/usr/sbin/xntpd
Fabio Ettore
Honored Contributor

Re: NTP Server

Ciao Fabrizio,

if you want to configure your HP-UX 11.11 system as NTP server then see the following actions for a simple configuration:

Server side:
- end of /etc/ntp.conf file and add two lines:
# vi /etc/ntp.conf
server 127.127.1.1
peer version 3

Client side:
- end of /etc/ntp.conf file and add two lines:
# vi /etc/ntp.conf
server version 3
broadcastclient yes

I hope this helps you.

Best regards,
Ettore
WISH? IMPROVEMENT!