Gavin_Peng 发表于 2008-01-19 18:25

local host as ntp server setup


1.cp /etc/inet/ntp.server /etc/inet/ntp.conf
2.bash-3.00# more /etc/inet/ntp.conf
# ident "@(#)ntp.server 1.7   03/01/17 SMI"
#
# Copyright 1996-2003 Sun Microsystems, Inc.All rights reserved.
# Use is subject to license terms.
#
# /etc/inet/ntp.server
#
# An example file that could be copied over to /etc/inet/ntp.conf and
# edited; it provides a configuration template for a server that
# listens to an external hardware clock, synchronizes the local clock,
# and announces itself on the NTP multicast net.
#
# This is the external clock device.The following devices are
# recognized by xntpd 3-5.93e:
#
# XType Device    RefID          Description
# -------------------------------------------------------
#1    local   LCL            Undisciplined Local Clock
#2    trak      GPS            TRAK 8820 GPS Receiver
#3    pst       WWV            PSTI/Traconex WWV/WWVH Receiver
#4    wwvb      WWVB         Spectracom WWVB Receiver
#5    true      TRUE         TrueTime GPS/GOES Receivers
#6    irig      IRIG         IRIG Audio Decoder
#7    chu       CHU            Scratchbuilt CHU Receiver
#8    parse   ----         Generic Reference Clock Driver
#9    mx4200    GPS            Magnavox MX4200 GPS Receiver
# 10    as2201    GPS            Austron 2201A GPS Receiver
# 11    arbiter   GPS            Arbiter 1088A/B GPS Receiver
# 12    tpro      IRIG         KSI/Odetics TPRO/S IRIG Interface
# 13    leitch    ATOM         Leitch CSD 5300 Master Clock Controller
# 15    *         *            TrueTime GPS/TM-TMD Receiver
# 17    datum   DATM         Datum Precision Time System
# 18    acts      ACTS         NIST Automated Computer Time Service
# 19    heath   WWV            Heath WWV/WWVH Receiver
# 20    nmea      GPS            Generic NMEA GPS Receiver
# 22    atom      PPS            PPS Clock Discipline
# 23    ptb       TPTB         PTB Automated Computer Time Service
# 24    usno      USNO         USNO Modem Time Service
# 25    *         *            TrueTime generic receivers
# 26    hpgps   GPS            Hewlett Packard 58503A GPS Receiver
# 27    arc       MSFa         Arcron MSF Receiver
#
# * All TrueTime receivers are now supported by one driver, type 5.
#   Types 15 and 25 will be retained only for a limited time and may
#   be reassigned in future.
#
# Some of the devices benefit from "fudge" factors.See the xntpd
# documentation.
# Either a peer or server.Replace "XType" with a value from the
# table above.
server 127.127.1.0 prefer
#fudge 127.127.1.0 stratum 0
broadcast 224.0.1.1 ttl 4
enable auth monitor
driftfile /var/ntp/ntp.drift
statsdir /var/ntp/ntpstats/
filegen peerstats file peerstats type day enable
filegen loopstats file loopstats type day enable
filegen clockstats file clockstats type day enable
keys /etc/inet/ntp.keys
trustedkey 0
requestkey 0
controlkey 0
3.bash-3.00#touch   /var/ntp/ntp.drift
4.svcadm -v enable svc:/network/ntp
5.bash-3.00# ntpq -pn
   remote         refid      st t when poll reach   delay   offset    disp
==============================================================================
*127.127.1.0   127.127.1.0      3 l   54   64377   0.00    0.000   10.06
224.0.1.1       0.0.0.0         16 -    -   64    0   0.00    0.000 16000.0
bash-3.00#
6.bash-3.00# snoop |grep-i ntp
Using device /dev/hme (promiscuous mode)
192.168.1.104 -> solaris10-1.mydomain.com NTPsymmetric active (2008-01-19 10:17:17.32813)
solaris10-1.mydomain.com -> 192.168.1.104 NTPsymmetric passive (2008-01-19 10:16:58.61726)
192.168.1.104 -> solaris10-1.mydomain.com NTPsymmetric active (2008-01-19 10:18:55.42188)
solaris10-1.mydomain.com -> 192.168.1.104 NTPsymmetric passive (2008-01-19 10:18:36.70660)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:18:51.17022)
ns.szptt.net.cn -> solaris10-1.mydomain.com DNS R 1.1.0.224.in-addr.arpa. Internet PTR NTP.MCAST.NET.
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:19:55.17022)
192.168.1.104 -> solaris10-1.mydomain.com NTPsymmetric active (2008-01-19 10:20:35.06250)
solaris10-1.mydomain.com -> 192.168.1.104 NTPsymmetric passive (2008-01-19 10:20:16.33104)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:20:59.17020)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:22:03.17020)
solaris10-1.mydomain.com -> 192.168.1.104 TELNET R port=1738 bash: ntpd: command
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:23:07.17021)
solaris10-1.mydomain.com -> 192.168.1.104 TELNET R port=1738 bash: ntpd: command
solaris10-1.mydomain.com -> 192.168.1.104 TELNET R port=1738 bash: ntpd: command
192.168.1.104 -> solaris10-1.mydomain.com NTPsymmetric active (2008-01-19 10:23:58.73626)
solaris10-1.mydomain.com -> 192.168.1.104 NTPsymmetric passive (2008-01-19 10:23:58.72257)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:24:11.17024)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:25:15.17021)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:26:19.17020)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:27:23.17021)
solaris10-1.mydomain.com -> 192.168.1.104 TELNET R port=1738 # ident "@(#)ntp.ser
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:28:27.17022)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:29:31.17023)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:30:35.17019)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:31:39.17020)
solaris10-1.mydomain.com -> NTP.MCAST.NET NTPbroadcast (2008-01-19 10:32:43.17022)
192.168.1.104 -> solaris10-1.mydomain.com NTPsymmetric active (2008-01-19 10:33:05.23575)
solaris10-1.mydomain.com -> 1
7.bash-3.00# ntpq
ntpq> peers
   remote         refid      st t when poll reach   delay   offset    disp
==============================================================================
*LOCAL(0)      LOCAL(0)         3 l   31   64377   0.00    0.000   10.06
NTP.MCAST.NET   0.0.0.0         16 -    -   64    0   0.00    0.000 16000.0
ntpq>   
8.bash-3.00# more /etc/resolv.conf
domain mydomain.com
nameserver 127.0.0.1
nameserver 202.96.134.133
nameserver 202.96.128.86
bash-3.00#
Option DNS client setup
1.bash-3.00# more /etc/nsswitch.conf
#
# Copyright 2006 Sun Microsystems, Inc.All rights reserved.
# Use is subject to license terms.
#
#
# /etc/nsswitch.dns:
#
# An example file that could be copied over to /etc/nsswitch.conf; it uses
# DNS for hosts lookups, otherwise it does not use any other naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file has a "-" for nametoaddr_libs of "inet" transports.
# DNS service expects that an instance of svc:/network/dns/client be
# enabled and online.
passwd:   files
group:      files
# You must also set up the /etc/resolv.conf file for DNS name
# server lookup.See resolv.conf(4).
hosts:      files dns
# Note that IPv4 addresses are searched for in all of the ipnodes databases
# before searching the hosts databases.
ipnodes:   files dns
networks:   files
protocols:files
rpc:      files
ethers:   files
netmasks:   files
bootparams: files
publickey:files
# At present there isn't a 'files' backend for netgroup;the system will
#   figure it out pretty quickly, and won't use netgroups at all.
netgroup:   files
automount:files
aliases:    files
services:   files
printers:       user files
auth_attr:files
prof_attr:files
project:    files
tnrhtp:   files
tnrhdb:   files
bash-3.00#


本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/52003/showart_467994.html
页: [1]
查看完整版本: local host as ntp server setup