Softpanorama

May the source be with you, but remember the KISS principle ;-)
Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
(slightly skeptical) Educational society promoting "Back to basics" movement against IT overcomplexity and  bastardization of classic Unix

Configuring a Solaris NTP Server

News Recommended Links Tutorials FAQs Tips
Configuration of Solaris NTP server Troubleshooting ntpdate ntpq ntptrace
Quiz Appliances History Etc

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

 http://www.eecis.udel.edu/~mills/ntp/clock2.htm

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 xntpd state. 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 


Etc

Society

Groupthink : Two Party System as Polyarchy : Corruption of Regulators : Bureaucracies : Understanding Micromanagers and Control Freaks : Toxic Managers :   Harvard Mafia : Diplomatic Communication : Surviving a Bad Performance Review : Insufficient Retirement Funds as Immanent Problem of Neoliberal Regime : PseudoScience : Who Rules America : Neoliberalism  : The Iron Law of Oligarchy : Libertarian Philosophy

Quotes

War and Peace : Skeptical Finance : John Kenneth Galbraith :Talleyrand : Oscar Wilde : Otto Von Bismarck : Keynes : George Carlin : Skeptics : Propaganda  : SE quotes : Language Design and Programming Quotes : Random IT-related quotesSomerset Maugham : Marcus Aurelius : Kurt Vonnegut : Eric Hoffer : Winston Churchill : Napoleon Bonaparte : Ambrose BierceBernard Shaw : Mark Twain Quotes

Bulletin:

Vol 25, No.12 (December, 2013) Rational Fools vs. Efficient Crooks The efficient markets hypothesis : Political Skeptic Bulletin, 2013 : Unemployment Bulletin, 2010 :  Vol 23, No.10 (October, 2011) An observation about corporate security departments : Slightly Skeptical Euromaydan Chronicles, June 2014 : Greenspan legacy bulletin, 2008 : Vol 25, No.10 (October, 2013) Cryptolocker Trojan (Win32/Crilock.A) : Vol 25, No.08 (August, 2013) Cloud providers as intelligence collection hubs : Financial Humor Bulletin, 2010 : Inequality Bulletin, 2009 : Financial Humor Bulletin, 2008 : Copyleft Problems Bulletin, 2004 : Financial Humor Bulletin, 2011 : Energy Bulletin, 2010 : Malware Protection Bulletin, 2010 : Vol 26, No.1 (January, 2013) Object-Oriented Cult : Political Skeptic Bulletin, 2011 : Vol 23, No.11 (November, 2011) Softpanorama classification of sysadmin horror stories : Vol 25, No.05 (May, 2013) Corporate bullshit as a communication method  : Vol 25, No.06 (June, 2013) A Note on the Relationship of Brooks Law and Conway Law

History:

Fifty glorious years (1950-2000): the triumph of the US computer engineering : Donald Knuth : TAoCP and its Influence of Computer Science : Richard Stallman : Linus Torvalds  : Larry Wall  : John K. Ousterhout : CTSS : Multix OS Unix History : Unix shell history : VI editor : History of pipes concept : Solaris : MS DOSProgramming Languages History : PL/1 : Simula 67 : C : History of GCC developmentScripting Languages : Perl history   : OS History : Mail : DNS : SSH : CPU Instruction Sets : SPARC systems 1987-2006 : Norton Commander : Norton Utilities : Norton Ghost : Frontpage history : Malware Defense History : GNU Screen : OSS early history

Classic books:

The Peter Principle : Parkinson Law : 1984 : The Mythical Man-MonthHow to Solve It by George Polya : The Art of Computer Programming : The Elements of Programming Style : The Unix Hater’s Handbook : The Jargon file : The True Believer : Programming Pearls : The Good Soldier Svejk : The Power Elite

Most popular humor pages:

Manifest of the Softpanorama IT Slacker Society : Ten Commandments of the IT Slackers Society : Computer Humor Collection : BSD Logo Story : The Cuckoo's Egg : IT Slang : C++ Humor : ARE YOU A BBS ADDICT? : The Perl Purity Test : Object oriented programmers of all nations : Financial Humor : Financial Humor Bulletin, 2008 : Financial Humor Bulletin, 2010 : The Most Comprehensive Collection of Editor-related Humor : Programming Language Humor : Goldman Sachs related humor : Greenspan humor : C Humor : Scripting Humor : Real Programmers Humor : Web Humor : GPL-related Humor : OFM Humor : Politically Incorrect Humor : IDS Humor : "Linux Sucks" Humor : Russian Musical Humor : Best Russian Programmer Humor : Microsoft plans to buy Catholic Church : Richard Stallman Related Humor : Admin Humor : Perl-related Humor : Linus Torvalds Related humor : PseudoScience Related Humor : Networking Humor : Shell Humor : Financial Humor Bulletin, 2011 : Financial Humor Bulletin, 2012 : Financial Humor Bulletin, 2013 : Java Humor : Software Engineering Humor : Sun Solaris Related Humor : Education Humor : IBM Humor : Assembler-related Humor : VIM Humor : Computer Viruses Humor : Bright tomorrow is rescheduled to a day after tomorrow : Classic Computer Humor

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2021 by Softpanorama Society. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to to buy a cup of coffee for authors of this site

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the Softpanorama society. We do not warrant the correctness of the information provided or its fitness for any purpose. The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: July 28, 2019