Page 1 of 1
what is NTP
Posted: Thu Aug 27, 2015 2:46 pm
by evanisaac982
Hello Everyone,
Any one know about NTP what is it and how to install it.
Thanks.
Re: what is NTP
Posted: Wed Sep 02, 2015 5:36 pm
by kevinchristian381
NTP stands for Network Time Protocol and is a service that runs on the Linux operating system that synchronizes the system time with with a centralized NTP server.
Configure NTP server
1. Install NTP Server
First, install NTP package on server using the appropriate package tool that is available on Linux.
For example, on RedHat or CentOS, use yum to install ntp as shown below:
yum install ntp
2. Restrict values in ntp.conf
Modify the /etc/ntp.conf file to make sure it has the following two restrict lines.
# Permit time synchronization with our time source, but do not
# Permit the source to query or modify the service on this system.
restrict default kod nomodify notrap nopeer noquery
restrict -6 default kod nomodify notrap nopeer noquery
The first restrict line allows other clients to query your time server.
This restrict line has the following parameters
noquery -prevents dumping status data from ntpd.
notrap -prevents control message trap service.
nomodify -prevents all ntpq queries that attempts to modify the server.
nopeer -prevents all packets that attempts to establish a peer association.
Kod – Kiss-o-death packet is to be sent to reduce unwanted queries
The value -6 in the second line allows forces the DNS resolution to the IPV6 address resolution.
3. Allow Only Specific Clients
Add the following restrict line to your /etc/ntp.conf file:
Restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
If the localhost needs to have the full access to query or modify, add the following line to /etc/ntp.conf
Restrict 127.0.0.1
4. Add Local Clock as Backup
Add the local clock to the ntp.conf file so that if the NTP server is disconnected from the internet, NTP server provides time from its local system clock.
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10
Stratum is used to synchronize the time with the server based on distance.
A stratum-1 time server acts as a primary network time standard.
A stratum-2 server is connected to the stratum-1 server over the network.
5. Setup NTP Log Parameters
Identify the drift file and the log file location in your ntp.conf file
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log
6. Start the NTP Serrver
After setting up proper values in the ntp.conf file, start the ntp service:
service ntpd start
II. Configure NTP Client to Synchronize with NTP Server
7. Modify ntp.conf on NTP Client
This setup should be done on NTP Client (Not on NTP-server)
To synchronize the time of local Linux client machine with NTP server,
edit the /etc/ntp.conf file on the client side.
server 0.rhel.pool.ntp.org iburst
server 1.rhel.pool.ntp.org iburst
iburst: After every poll, a burst of eight packets is sent instead of one. When the server is not responding, packets are sent 16s interval. When the server responds, packets are sent every 2s.
Edit your NTP.conf to reflect appropriate entries for NTP server.
server 19.168.1.1 prefer
prefer: If this option is specified that server is preferred over other servers.
8. Start the NTP Daemon
start the ntp daemon.
/etc/init.d/ntp start
9. Check the NTP Status
Check the status of NTP using the ntpq command.
10. Set Local Date and Time
The ntpdate command can be used to set the local date and time by polling the NTP server.
Re: what is NTP
Posted: Wed Sep 30, 2015 8:38 pm
by bakerashley127
NTP (Network Time Protocol) an Internet protocol that used to assures correct synchronization to the millisecond of computer clock times in a network of computers
NTP uses UTC as reference time.
NTP is a fault-tolerant protocol that will automatically select the best of several available time sources to synchronize to. Multiple candidates can be combined to minimize the accumulated error. Temporarily or permanently insane time sources will be detected and avoided.
Even when a network connection is temporarily unavailable, NTP can use measurements from the past to estimate current time and error.
For formal reasons NTP will also maintain estimates for the accuracy of the local time