Search This Blog

Tuesday, July 31, 2012

Synchronize time of two or more PCs with NTP

1) At first check whether NTP is installed or not. Install if its not installed.

#apt-get install ntp

2) Start or restart ntp using

#/etc/init.d/ntp restart/start

3) On server machine do following things.
Open /etc/ntp.conf and add following things

server iburst
fudge stratum 10

restrict mask nomodify notrap

Here first two lines are external ntp servers which will be used to synchronize to time. 3rd and 4th line is used if machine has infrequent internet connection. Last line is used so that any machine from network can use this machine as a server to synchronize time. So result would be that you would see same time on all machines in that network and current machine(server).

Restart ntp using

#/etc/init.d/ntp restart

4) On client machine
Open /etc/ntp.conf and add ip address of the server machine. We assume that ip address of server machine was

so in ntp.conf enter

server iburst

Restart ntp
# /etc/init.d/ntp restart

Check using following command

#ntpq -c lpeer
And you should see ip address or hostname of server machine.

Thats it. Now onwards all the client machines in the network and server machine( will always show same time and will remain synchronized.

No comments: