2013-08-09

NTP

Port number: UDP 123

date
  • # date --> check current system time.
    • Thu Sep  2 05:08:43 NZST 2010
  • # date MMDDhhmmYYYY  --> define the time manually.
  • # date -u --> check time with timezone UTC
    • Wed Sep  1 17:09:12 UTC 2010



hwclock
  • # hwclock
    •  --> check bios time.
  • # hwclock -w
    •  --> write the system time into bios.

ntpdate
  • # ntpdate  time.nist.gov
    • --> sync system time with outside time server of time.nist.gov.
    • (service NTP should be shutdown before the command using)

NTP client define NTP server where sync. time from.

  • # vim /etc/ntp/ntpservers
    • # clock.redhat.com
    • # clock2.redhat.com
    • # 10.11.0.160

NTP server bring up
  • # vim /etc/ntp.conf
    • --> configuration file
  • # service ntpd start
  • # chkconfig ntpd on

Timezone change (e.g. NewZealand)
  • # cp /usr/share/zoneinfo/Etc/GMT+12 /etc/localtime
or
  • # cp /usr/share/zoneinfo/ZN /etc/localtime
or
  • # vi /etc/sysconfig/clock

Time server in Taiwan
  • tock.stdtime.gov.tw ( 211.22.103.157 )
  • tick.stdtime.gov.tw ( 118.163.81.62 )
  • time.stdtime.gov.tw ( 118.163.81.61 )
On your Time server, review time sync. status with Time server ( stratum 1 )
  • # ntpq -p
Make sure the NTP port 123 not be block by Firewall
  • netstat -tlunp | grep ntp

沒有留言:

張貼留言