[ASK] Redhat NTP Set up

 
Thread Tools Search this Thread
Homework and Emergencies Emergency UNIX and Linux Support [ASK] Redhat NTP Set up
# 1  
Old 01-25-2010
[ASK] Redhat NTP Set up

Hi,

I would like to set up NTP locally in my servers and client locally. I have no internet connection, what I want to do is all my servers synchronized to one server. lets say I have 5 servers, so 1 of this will be act as a master while the rest is client. I only want those clients to get the time from the server itself.

I tried to configure in /etc/ntp.conf but somehow my configuration wont works. Is there anyone of you have the working configuration that I can use?

lets say
my server IP is 192.168.10.20 (master/server)
my 1st client IP is 192.168.10.30 (client-I want this to sync with the master)
my 2nd client IP is 192.168.10.40 (client-I want this to sync with the master)
and so on...

Please help me on this, I've been trying to configure but somehow it just refuses to.
# 2  
Old 01-26-2010
Can you show us a copy of your server /etc/ntp.conf and a client's /etc/ntp.conf. Your server should map to 127.0.0.1 and your clients to 192.168.10.20

Have you opened your firewall to allow UDP packets on port 123?
# 3  
Old 01-26-2010
master/server ntp.conf
Code:
# A very simple client-only ntp configuration.
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 
driftfile /etc/ntp/drift
restrict default ignore
restrict 192.168.10.20 netmask 255.255.255.0 nomodify notrap
authenticate no

client ntp.conf
Code:
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 
driftfile /etc/ntp/drift
restrict default ignore
authenticate no
server 192.168.10.20

Don't forget to configure the /etc/ntp/step-tickers

HTH,
Loïc
# 4  
Old 01-26-2010
Quote:
Originally Posted by Loic Domaigne
master/server ntp.conf
Code:
# A very simple client-only ntp configuration.
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 
driftfile /etc/ntp/drift
restrict default ignore
restrict 192.168.10.20 netmask 255.255.255.0 nomodify notrap
authenticate no

client ntp.conf
Code:
server 127.127.1.0 # local clock
fudge 127.127.1.0 stratum 10 
driftfile /etc/ntp/drift
restrict default ignore
authenticate no
server 192.168.10.20

Don't forget to configure the /etc/ntp/step-tickers

HTH,
Loïc
Hi, thanks, I will try and get back to you, but what is step-tickers? what do I need to configure there? same configuration? Smilie

btw my drift file is located in /var/lib/ntp/drift I guess its redhat default, I check but there is no drift in directory /etc/ntp/

---------- Post updated at 12:53 PM ---------- Previous update was at 12:35 PM ----------

Hi,
I tried again but still unsuccessful, below is the configuration /etc/ntp.conf file from server and client.

This is SERVER
Code:
[root@server ntp]# more /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
restrict default ignore

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
#restrict 127.0.0.1

# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service.  Do not permit those systems to modify the
# configuration of this service.  Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
restrict 192.168.10.20 netmask 255.255.255.0 nomodify notrap
authenticate no
client ntp.conf

# --- OUR TIMESERVERS -----


# --- NTP MULTICASTCLIENT ---
#multicastclient                        # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

#
# 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 /var/lib/ntp/drift
broadcastdelay  0.008

#
# Keys file.  If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
keys            /etc/ntp/keys

THIS IS CLIENT
Code:
[root@client]# more /etc/ntp.conf
# Permit time synchronization with our time source, but do not
# permit the source to query or modify the service on this system.
#restrict default nomodify notrap noquery
restrict default ignore
authenticate no

# Permit all access over the loopback interface.  This could
# be tightened as well, but to do so would effect some of
# the administrative functions.
#restrict 127.0.0.1

# -- CLIENT NETWORK -------
# Permit systems on this network to synchronize with this
# time service.  Do not permit those systems to modify the
# configuration of this service.  Also, do not use those
# systems as peers for synchronization.
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# --- OUR TIMESERVERS -----
server 192.168.10.20

# --- NTP MULTICASTCLIENT ---
#multicastclient                        # listen on default 224.0.1.1
# restrict 224.0.1.1 mask 255.255.255.255 nomodify notrap
# restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap


# --- GENERAL CONFIGURATION ---
#
# Undisciplined Local Clock. This is a fake driver intended for backup
# and when no outside source of synchronized time is available. The
# default stratum is usually 3, but in this case we elect to use stratum
# 0. Since the server line does not have the prefer keyword, this driver
# is never used for synchronization, unless no other other
# synchronization source is available. In case the local host is
# controlled by some external source, such as an external oscillator or
# another protocol, the prefer keyword would cause the local host to
# disregard all other synchronization sources, unless the kernel
# modifications are in use and declare an unsynchronized condition.
#
server  127.127.1.0     # local clock
fudge   127.127.1.0 stratum 10

#
# 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 /var/lib/ntp/drift
broadcastdelay  0.008

#
# Keys file.  If you want to diddle your server at run time, make a
# keys file (mode 600 for sure) and define the key number to be
# used for making requests.
#
# PLEASE DO NOT USE THE DEFAULT VALUES HERE. Pick your own, or remote
# systems might be able to reset your clock at will. Note also that
# ntpd is started with a -A flag, disabling authentication, that
# will have to be removed as well.
#
#keys           /etc/ntp/keys

Both of them throwing this output

Code:
[root@server]# more step-tickers
192.168.10.20

[root@client]# more step-tickers
192.168.10.20

[root@server/client ntp]# /etc/init.d/ntpd restart
Shutting down ntpd:                                        [  OK  ]
ntpd: Synchronizing with time server:                      [FAILED]
Starting ntpd:                                             [  OK  ]

[root@server/client]# ntpdate -b 192.168.10.20
26 Jan 12:32:58 ntpdate[30963]: the NTP socket is in use, exiting


Last edited by pludi; 01-26-2010 at 03:21 AM.. Reason: code tags, please...
# 5  
Old 01-26-2010
Could you check on the client the syslog entries for ntp (likely in /var/log/messages)? Could you try out the following and paste to us the output:
Code:
/etc/init.d/ntpd stop # stop NTP daemon
ntpdate -d 192.168.10.20

Thanks,
Loïc
# 6  
Old 01-27-2010
Hi, thanks for your reply.
Just to let you know that even the server itself unable to synchronized to itself, so afterall the server output is exactly the same as the client output below.
and all of our servers configuration is exactly the same, we can ping each other, can ssh, can sftp or whatsoever.

Here's the output /var/log/message
Code:
Jan 27 10:47:21 client ntpd[22155]: Listening on interface wildcard, 0.0.0.0#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface wildcard, ::#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface lo, 127.0.0.1#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface bond0, 192.168.10.40#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface bond0:0, 192.168.10.49#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface bond1, 10.88.88.10#123
Jan 27 10:47:21 client ntpd[22155]: Listening on interface eth3, 192.168.101.41#123
Jan 27 10:47:21 client ntpd[22155]: kernel time sync status 0040
Jan 27 10:47:21 client ntpd[22155]: frequency initialized 0.000 PPM from /var/lib/ntp/drift
Jan 27 10:47:21 client ntpd: ntpd startup succeeded

Code:
[root@client ~]# /etc/init.d/ntpd stop
Shutting down ntpd:                                        [  OK  ]
[root@client ~]# ntpdate -d 192.168.10.20
27 Jan 10:44:37 ntpdate[20188]: ntpdate 4.2.0a@1.1190-r Thu Oct  5 04:11:32 EDT 2006 (1)
Looking for host 192.168.10.20 and service ntp
host found : 192.168.10.20
transmit(192.168.10.20)
transmit(192.168.10.20)
transmit(192.168.10.20)
transmit(192.168.10.20)
transmit(192.168.10.20)
192.168.10.20: Server dropped: no data
server 192.168.10.20, port 123
stratum 0, precision 0, leap 00, trust 000
refid [192.168.10.20], delay 0.00000, dispersion 64.00000
transmitted 4, in filter 4
reference time:    00000000.00000000  Thu, Feb  7 2036 14:28:16.000
originate timestamp: 00000000.00000000  Thu, Feb  7 2036 14:28:16.000
transmit timestamp:  cf0a2722.a398b71b  Wed, Jan 27 2010 10:44:50.639
filter delay:  0.00000  0.00000  0.00000  0.00000
         0.00000  0.00000  0.00000  0.00000
filter offset: 0.000000 0.000000 0.000000 0.000000
         0.000000 0.000000 0.000000 0.000000
delay 0.00000, dispersion 64.00000
offset 0.000000

27 Jan 10:44:51 ntpdate[20188]: no server suitable for synchronization found

# 7  
Old 01-27-2010
Hello,

accordingly to your output, the NTP packets are sent to your NTP server 192.168.10.20, but the server didn't replied.

1) Make sure that NTP daemon runs on your server when you execute the ntpdate command on your client.

2) Verify that the NTP packets arrive at the interface of your server, resp. are sent out. If this test is negative, check possible firewall configuration between your clients and your server.

HTH,
Loïc.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Ntp issue redhat 5.11

HI Admin, We are facing a weird issue with NTP. A physical server RHEL 5.11 is migrated as P2V. NTP was running & clocks are in sync on source server before migration. After the SVMotion, On the target Linux guest, the ntpd is not able to sync with any of the clocks except local. Forcefully... (1 Reply)
Discussion started by: snchaudhari2
1 Replies

2. Red Hat

Ntp client sync with local over ntp server

Hi, I have two ntp servers in my cluster and I want all the nodes in my cluster to sync with either of the ntp servers or just one. Unfortunately it keep rotating the sync, between my ntp server 1, ntp server 2 and local. Is there anyway I can change the sync to avoid local? # ntpq -p ... (3 Replies)
Discussion started by: pjeedu2247
3 Replies

3. Red Hat

How to set password for file using vim in Linux/redhat?

Hello All, I have one query is "How to set the password for file using vi utility in linux. Please reply to my queries. I am waiting for reply. Thanks in advance. Thanks. Kuddus Shaikh (4 Replies)
Discussion started by: kuddusrhce
4 Replies

4. HP-UX

Setting up NTP HP-UX clients from solaris NTP server

Hi I wonder if its possible to setup NTP clients running HP-UX o.s. from a solaris 10 NTP server? FR (3 Replies)
Discussion started by: fretagi
3 Replies

5. Red Hat

Cache line size set incorrectly - Installing Redhat 9.0

Hi everyone, my name is chinx. I am new to Linux and new to this forum. I am trying to install Red Hat 9.0 on my MSi Laptop. But when I try to boot the CD, after selecting either GUI or CLI type of installation, I get this: PCI: 00.03.3 PCI cache line size set incorrectly (32 bytes) ... ... (1 Reply)
Discussion started by: LinuxNewbs
1 Replies

6. Red Hat

[ASK] NTP Set up

Hi, I would like to set up NTP locally in my servers and client locally. I have no internet connection, what I want to do is all my servers synchronized to one server. lets say I have 5 servers, so 1 of this will be act as a master while the rest is client. I only want those clients to get the... (1 Reply)
Discussion started by: flekzout
1 Replies

7. UNIX for Advanced & Expert Users

Where to set the right "Apache" to run after reboot on a RedHat 5 machine ?!

Hi, I'am working on a RedHat server (V5) and having on it 2 Apache instances, but after each reboot i have the wrong one starting so that i have to stop it doing "httpd -k stop" and than launch the right one doing "/etc/init.d/httpd -k start". For more Details, you may see the link i inserted... (4 Replies)
Discussion started by: mehdi1973
4 Replies

8. UNIX for Advanced & Expert Users

How to set NTP server to +1 hour time?

Hello, colleges! I need to synchronize time on several thousands device (UTM-1 Edge Appliances - All inclusive, all secure, all branch offices.) which don`t understand summer time at all. But in my country summer time are used. I plan to sync it with NTP server with modificated time: plus one... (2 Replies)
Discussion started by: chmelvv
2 Replies

9. UNIX for Advanced & Expert Users

set up NTP

I am going to set NTP on sun solaris 8 and 9 servers. There Oracle Databases on hose server. Any Impact to Oracle DBs with NTP. Thanks. (2 Replies)
Discussion started by: sriny
2 Replies

10. Solaris

ntp server and ntp client

All, How do you set a Solaris 9 server which received ntp updates from a ntp server to broadcast them on a local subnet. I have created a /etc/inet/ntp.conf file to receive the updates from a server on network and need to make this server become like a ntp relay from the main server. Any... (1 Reply)
Discussion started by: bubba112557
1 Replies
Login or Register to Ask a Question