Jump to content
Sign in to follow this  
ianw1974

Creating your own ntp server

Recommended Posts

I managed to figure this out the other week, so decided to share it with you. In my example, I have my NTP server using the ip address of 172.20.12.230.

 

NTP Server config (machine using 172.20.12.230):

 

server  127.127.1.0	 # local clock
fudge   127.127.1.0 stratum 10

server pool.ntp.org

#the next entry sets this as the server and doesn't allow any modifications
restrict 172.20.12.230 mask 255.255.0.0 nomodify nopeer notrap

#the next line is required to ensure correct functionality
restrict 127.0.0.1 nomodify

# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /etc/ntp/drift
multicastclient				 # listen on default 224.0.1.1
broadcastdelay  0.008

 

Desktop/Server config for machines to sync with your newly created ntp server:

 

server  127.127.1.0	 # local clock
fudge   127.127.1.0 stratum 10

#this is the server you want to synchronise with.  i'm using the hostname
#instead of the ip address of my machine - ensure /etc/hosts resolves it!
server elan

# Drift file.  Put this in a directory which the daemon can write to.
# No symbolic links allowed, either, since the daemon updates the file
# by creating a temporary in the same directory and then rename()'ing
# it to the file.
driftfile /etc/ntp/drift
multicastclient				 # listen on default 224.0.1.1
broadcastdelay  0.008

 

the above config shows the hostname of my machine, called "elan". So, make sure your machine can ping the hostname, otherwise if not, use the ip address, or edit the /etc/hosts file so that it can ping the hostname.

 

And now you should have a fully functional ntp server on your network, and all your clients can sync with it. However, please note that it might take a few hours before the clients/servers that you have will start to synchronise. This is normal, because the stratum level is too high and will take a bit before it becomes usable as a ntp server.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

×
×
  • Create New...