NTP(Network Time Protocol)
  -네트워크에 연결되어 있는 시스템에서 "시간"은 중요한 요소
  -여러 시스템에 설정되어 있는 시간이 서로 다르면, 시스템끼리
  통신을 하거나 파일을 송수신하는 등의 작업시 여러면에서
  혼란이 생길 수 밖에 없다.
 
  -그러므로 NTP를 이용하면 Time Server로 부터 받아온 시간을 통하여
  지역  시스템의 시간을 관리하기 때문에 여러 시스템의 사간을 정확히
  유지 가능.

NTP 프로그램은 따로 설치할 필요가 없고 solaris 을 설치 하면 기본적으로
설치가 됩니다.

---------------------------------------------------------------------------------

ntp 실행 데몬

시스템 부팅시 /etc/inet/ntp.conf 존재시 /etc/rc2.d/S74xntpd 스크립트 구동

---------------------------------------------------------------------------------

------ 1. 서버 설정 ------

ntp server ntp.conf 파일 생성.

ntp.conf 파일은 /etc/inet/ntp.server 파일을 ntp.conf 로 복사 해준다.

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

#vi /etc/inet/ntp.conf

---------------------------------------------------------------------------------

#vi /etc/inet/ntp.conf

#server 127.127.XType.0 prefer
#fudge 127.127.XType.0 stratum 0
 주석 처리

server gps.bora.net prefer
server ntp.ewha.net
server time.bora.net
server time.nuri.net
server ntp1.gngidc.net
server ntp2.gngidc.net
server time.kriss.re.kr

외부 타임 서버 추가
:wq!

#touch /var/ntp/ntp.drift  ------- 시간 오차값을 저장할 드리프트 파일 생성

---------------------------------------------------------------------------------

ntp server 실행

#/etc/init.d/xntpd start

---------------------------------------------------------------------------------

---------NTP 클라이언트의 구성------


1>

(sun>root)/etc/inet# cp ntp.client ntp.conf
 - 기본 ntp.client 파일은 multicast를 사용하여 ntp 업데이트를 수신합니다. NTP 클라이언트가 이러한 업
  데이트를 수신할 수 있는 장소를 제한하려는 경우 이것을 broadcast로 변경합니다.(broadcast 패킷은
  다른 서브넥에 전달되지 않는 반면 multicast 패킷은 전달 됩니다.)

(sun>root)/etc/inet#/etc/init.d/xntpd start
#multicastclient 224.0.1.1 --> 기본설정
server 192.168.0.222
wq!

(sun>root)/etc/inet# ps -ef | grep ntp
    root  479  400  0 08:40:55 pts/2    0:00 grep ntp
    root  456    1  0 08:23:07 ?        0:01 /usr/lib/inet/xntpd
(sun>root)/etc/inet#
(sun>root)/etc/inet# ntpq -p
    remote          refid      st t when poll reach  delay  offset    disp
==============================================================================
 sun            0.0.0.0        16 -    -  64    0    0.00    0.000 16000.0
 gps.bora.net    0.0.0.0        16 u  48  64    0    0.00    0.000 16000.0
(sun>root)/etc/inet#
 remote - 원격 피어 , refid - 피어가 동기화되는 호스트 st- stratum 번호 ,
 t - 유형 즉 unicast , multcst, local ( - = 알수 없음)
 poll - 초 단위 폴링 간격 reach - 도달 가능성 레지스터
 * 원격에서 현재 선택된 피어를 나타냅니다.
 + 호스트가 동기화에 대한 수락 가능한 피어이지만 수락되지 않았음을 나타냄.
 _ 수락 불가능


2>
서버의 ntp.conf 파일을 생성 한 것처럼 클라이언트 파일 생성

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

---------------------------------------------------------------------------------

클라이언트 ntp.conf 파일 설정

#vi /etc/inet/ntp.conf

multicast 224.0.1.1

---------------------------------------------------------------------------------

ntp 클라이언트 데몬 실행

#/etc/init.d/xntpd start

---------------------------------------------------------------------------------

ntp 서버 외부 서버 설정 확인

(test>root)/# ntpq -p
    remote          refid      st t when poll reach  delay  offset    disp
==============================================================================
 NTP.MCAST.NET  0.0.0.0        16 -    -  64    0    0.00    0.000 16000.0
 gps.bora.net    0.0.0.0        16 u  56 1024    0    0.00    0.000 16000.0
+211.39.143.103  tick.exit.com    2 u  28  64  377    12.48  -4.273  13.41
+zero.bora.net  usno.pa-x.dec.c  2 u  49  64  377    12.34  -6.764    5.84
*ntp1.epidc.co.k 192.168.17.8    2 u    2  64  377    12.19  -5.149    4.04
 ntp2.epidc.co.k 192.168.17.9    2 u  89 1024  317    24.70  -0.274 1019.15
-timency.kriss.r .LOCL.          1 u  169  512  377    11.08    3.647  18.83
(test>root)/#

---------------------------------------------------------------------------------

ntp 서버와 클라이언트는 같이 셋팅 할수 없다.
ntp 서버 통신 방법은 클라이언트가 multicast 224.0.1.1 주소를 가지고
서버를 찾는 방식이다.

+ Recent posts