LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-11-2006, 03:08 PM   #1
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Rep: Reputation: 73
NTP Sync?


Ok - My machine is on a LAN which has their own dedicated NTP server. How can I make my machine sync with our local NTP server? Is their a command? I don't recall but I beleive I have a NTP service running on my Debian machine - I just forgot how to command it to sync. I did google this and came up confused.

Can anyone tell me if I have the correct services configured to sync with a local NTP server and how to do so?
 
Old 04-11-2006, 03:42 PM   #2
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Not at my Debian box, but I think I installed ntp and then edited /etc/ntp.conf to contain a server on my network. Then I just restarted the ntp service. If you only need to have a client, you can use ntpdate and run it once from a cronjob.

http://www.debian.org/doc/manuals/sy...s-syncing-time
 
Old 04-11-2006, 03:43 PM   #3
Hangdog42
LQ Veteran
 
Registered: Feb 2003
Location: Maryland
Distribution: Slackware
Posts: 7,769
Blog Entries: 1

Rep: Reputation: 410Reputation: 410Reputation: 410Reputation: 410Reputation: 410
I think you want to use ntpd (which I think would be available for Debain if not already installed) and pretty much all you need to do is edit the /etc/ntp.conf file to point to your local NTP server.
 
Old 04-11-2006, 03:55 PM   #4
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Original Poster
Rep: Reputation: 73
How do I know if ntpd is already installed? I don't have anything regarding "NTP" or "ntp" in my /etc directory. I also can't seem to find it via APT

Code:
cwilliams:/etc# apt-get install ntpd
Reading package lists... Done
Building dependency tree... Done
E: Couldn't find package ntpd
 
Old 04-11-2006, 04:04 PM   #5
pljvaldez
Guru
 
Registered: Dec 2005
Location: Somewhere on the String
Distribution: Debian Squeeze (x86)
Posts: 6,092

Rep: Reputation: 269Reputation: 269Reputation: 269
Try ntp-server.

As for if it's installed, you can try dpkg --get-selections |grep ntp
 
Old 04-12-2006, 07:51 AM   #6
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Original Poster
Rep: Reputation: 73
This is what I found...

Code:
cwilliams@cwilliams:~$ dpkg --get-selections |grep ntp
ntpdate
What would be the command to sync the time as right now my clock says 4:51 & the correct time is 8:51 am.
 
Old 04-12-2006, 08:16 AM   #7
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
You need to apt-get install ntp-server. The configuation file is /etc/ntp.conf. Edit this file by reming the server lines and add your own;
server <ip_address of your network time server>
 
Old 04-12-2006, 08:19 AM   #8
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Original Poster
Rep: Reputation: 73
So I have to run an NTP server utility on my machine just to sync to an NTP server? I don't want my machine to be an NTP server if that makes sence.
 
Old 04-12-2006, 08:22 AM   #9
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 59
apt-get install ntp-simple

Takes care of everything
 
Old 04-12-2006, 08:25 AM   #10
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Original Poster
Rep: Reputation: 73
OK - I found the package.

Code:
cwilliams:/home/cwilliams# apt-cache search ntp-server
ntp-server - Network Time Protocol: common server tools
cwilliams:/home/cwilliams# apt-get install ntp-server
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
  ntp ntp-simple
Suggested packages:
  ntp-doc
The following NEW packages will be installed
  ntp ntp-server ntp-simple
0 upgraded, 3 newly installed, 0 to remove and 71 not upgraded.
I have edited the ntp.conf file with my local NTP servers and saved the file. Now what? How do I force a sync w/o rebooting.
 
Old 04-12-2006, 08:34 AM   #11
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by Carlwill
So I have to run an NTP server utility on my machine just to sync to an NTP server? I don't want my machine to be an NTP server if that makes sence.
It doesn't have to be a server in strict terms but could be. A quick explanation will help you understand. The server software starts by getting time from the remote server every 64 seconds. It then calculates the natural error of your own system clock and places this info in the drift file. As the drift becomes more consistent it reduces the number of requests made on the remote server and finally settles on a request rate of 1024 seconds because the software can compensate for the error of the system clock. The problem with an app like ntpdate is that it fires a wholes series of requests at the remote server and admins that run these can get a bit techy about this. I run a server as part of the ntp.pool.org and it really p....ses me off.
 
Old 04-12-2006, 08:36 AM   #12
TigerOC
Senior Member
 
Registered: Jan 2003
Location: Devon, UK
Distribution: Debian Etc/kernel 2.6.18-4K7
Posts: 2,380

Rep: Reputation: 49
Quote:
Originally Posted by Carlwill
I have edited the ntp.conf file with my local NTP servers and saved the file. Now what? How do I force a sync w/o rebooting.
do as root from a terminal /etc/init.d/ntp-server start (or stop or restart)
 
Old 04-13-2006, 10:33 AM   #13
carlosinfl
Senior Member
 
Registered: May 2004
Location: Orlando, FL
Distribution: Debian
Posts: 2,895

Original Poster
Rep: Reputation: 73
Code:
cwilliams@cwilliams:~$ su
Password:
cwilliams:/home/cwilliams# cd /
cwilliams:/# /etc/init.d/ntp-server start
Starting NTP server: ntpd.
Thanks!

That worked...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
redusing the ntp sync during booting hasher Linux - Software 0 03-23-2005 07:14 AM
NTP Client How to Sync automatically minil Programming 3 03-03-2005 02:52 AM
tuning/securing and ntp sync' in stuart39 Slackware 3 02-16-2005 11:03 AM
ntp time sync eyewittness Linux - Networking 2 08-11-2004 09:18 AM
NTP sync problems rbutler Linux - Newbie 0 01-17-2003 01:51 PM


All times are GMT -5. The time now is 03:25 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration