The /etc/inet/ntp.server file is a template for configuring an NTP server. Copy this file to /etc/inet/ntp.conf, and edit it to meet your network’s requirements. When viewing the ntp.server file contents, remember that an NTP server is also an NTP client.
On Solaris 9 the /etc/rc2.d/S74xntpd script is executed at system boot time and starts the xntpd process if the /etc/inet/ntp.conf file exists. The xntpd process starts in either the client or the server mode, depending on the contents of the ntp.conf file. The following steps describe the xntpd process.
On Solaris 10 this service is controlled by svcadm.
#svcs -a | grep ntp
online 13:09:43 svc:/network/ntp:default
For example to restart it you need to use (note, not ntpd, but ntp):
#svcadm restart ntp
The NTP servers advertise every 64 seconds, by means of a multicast address (224.0.1.1), that they are NTP servers. Any NTP client that is not configured with the unicast address of an NTP server multicasts when the xntpd process starts. View the line that causes the system to act as an NTP server by typing the following:
myhost# grep broadcast /etc/inet/ntp.server
broadcast 224.0.1.1 ttl 4
Local NTP servers answer the multicast advertisements. The NTP client sends request packets to all the NTP servers that it knows. Included in the request packet is the client’s local time. The NTP server replies by inserting UTC time into the packet and then returns the packet to the client. The client compares its original request time with its own time when it receives the response from the server. This allows the client to determine how long the packet was in transit on the network.
The client uses the UTC time value from the NTP server after it receives several responses from the NTP server. It can take up to five minutes for an NTP client to synchronize with an NTP server.
Using an Undisciplined Local Clock
NTP servers can, but should not, use their own undisciplined local clock as an official, reliable time source.
To use an undisciplined local clock, complete the following steps:
1. Copy the /etc/inet/ntp.server file to the /etc/inet/ntp.conf file.
myhost# cp /etc/inet/ntp.server /etc/inet/ntp.conf
2. Open the /etc/inet/ntp.conf file for editing, and change the server IP address to 127.127.1.0, where the number 1represents the undisciplined local clock. Comment out the fudge keyword because special configuration is not needed for the local reference clock.
myhost# vi /etc/inet/ntp.conf
Change:
server 127.127.XType.0 prefer
fudge 127.127.XType.0 stratum 0
to:
server 127.127.1.0 prefer
# fudge 127.127.XType.0 stratum 0
Note – Choices for XType are listed in the comments of the
/etc/inet/ntp.server file.
3. Create a drift file as specified by the drift file /var/ntp/ntp.drift entry in the /etc/inet/ntp.conf file:
touch /var/ntp/ntp.drift
4. Verify that the file exists and then start the NTP daemon by using the xntpdscript in the /etc/init.d
directory.
myhost# /etc/init.d/xntpd start
myhost#
6. Verify that the NTP daemon is running using pgrep -lf ntp. Then use the snoop utility to view NTP server multicast advertisements.
myhost# /usr/sbin/snoop | grep -i ntp
Configure the Stratum of the Server
You can manually configure the stratum of an NTP server by editing the fudge entry in the ntp.conf file. This is useful when you do not have access to an external NTP server and you have to manually synchronize with another system. Systems that use their internal clock advertise themselves as stratum-4 servers.
When a local clock is configured to act as an accurate source of time, NTP will detect this. Systems that use their own clock as a time source will advertise themselves as a stratum-4 server by default. However, the fudge keyword could be used to alter this behavior. The fudge configuration entry can use the stratum option to override the stratum level sent out with the NTP server’s time advertisements.
Using External NTP Reference Servers
Determine which NTP servers are reachable by your NTP server. Refer to
for a list of stratum-2 servers. You must notify the NTP server’s administrators of your intention to use their NTP server as a reference server so the administrator can properly size NTP servers for the additional NTP load.
To use external NTP reference servers, complete the following steps:
1. Copy the /etc/inet/ntp.server file to the /etc/inet/ntp.conf file.
# cp /etc/inet/ntp.server /etc/inet/ntp.conf
2. Open the /etc/inet/ntp.conf file for editing, and change the server entry. Comment out the fudge keyword because special configuration is not needed for an external reference clock.
# vi /etc/inet/ntp.conf
Change:
server 127.127.XType.0 prefer
fudge 127.127.XType.0 stratum 0
to:
server external-time-server-a
server external-time-server-b
server external-time-server-c
# fudge 127.127.XType.0 stratum 0
3. Create a drift file as specified by the drift file /var/ntp/ntp.drift entry in the /etc/inet/ntp.conf file.
# touch /var/ntp/ntp.drifts
4. Verify that the file exists.
# ls -al /var/ntp/ntp.drift
-rw-r--r--1 root other 0 Dec 27 01:41 /var/ntp/ntp.drift
5. Start the NTP daemon by using the /etc/init.d/xntpd script.
# /etc/init.d/xntpd start
6. Check to see if the NTP daemon is running.
# pgrep -lf ntp
1595 /usr/lib/inet/xntpd
Managing Daemons
By default, all NTP messages are sent to the syslog utility.
To view the logged information in pseudo real-time, use the tail utility with the follow (-f) option. For example:
myhost# tail -f /var/adm/messages
Dec 27 01:25:37 myhost xntpd[1614]: [ID 450285 daemon.error] 0 makes a poor control keyid
You can query or configure a running xntpdprocess by using the xntpdc utility, which was introduced in the Solaris 8 OE. The xntpdc utility provides an extensive xntpdstate. You can use statistic information in the interactive or the command-line mode.
The NTP service is automatically started at boot time if the /etc/inet/ntp.conf file exists. You can manually stop the service by using the /etc/init.d/xntpd run script with stop as an argument.
To stop the daemon, perform the command:
# /etc/init.d/xntpd stop
To start the daemon, perform the command:
# /etc/init.d/xntpd start
Configuring an NTP Client
Configuration of an NTP client also requires the /etc/inet/ntp.conf file to be established, as it does with NTP servers.
To initialize the file configuration, complete the following steps:
1. Copy the /etc/inet/ntp.client file to the /etc/inet/ntp.conf file.
# cp /etc/inet/ntp.client /etc/inet/ntp.conf
The /etc/inet/ntp.conf file contains only one entry, by default, that configures the client to use the default multicast address to solicit for servers.
# tail -1 /etc/inet/ntp.client
multicastclient 224.0.1.1
2. Check if the NTP daemon is running. # pgrep -lf ntp
3. Start the NTP daemon by using the xntpd script in the /etc/init.d directory.
# /etc/init.d/xntpd start
The xntpd startup script initially uses the ntpdate utility to synchronize the client’s clock to UTC time. After the ntpdate utility has accomplished this, the xntpd process is started by the xntpd script to maintain synchronization.
# pgrep -lf ntp
1679 /sbin/sh /etc/init.d/xntpd start
1680 /usr/sbin/ntpdate -s -w -m 224.0.1.1
Note – The xntpd script remains in a wait state until the ntpdate utility completes. The ntpdate utility automatically runs to gather NTP inputs and sets the initial time on this system. The ntpdate utility might perform this initial setting by means of a step or a slew. Refer to the ntpdate man page for further details.
Managing NTP Client Daemons
The NTP client’s daemons are managed in a similar way to the way in which the NTP server’s daemons are managed.
To manage NTP client daemons, complete the following steps:
1. Check if the NTP daemon is running.
# pgrep -lf ntp
2. Start the NTP daemon by using the xntpdscript in the /etc/init.d directory.
# /etc/init.d/xntpd start
The xntpd startup script initially uses the ntpdate utility to synchronize the client’s clock to UTC time. After the ntpdate utility
has accomplished this, the xntpd process is started by the xntpd script to maintain synchronization.
# pgrep -lf ntp
1679 /sbin/sh /etc/init.d/xntpd start
1680 /usr/sbin/ntpdate -s -w -m 224.0.1.1
From:http://www.softpanorama.org/Net/Application_layer/NTP/configuring_a_solaris_ntp_server.shtml