LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-03-2012, 09:10 AM   #1
aalinare
LQ Newbie
 
Registered: Jul 2012
Posts: 14

Rep: Reputation: Disabled
Local NTP server configuration on RHEL 6 Virtual server assistance needed


Greetings all,

I am relatively new to Linux...just taking the RHCSA 124 class...and am trying to work on my first servers.

I have installed a host RHEL 6 OS with just Virtualization.
I created 2 RHEL6 VMs and have been trying to configure one as a NTP server. These are standalone with no internet access.

I have been unsucessfully been trying to configure one of the VMs as the NTP server...but every website solution that I have tried has failed. Every solution I have tried...I still get no suitable server for sync found.

Can anyone assist with the /etc/ntp.conf files...on what needs to be included?? I am using a host system with no ethernet configured..but the VM Manager environment is setup for a default network 192.168.1.0 /24 w/ DHCP disabled.
The VM server is setup with manual ip as 192.168.1.10, and the client is 192.168.1.11 . Both systems are able to ping each other. This is the first service I am trying to setup after doing the initial install...so there are no DHCP/DNS/etc services configured.

Any help will really be appreciated..thanks
 
Old 07-03-2012, 09:51 AM   #2
bino25
Member
 
Registered: Dec 2010
Posts: 50

Rep: Reputation: 11
Your ntp.conf file just needs to have your ntp server listed and a drift file defined. You should also set a "fake" ip for the server itself (this will help if the ntp server doesn't respond or you're having a network issue). So I would look for lines like this:

server 127.127.1.0 => these 2 lines are usually in there by default
fudge 127.127.1.0 stratum 10

server 192.168.1.10
driftfile /etc/ntp/drift

Once you get that working, you can start adding a "restrict" line to the ntp.conf file.

One thing to keep in mind, the sync between the server and client is not instantaneous so wait it out. Change the system clock by 30 minutes or so, then I would check back either at the end of the day or even the next day.
 
Old 07-03-2012, 10:01 AM   #3
aalinare
LQ Newbie
 
Registered: Jul 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Thanks,

Again...i am just a beginner...so another question is...do these entries have to be in any particular section of the ntp.conf file?? Should the client ntp.conf file be the same as the server?
Not sure about the restrict lines....there are already several restrict lines in the default ntp.conf files (server/client)
Can I wipe the whole file and just put in these couple of entries that you provided??

On my previous attempts at configuring NTP with other intruction...I have left them up for days...and have not seen any sync between the client and server.

Thanks for your help
 
Old 07-03-2012, 11:18 AM   #4
aalinare
LQ Newbie
 
Registered: Jul 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
Continuing on my NTP configuration problems...also tried the below documentation provided via other threads...and still am not getting any closer to setting up the NTP server....I edited both the server and client ntp.conf files, restarted the services...tried the updates, leaving the times slightly off to see if server/client would eventually sync...but so far still getting no suitable server to sync messages..... Can anyone provide assistance...thanks,

Example server “/etc/ntp.conf” file
restrict default nomodify notrap noquery
restrict 127.0.0.1

# -- CLIENT NETWORK -------
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap

# --- OUR TIMESERVERS -----
server 0.pool.ntp.org iburst
server 1.pool.ntp.org iburst
server 2.pool.ntp.org iburst
server 127.127.1.0

# --- NTP MULTICASTCLIENT ---

# --- GENERAL CONFIGURATION ---

# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 9

# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008

# Keys file.
keys /etc/ntp/keys
By default, anything can query the server for what the time is, but no more.

The localhost (127.0.0.1) has almost no restrictions.

At least three remote servers are used for the best possibility of getting real time. Using less than three means you might have to decide between two servers that don't agree with each other, and how would you tell which was right? Hopefully, using three avoids a stalemate. Using more than three will slow things down (a bit) as they're all compared, and there isn't (at this time) a 4.pool.ntp.org set of DNS records for servers. To use more than three, you'll need to find some servers that you're allowed to use (try your own ISP).

A local server is fudged with a medium stratum value (9).

The drift file is used by the server to compensate for errors.

I suspect the system maintains the delay value itself, though all of my servers are showing the same “0.008” value.

The “keys” file is ignored on my systems, as they're not set up to use authentication. It's just there as a default setting, in case they're reconfigured to use authentication.

Example client “/etc/ntp.conf” file
restrict default nomodify notrap noquery
restrict 127.0.0.1

# -- CLIENT NETWORK -------

# --- OUR TIMESERVERS -----
# 192.168.1.2 is the address for my timeserver,
# use the address of your own, instead:
server 192.168.1.2 iburst
server 127.127.1.0

# --- NTP MULTICASTCLIENT ---

# --- GENERAL CONFIGURATION ---

# Undisciplined Local Clock.
fudge 127.127.1.0 stratum 12

# Drift file.
driftfile /var/lib/ntp/drift
broadcastdelay 0.008

# Keys file.
keys /etc/ntp/keys
This configuration uses the local time server as the only remote server, it also uses itself as a lesser quality server (stratum 12) if it can't reach the main server (so it'll keep on running, rather than abort).
 
Old 07-03-2012, 01:33 PM   #5
bino25
Member
 
Registered: Dec 2010
Posts: 50

Rep: Reputation: 11
Try this and post the output

# service ntpd stop
# ntpdate -u 192.168.1.10
# ntpdate -u 192.168.1.10
# ntpdate -u 192.168.1.10 => yes run this command 3x. It must be run with the ntpd service stopped
# service ntpd start
 
Old 07-05-2012, 07:58 AM   #6
aalinare
LQ Newbie
 
Registered: Jul 2012
Posts: 14

Original Poster
Rep: Reputation: Disabled
I left the server ntp.conf file the way it was...and deleted everything out of the client ntp.conf file except for the ip address of the ntp server...and it seems to be working now
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP Server configure in local mode pankajguptaspn Linux - General 7 02-06-2012 03:20 AM
[SOLVED] Assistance needed to set up RHEL 64-bit as a YUM Proxy server for 32-bit also. xenner Linux - Newbie 7 10-19-2009 08:50 PM
Can you host a local ntp server in linux? homer_3 Linux - General 7 09-28-2009 10:27 AM
NTP Local Server Configuration saqis Red Hat 1 10-16-2006 04:45 AM
LOcal NTP server sawan Linux - Software 3 07-24-2005 11:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration