Installing and configuring a Linux NTP server

Blog entry under construction

Configure your own internal dedicated NTP server

This article can be standalone (Part 1) or as a precursor to my other Active directory time sync article (Part 2):

https://sysadminemporium.wordpress.com/2012/12/03/time-synchronization-in-active-directory-pdc-configuration/

For our purposes we’ll be using Ubuntu server.  I’ll be using 12.04  (LTS)  http://www.ubuntu.com/download/server

The tutorial should apply to most Debian based distributions. Other Linux distros should have very similar configuration setting might use a different package management than apt-get and not have sudo configured.

—————————-

Part  1. Install and configure the NTP server:

First we remove the ntpdate

sudo apt-get remove ntpdate

Then we install the NTP server

sudo apt-get install ntp

Next we need to very that it works:

ntpq -p

ntpq-p

and verify that the date and time are correct:

date

date

And this is it. 🙂

If you would like to play with more settings, here are some things you could change:

Remember to restart the server after any configuration changes so they can take effect:

sudo /etc/init.d/ntp restart

ntp_restart

Changing the upstream NTP servers to get updates from:

sudo nano /etc/ntp.conf

We can leave the default server list or we can comment/remove them and replace with whatever servers we prefer. For this example I choose two at random from this list: http://tf.nist.gov/tf-cgi/servers.cgi. (I found the default canonical provided server pools to be quite reliable so you can leave this setting alone)

ntp_server_config

Note. For lower latency google some local NTP server pools 🙂

Note 2. Adding iBurst to a server or more should speed up the initial synchronization with it.

NTP access

sudo nano /etc/ntp.conf

You can let the defaults stand:

ntp_time_share

If you would like a comprehensive guide to restrictions use this guide:

http://support.ntp.org/bin/view/Support/AccessRestrictions

—————————

Part 2.  Preparing system to act as NTP server for Active Directory

For the lab purposes let’s give it two NICs: one facing internet using DHCP eth0 and one facing the internal network with a static configuration eth1 (adapt the settings according to your topology and security)

Edit the network configuration:

sudo nano /etc/network/interfaces

to look like this (223.50.11.0 is the internal subnet used by the PDC):

nano_interfaces

restart:

sudo /etc/init.d/networking restart

Final result:

ifconfig_final

As we can see we gave the NTP server the 223.50.11.1 IP to use in the internal network (same one used by the forest root PDC).

Let’s make a DNS entry for it then:

dns_ntp

You can follow the rest:

https://sysadminemporium.wordpress.com/2012/12/03/time-synchronization-in-active-directory-pdc-configuration/

Advertisements

One thought on “Installing and configuring a Linux NTP server

  1. Pingback: Time synchronization in Active Directory – PDC configuration | Sys Admin

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s