Solaris10配置ntp客户端

停止、启动NTP服务

svcadm disable svc:/network/ntp

svcadm enable svc:/network/ntp

svcadm refresh svc:/network/ntp

svcadm restart svc:/network/ntp

方法一:

crontab配置:

51 * * * * . /etc/profile;/usr/sbin/ntpdate -b 10.204.50.136 >/tmp/ntp.log

方法二:

# cp /etc/inet/ntp.client /etc/inet/ntp.conf

# vi /etc/inet/ntp.conf

"/etc/inet/ntp.conf" 10 行,291 字符 

# ident "@(#)ntp.client 1.3     00/07/17 SMI"

#

# /etc/inet/ntp.client

#

# An example file that could be copied over to /etc/inet/ntp.conf; it

# provides a configuration for a host that passively waits for a server

# to provide NTP packets on the ntp multicast net.

#

#multicastclient 224.0.1.1

server 10.204.50.135

~

"/etc/inet/ntp.conf" 11 行,313 字符 

# svcs -l svc:/network/ntp:default

fmri         svc:/network/ntp:default

名称         Network Time Protocol (NTP)

启用         否

状态         disabled

next_state   none

state_time   2011年09月25日 星期日 11时59分41秒

重启程序     svc:/system/svc/restarter:default

dependency   require_all/error file://localhost/usr/sbin/ntpq (online) file://localhost/usr/sbin/ntpdate (online)

dependency   require_any/error svc:/network/service (online)

dependency   optional_all/error svc:/milestone/name-services (online)

# /usr/sbin/ntpdate -b 10.204.50.136

26 Sep 09:34:09 ntpdate[24249]: step time server 10.204.50.135 offset -3.715703 sec

# svcadm enable svc:/network/ntp:default

# svcs |grep ntp

online          9:34:21 svc:/network/ntp:default

# ntpq -p

     remote           refid      st t when poll reach   delay   offset    disp

==============================================================================

*10.204.50.135   10.209.11.129    2 u    5   64   37     0.31    5.985  877.17

========================================================

猜你喜欢

转载自blog.csdn.net/mnbwz/article/details/114018861