'solaris sub'에 해당되는 글 13건

  1. 2008.09.23 VirtualNetworkSetting
  2. 2008.09.04 NTP(Network Time Protocol)
  3. 2008.09.04 DHCP(Dynamic Host Configuration Protocol) Server 2
  4. 2008.09.02 DNS Server Management
  5. 2008.09.02 nslookup CMD
  6. 2008.09.02 DNS Server(Domain Name System) 1
  7. 2008.09.01 IPv6-IPv4-IPv6 Tunnel Configuration
  8. 2008.08.29 ref_ipv6
  9. 2008.08.29 ref-NICspeedconfiguration 1
  10. 2008.08.29 ref_ethernet
  11. 2008.08.29 ref_icmp
  12. 2008.08.29 ref_ipmp
  13. 2008.08.29 ref_ndd
2008. 9. 23. 15:55

VirtualNetworkSetting

 


  NIC Configuration (Solaris 10 x86 on VMWare)

 

    작성자: 백승찬
    작성일: 2008.05.07(수)
    참  고: http://cafe.daum.net/bscsolaris

 


(작업상태)
(1). 운영체제는 새로 설치된것으로 가정한다.
(2). NIC는 1개를 설정하고 Bridge로 선택한것으로 가정한다.
(3). 네트워크 구성은 다음 그림을 참고한다.

       [ MS Windows ]
              +------------+
              |                  |
 ----------- NIC1        VMnet0 -----------+-
              |                  |                          |
              |                  VMnet1                 |           
              |                  |                          |
              |          VMnet8 ----------| ----+-
              |            |                       |       | 
              |            |                       +       + 
              +------------+        +----NIC2--NIC3--+ 
                                           |      pcn0  pcn1    |
                                           |                         | 
                                           |                         | 
                                           +----------------+
                                                 solarisXXX  

     [그림] VMWare Bridge + NAT Network Configuration

 

  -------------- VMnet8 --------------------+--------
              (NAT Device)            192.168.10.XXX
       192.168.10.1  192.168.10.2     solarisXXX


(예) 강사용 컴퓨터
NIC1 : 121.160.70.121
NIC2 : 172.16.8.254
NIC3 : 192.168.10.250


■ (작업1) NIC2(pcn0) 정상 동작 유무 확인
■ (작업2) NAT 네트워크 대역 조정(192.168.10.0)
■ (작업3) NIC3(pcn1) 설정

 

(작업1) NIC2 정상 동작 유무 확인
# ping -s 172.16.8.254

 

(작업 2) NAT 네트워크 대역 조정(192.168.10.0)
# sync
# poweroff
VMWare "Power Off" 아이콘 클릭

VMWare > Edit > Virtual Network Setting
> Host Virtual Network Mapping
> VMWare Network Adapter VMnet8
> Subnet
IP Address   : 192.168.10.0
Subnet Mask  : 255.255.255.0

> NAT Setting
기본라우터: 192.168.10.2 (정보 확인)
            -> 자동으로 설정 되어 있다.

 

(작업 3) NIC3(pcn1) 설정
■ NIC3(pcn1) 추가
■ Device Reconfiguration
■ NIC3 IP 설정
   IP : 192.168.10.XXX / 255.255.255.0
   /etc/hosts, /etc/hostname.pcn1, /etc/netmasks


(1). NIC 추가 작업
VMWare > VM > Setting > Add > Ethernet Adapter > NAT 선택 > Finish
VMWare PowerON

 
(2). 디바이스 재인식(Device Reconfiguration)
# cat /etc/path_to_inst | grep pcn
# devfsadm -v
# cat /etc/path_to_inst | grep pcn


(3). IP 설정 작업
■ /etc/hosts
■ /etc/hostname.pcn1
■ /etc/netmasks
■ /etc/defaulrouter
■ /etc/nsswitch.conf
■ /etc/resolv.conf

# vi /etc/hosts
......
[수정전]
127.0.0.1  localhost
172.16.8.XXX solarisXXX loghost
[수정후]
127.0.0.1  localhost
172.16.8.XXX solarisXXX   solarisXXX.example.com  loghost   <-----  정보 수정
192.168.10.XXX nic2            <----- 라인 추가

# cat > /etc/hostname.pcn1  (# echo "nic2" > /etc/hostname.pcn1)
nic2
<Ctrl + D>
# cat /etc/hostname.pcn1

# vi /etc/netmasks
.....
[수정전]
172.16.0.0  255.255.0.0
[수정후]
172.16.0.0  255.255.0.0
192.168.10.0 255.255.255.0   <----- 라인 추가

# ifconfig pcn1 plumb up
# ifconfig pcn1 192.168.10.XXX netmask 255.255.255.0 broadcast +
# ifconfig -a


(4). Defaultrouter 설정 작업
# cat /etc/defaultrouter
172.16.0.1

# cat > /etc/defaultrouter
192.168.10.2
<Ctrl + D>

# route flush
# route add default 192.168.10.2
# netstat -nr


(5). DNS Client 설정 작업
# cp /etc/nsswitch.dns /etc/nsswitch.conf

# cat > /etc/resolv.conf
nameserver 168.126.63.1
<Ctrl + D >


(6). 확인 작업
# reboot
(부팅 이후에 정보 확인)
# nslookup www.daum.net

 

(작업 4) Port Forwarding 설정
VMWare > Edit > Virtual Network Setting > NAT Tab


Client --------> Window(VMWare) -------> Solaris
# telnet S       23 ---> 192.168.253.254 23

 

(작업 5) 환경작업
 - korn shell 변경
 - ENV_main.sh

(1). korn shell 변경
# passwd -e
Old shell: /sbin/sh
New shell: /bin/ksh    <----- '/bin/ksh' 입력

(2). ENV_main.sh 실행
# dfshares 172.16.8.254
# mkdir /mnt/server
# mount 172.16.8.254:/root/shell /mnt/server
# cd /mnt/server
# ls
# ./ENV_main.sh

# cat /.profile
# cat /.kshrc
# cat /.exrc
# cat /.rhosts
# cat /etc/default/login
# cat /etc/ssh/sshd_config
# cat /etc/ftpd/ftpusers

# ksh
# . /.profile  (csh # source /.cshrc)
# . /.kshrc

 



 

2008. 9. 4. 18:46

NTP(Network Time Protocol)

 

 

 

               NTP(Network Time Protocol)

 

 

 

 

 

0. Why NTP !!!!

__________________

 

많은 네트워크 프로그램들은 시간 동기화가 필요하게 된다. 네트워크 상에서 서로 연동하

는 시스템들 간에 시간이 일치 하지 않게 된다면 다수의 시스템 장애처리, 성능카운트,

분석, 로깅등 수많은 문제점을 갖게된다.

 

NFS Server

DB Server

Logging Server

NMS Program(Network Management Solution)

Encyption

기타

 

 

 

===== WebServerA =====                 ===== NFS Server ====

 Date: 12:00                                12:10

        /p/file1(12:10)                 /source/file1(12:10)

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

                                                  A

===== WebServerB =====                            |

 Date: 12:40                                      +---- file1 생성

        /p/file1(12:10)

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

 

             [그림] 서버간의 시간 동기화 이유

 

 

[참고] 실무에서 많이 사용하고 있는 방법 예

# rdate gps.bora.net

or

# ntpdate time.kriss.re.kr

 

# crontab -e

0 * * * * rdate gps.bora.net    (gps.bora.net:  210.120.246.46)

......

0 * * * * ntpdate time.kriss.re.kr

 

 

[EX] rdate 명령어 실습

 

# date

Fri Mar  7 10:45:34 KST 2008  (10 45 34)

 

# date 03070845               (03 07 08 45)

# date

Fri Mar  7 08:45:00 KST 2008  (03 07 08 45 00)

 

# rsh 172.16.8.254 date

 

# rdate 172.16.8.254

# date

(서버의 시간과 같은지 확인한다.)

 

 

 

 

 

1. NTP Server Overview

_________________________

 

NTP (network time protocol, 네트웍 시간 프로토콜)

 

NTP는 네트웍으로 연결되어 있는 컴퓨터들끼리 클록 시각을 동기화시키는데 사용되는 프

로토콜이다. NTP는 미국 델라웨어 대학의 데이빗 밀스에 의해 처음 개발되었으나, 이제는

인터넷 표준이 되었다. NTP는 컴퓨터 클록 시간을 1/1000 초 이하까지 동기화시키기 위

해 협정 세계시각(UTC)을 사용한다.

 

컴퓨터 네트웍 전반에 걸쳐 정확한 시각을 유지하는 것은 여러 가지 이유로 중요한데, 그

이유는 심지어 수십 분의 1초 정도의 차이만으로도 큰 문제가 발생될 수 있기 때문이다.

예를 들어 협정 세계시에 기반을 두면, 지역적으로 분산된 업무처리 환경에서도 작업 순

서가 정확히 유지될 수 있다. 보안 메커니즘 역시 네트웍 전체에 걸쳐 협정 세계시에 기

반을 두고 있다. 여러 대의 컴퓨터가 하나의 파일 시스템을 수정하는 것 역시 정확히 동

기화된 클록 시각에 의존해야 한다. 항공기의 운항 궤적을 그림으로 표시해 주는 항공관

제 시스템에도 매우 정확한 시간측정이 요구되는 것은 당연하다.

 

협정세계 시각은 무선이나 위성 시스템 등, 여러 가지 방법으로 얻어진다. GPS나 정부기

관 등과 같은 특수한 수신자들은 보다 높은 수준의 서비스를 이용하는 것이 가능하지만,

모든 컴퓨터에 수신기를 장착하는 것은 비경제적이며, 현실성이 없다. 그 대신에, 시각

서버로 지정된 컴퓨터들에만 수신기를 장착하고, 이 서버들과 네트웍으로 연결되어 있는

컴퓨터들의 클록 시각은 NTP와 같은 프로토콜을 사용하여 동기화하는 것이다.

 

협정세계시로부터 떨어져 있는 수준을 표시하기 위해 흔히 계층번호를 쓰는데, 0번 계층

은 전용 송신기 또는 위성 위치추적 시스템으로부터 수신된 실제 시각인 무선 클록을,

1번 계층은 이 무선 클록과 직접 연결되어 있는 컴퓨터의 클록을, 2번 계층은 1번 계층으

로부터 시각을 받은 컴퓨터 등으로 원천 협정 세계시로부터 멀수록 계층 번호가 커져 간다.

 

 

NTP라는 용어는, 프로토콜과 컴퓨터상에서 실행되는 클라이언트/서버 프로그램, 둘 모두

에 대해 사용된다. 프로그램은 사용자에 의해 NTP 클라이언트, NTP 서버, 또는 둘 모두로

해석될 수 있다. NTP 클라이언트는 시각 서버에 정확한 현재 시각을 교환할 것을 요구한다.

이 교환의 결과를 통해, 클라이언트는 서버의 시각과의 차이를 이용하여 링크 지연시간을

계산할 수 있으며, 자신의 클록을 서버에 있는 클록과 일치하도록 조정할 수 있다. 하나의

규칙으로서, 처음 클록을 맞추기 위해서는 5~10분 동안 모두 6번의 시각 교환이 요구된다.

일단 시각 동기화가 끝나면, 클라이언트는 매 10분마다 메시지 교환을 통해 클록을 수정

한다. 클록 동기화의 신뢰도 및 정확도를 높이기 위해, 여러 대의 서로 다른 서버와 다양

한 네트웍 경로가 사용된다. 클라이언트/서버 동기화에 아울러, NTP는 브로드캐스트를 통

한 컴퓨터 클록 동기화도 지원한다. NTP는 매우 높은 수준의 내고장성과 확장 가능성을

염두에 두고 설계되었다.

 

 

NTP 서버에서 사용되는 용어에 대해 알아보자.

 

(1). 기본적인 용어

■ Reference Clock   - GMT, UTC과 같이 표준시간 또는 참고 시간 (기준 시간)

■ Strata            - NTP 서버의 계층적 구조

■ Stratum-1 Server  - NTP 1계층 서버

   Stratum-2 Server  - NTP 2계층 서버

   ...    -15 ....   - NTP 15계층 서버(15까지 존재)

■ Drift File        - PPM(Parts-Per-Million)단위로 오프셋에 일치하는 단일 부동 소수

                       점이 들어가 있다. (예: /var/ntp/ntp.drift)

■ xntpd             - NTP 서버/클라이언트 데몬

■ ntp.conf          - NTP 서버/클라이언트 주 설정 파일

 

 

 

(2). 추가적인 용어

■ Resolution       - 시간 제공 장치에서 사용하는 시간의 최소 단위.

                       예) 손목시계의 Resolution : 1초

■ Precision        - 컴퓨터 프로그램에서 사용하는 시간의 최소 단위.

■ Accuracy         - 시간의 정확성. 기준시간(UTC)과 얼마나 근접한가를 나타냄.

■ Jitter           - 시간을 측정했을 때 생기는 오차 중 작은 값.

■ Wander           - 시간을 측정했을 때 생기는 오차 중 큰 값.

 

 

[참고] UTC & GMT

■ UTC(Universal Time Coordinate) 협정 세계시, 그리니치 표준시 대신 방송에 사용되

   는 표준시. 협정 세계시는 국제 사회가 사용하는 과학적 시간의 표준입니다.

   1972년 1월 1일부터 시행된 협정세계시에서는 67년 국제도량형총회가 정한 세슘원자의

   진동수에 의거한 초의 길이가 그 기준(원자초)으로 쓰인다. 그 때까지 시간의 기준으로

   는 지구의 자전에 의한 평균태양시와 지구의 공전에 의한 태양년에서 산출한 초의 길이

   가 쓰였다. 그리니치표준시(GMT)는 원래 평균태양시를 기준으로 한 것이었다. 따라서

   원자시계를 표준으로 하면서부터 GMT라는 명칭이 실체(實體)를 바르게 나타내지 못하는

   불합리한 점이 생겼다. 이러한 문제를 없애기 위해서 1978년 국제무선통신자문위원회

   (CCIS) 총회는 통신분야에서는 금후 그리니치평균시를 협정세계시(UTC)로 바꾸어 쓰자

   는 권고안을 채택하였다.

 

■ GMT(Greenwich Mean Time) 그리니치 표준시.

   그리니치천문대를 지나는 본초자오선(그리니치자오선)을 기준으로 하는 시. 약호 GMT.

   약칭하여 그리니치시라고도 한다. 1925년 이전의 그리니치시는 정오(正午)를 0시로 하여

   시간을 재기 시작하는 방식의 천문학용 평균태양시의 명칭이었다. 이에 반해 일상생활에

   서는 자정을 0시로 하여 시간을 재는 방식이 사용되었으며, 이것을 그리니치상용시(GCT)

   라고 하였다. 1925년 1월 1일 국제천문연합에서는 그리니치시를 12시간 앞당겨 그리니치

   상용시와 일치시켰으며, 이를 세계시(世界時)라고 하여 전세계 공통의 표준시로 사용하

   였다. 그러나 지구의 자전을 근거로 한 이 세계시는 수정시계나 원자시계와 비교한 결과

   지구 자전의 불규칙성에 의한 오차가 있으므로 1972년 이후에는 새로이 협정세계시가 세

   계표준시로 사용되었다. 협정세계시란 세계시와는 달리 원자 방사(放射)의 진동수를 기

   준으로 하고, 원자시의 초(秒)를 세분하여 세계시와의 차이가 0.9초 이내가 되도록 만든

   것이다.

 

[참고] 참고 URL(시, 시간의 인식, 시의 척도, 시법, 하루의 시작, 보시등)

http://kr.dic.yahoo.com/search/enc/result.html?p=UTC&pk=15348300&subtype=&type=enc&field=id

 

 

[참고] Stratum 1 / Stratum 2

http://www.ntp.org

Stratum 1 Server : http://support.ntp.org/bin/view/Servers/StratumOneTimeServers

Stratum 2 Server : http://support.ntp.org/bin/view/Servers/StratumTwoTimeServers

 

 

 

 

 

2. NTP Server Concept

________________________

 

 

(1). Startup Script

 

부팅시에 실행되는 스크립트로는 런레벨2에서 동작하는 S74xntpd 스크립트에 의해 xntpd

데몬이 동작하게 된다. xntpd 데몬은 기본값으로 123번 포트를 사용한다.

 

- /etc/init.d/xntpd stop/start

- /etc/rc2.d/S74xntpd

 

 

 

(2). NTP Network Transfer Time Check

 

 NTP Client           NTP Server

     |                     |

  T1 | ------------------> | T2

     |                     |

     |                     |

  T4 | <------------------ | T3

     |                     |

     |                     |

 

네트워크에서 보낸시간 = [(T2-T1)+(T4-T3)] / 2

 

 

(a). NTP Client는 NTP 서버에 현재 시간을 요구하는 요청을 보낼 때, 패킷에 클

     라이언트의 현재 시간(T1)을 포함하여 보낸다.

(b). 클라이언트의 요청을 받은 NTP 서버는 요청을 받았을 때의 서버 시간(T2)을

     패킷에 포함한다.

(c). NTP 서버는 현재 UTC 시간을 패킷에 포함하고, 클라리언트로 보내는 순가의

     서버 시간(T3)도 패킷에 포함하여 클라이언트의 요청에 응답한다.

(d). 클라이언트는 서버의 응답을 받는 순간의 시간(T4)과 나머지 시간들을 이용

     하여 네트워크에서 얼만큼의 시간을 보냈는지 판단하여 UTC 시간에 더한 후

     시스템의 시간으로 설정한다.

 

 

 

 

 

3. NTP Server Configuration

_____________________________

 

# cd /etc/inet

# ls ntp.*

(ntp.server, ntp.client) => ntp.conf

 

ntp.server : NTP Server Templete Configuration File

ntp.client : NTP Client Templete Configuration File

 

 

(1). Undiscipline Local Clock

# cd /etc/inet

# cp ntp.server ntp.conf

# vi ntp.conf

......

server 127.127.1.0 prefer         <----- 라인 수정(XType -> 1)

#fudge 127.127.XType.0 stratum 0  <----- 주석 처리

......

driftfile /var/ntp/ntp.drift      <----- 정보 확인

......

# touch /var/ntp/ntp.drift

# /etc/init.d/xntpd stop

# /etc/init.d/xntpd start

 

 

 

(2). Discipline Clock

 

# cp ntp.server ntp.conf

# vi ntp.conf

......

server time.kriss.re.kr prefer      <----- 라인 추가

server gps.bora.net                 <----- 라인 추가

server <NTP 서버 IP>                <----- 라인 추가

......

#fudge 127.127.XType.0 stratum 0    <----- 주석처리

......

 

# touch /var/ntp/ntp.drift

# /etc/init.d/xntpd stop

# /etc/init.d/xntpd start

 

 

[참고] server Directive

server 지시자 다음에 쓸수있는 대표적인 기관(IP)은 한국표준연구원입니다. 시스템(서버)

의 시간을 세계표준시(초단위까지)로 설정하고 싶다면 rdate 명령어를 사용하여 다음과

같이 사용합니다.

 

# rdate time.kriss.re.kr

or

# ntpdate time.kriss.re.kr

(time.kriss.re.kr : 210.98.16.100)

한국표준연구원 : http://www.kriss.re.kr

                 시간, 길이, 질량등 모든 표준을 관리합니다.

 

 

[참고] ntp.server 파일 해석

/etc/inet/ntp.server (/etc/inet/ntpd.conf) 파일의 해석에 대해 알아 보자.

ntp.conf 파일의 해석에 대한 글은 KIPA 사이트의 글을 인용하여 만들었습니다.

 

 

# vi /etc/inet/ntp.server

------------------- ntp.server 파일 해석 시작 -----------------------------

(a) 주석 부분 해석

 

/etc/inet/ntp.conf로 복사하여 수정할 수 있는 예제 파일입니다. 이

파일은 외부 하드웨어 클럭을 수신하여 로컬 클럭을 동기화시키고 NTP

멀티캐스트 넷에 자신을 발표하는 서버를 위한 환경 설정 템플릿으로

사용할 수 있습니다.

 

다음 클럭 장치들에 대해서는 RFC 1305를 참조하십시오.

이것은 외부 클럭 장치입니다. 다음 장치들은 xntpd 3.4y에 의해 인식됩니다.

 

XType 장치 이름 해설

 

# 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

 

일부 장치들은 "fudge" 인자를 사용하여 도움을 얻을 수 있습니다.

xntpd 문서를 참조하십시오.

 

피어나 서버 중의 하나입니다. "XType"을 위의 표의 값으로 바꾸십시오.

 

로컬 하드웨어 클럭 장치를 추가하는 경우,

드라이버는 여기서 server 127.127.XX.0과 같은 지시문으로

지정됩니다. 여기서 127.127은 NTP에게 이것이 원격 네트워크 피어가

아니라 로컬 네트워크 피어임을 알려 주는 것이고, XX는 NTP 배포판에 설명된

클럭 유형입니다. 이 환경 설정 파일의 제한 지시문은 이 호스트가

지정된 두 IP 주소와만 대화를 하도록 지정합니다. 호스트는 그 외의

다른 주소는 신뢰하지 않으며, 다른 주소에 시간을 할애하지 않을 것입니다.

배포판에는 많은 제한 옵션에 대한 문서 자료가 포함되어 있습니다.

예를 들어 다음 코드 라인을 사용하면 이 호스트를 시간 서버로 설정할 수 있습니다.

    restrict default notrust nomodify

이 코드 라인은 요청을 받으면 시간 패킷을 보내지만 다른 피어에

동기화시키지는 않는다는 의미입니다.

 NTP의 통계 자료 및 파일 생성 기능을 이용하면 NTP 성능을 기록 처리할 수

있습니다. 예를 들어, /usr/adm/peerstats의 레코드의 형식은 다음과 같습니다.

 

MJD Second Peer IP Stat Offset Delay Dispersion

49815 60424.676 192.5.41.40 9614 -0.000040 0.00169 0.00793

 

UT 일이 시작된 이후 60424.676 초가 경과한 때인 Modified Julian Date 49815에

행해진 이 항목은 주소가 192.5.41.40인 시간 서버와 비교하여 클럭을

-0.000040 초 만큼 보정했음을 알려줍니다. 두 시스템 사이의 네트워크

시간 지연은 (실제로는 바로 옆 방에 있는 시스템인데도) 0.00169초로

계산되었고, 시간 지연 추정값 샘플의 분산은 0.00793 초였습니다.

Stat 필드에는 RFC-1305 문서에서 자세히 설명하는 것처럼 ntp 상태 플랙이

지정됩니다. 공개 NTP 릴리스의 scripts/stats 디렉터리에는 이러한 로그

파일을 요약하는 유틸리티들이 있습니다.

 

 

 

(b). server & fudge 설정

 

그곳에는 기본 설정에 따라 다음 두 코드 라인이 있습니다. 사용자의 설정 내용에 따라 그

내용을 수정하십시오.

 

     # server 127.127.XType.0 prefer          //server용

     # fudge 127.127.XType.0 stratum 0        // next stratum servern

 

세 가지 종류의 시간 서버

(ㄱ). peer host_address [ key # ] [ version # ] [ prefer ]

로컬 서버가 host_address로 지정된 원격 서버와 함께 대칭형 액티브 모드로 작동하게 지

정하는 것입니다. 즉, 로컬 서버를 원격 서버에 동기화시킬 수 있습니다.

 

(ㄴ). server host_address [ key # ] [ version # ] [ prefer ] [ mode # ] server

로컬 서버가 명령에 따라 이름이 지정된 원격 서버에 대해 "클라이언트" 모드로 작동하게

지정하는 것입니다. 이 모드에서는 로컬 서버를 원격 서버에 동기화시킬 수 있지만, 원격

서버는 절대로 로컬 서버에 동기화시킬 수 없습니다.

 

(ㄷ). broadcast host_address [ key # ] [ version # ] [ ttl # ]

로컬 서버가 "broadcast" 모드로 작동하게 지정하는 것입니다. "broadcast" 모드에서 로

컬 서버는 명령으로 이름이 지정된 브로드캐스트/멀티캐스트 주소의 클라이언트에게 주기

적으로 브로드캐스트 메시지를 보내게 됩니다.

 

key 이 주소로 보내진 모든 패킷에 지정된 키 번호를 사용하여 암호화된 인증 필드가 포

함되어 있음을 가리킵니다. 이 숫자의 범위는 부호가 붙지 않은 32 비트 정수의 범위입니

다. 달리 지정하지 않으면, 암호화 필드가 포함되지 않습니다. version 밖으로 보내는

NTP 패킷에 대해 사용할 버전 번호를 지정합니다. version 1, version 2, version3 중에

서 선택합니다. 기본 설정값은 version 3입니다. prefer 호스트를 우선 호스트로 표시합니

다. 이 호스트는 비교할 수 있는 다른 호스트를 통하여 동기화시킬 때 우선 처리됩니다.

전체 목록은 xntpd에 관한 매뉴얼 페이지를 참조하십시오.

 

필자는 로컬 클럭을 서버 클럭으로 사용하므로, Xtype=1입니다.

fudge 명령은 다음과 같이 특별한 방식으로 클럭을 참조하기 위해 사용할 수 있습니다.

fudge 127.127.t.u [ time1 secs ] [ time2 secs ]

[ stratum int ] [ refid int ] [ flag1 0|1 ]

[ flag2 0|1 ] [ flag3 0|1 ] [ flag4 0|1 ]

stratum: 0에서 15까지의 범위에 속하는 숫자이며 클럭에 비표준 작동 방식을 할당하는

데 사용됩니다. 달리 지정하지 않으면, 이 값은 0입니다. 프라이머리 서버는 대체로

stratum을 0보다 큰 값으로 표시합니다.

자세한 내용은 xntpd에 관한 매뉴얼을 참조하십시오.

 

 

     server 127.127.1.0 prefer

     fudge 127.127.1.0 stratum 0

 

 

 

(c). 다양한 옵션 설정 / 해제

 

enable auth|bclient|pll|monitor|stats [ ... ]

disable auth|bclient|pll|monitor|stats [ ... ]

 

신뢰할 수 있는 키와 식별 부호를 사용하여 환경 설정이 되지 않은 피어를 정확하게 인증

한 경우에만 서버가 그 피어와 동기화됩니다. 또한 모니터 기능도 사용하도록 설정합니다.

 

     enable auth monitor

 

 

 

(d). Drift File의 위치 지정

 

drift 파일의 위치를 지정합니다 이 파일에는 ppm(parts-per-million) 단위로 오프셋에 일

치하는 단일 부동 소수점 값이 들어 있습니다.

 

     driftfile /var/ntp/ntp.drift

 

 

 

(e). ntpstat 디렉토리 지정

 

ntpstats 디렉토리를 지정합니다.

 

     statdir /var/ntp/ntpstats

 

# cd /var/ntp/ntpstats

# ls

.....

loopstats.20070826   peerstats.20070709   peerstats.20071101

loopstats.20070828   peerstats.20070710   peerstats.20071102

loopstats.20070829   peerstats.20070711

loopstats.20070905   peerstats.20070714

......

 

# cat peerstats.20071102

......

54406 16854.142 0.000000 -28.4410 6

54406 16918.141 0.000000 -28.4410 6

54406 16982.138 0.000000 -28.4410 6

54406 17046.137 0.000000 -28.4410 6

 

 

 

(f). peerstats, loopstats, clockstats 설정

 

peerstats, loopstats, clockstats 등의 파일을 생성하고 파일을 사용할 있도록

합니다.

 

filegen name [ file filename ] [ type typename ] [ flag flagval ] [ link|nolink ]

             [ enable|disable ]

하루 동안 피어, 루프, 클럭 등의 stat 파일을 생성하고 그 파일을 사용할 수 있도록 설

정합니다.

 

유형과 관련된 다른 옵션들은 다음과 같습니다.

week,month,year,age ,none

 

     filegen peerstats file peerstats type day enable

     filegen loopstats file loopstats type day enable

     filegen clockstats file clockstats type day enable

 

 

 

(g). 인증 기법 지정

 

인증 기법을 사용하는 경우 이곳에서 지정하십시오

keys filename

인증 모드로 작동할 때 xntpd가 사용하는 암호화 키와 키 식별 부호가 들어 있는 파일의

이름을 지정합니다.

 

     keys /etc/inet/ntp.keys

     trustedkey 0

     requestkey 0

     controlkey 0

 

trustedkey # [ # ... ]

동기화에 적합한 인증 피어의 목적에 맞게 신뢰할 수 있는 암호화 키 식별자를 지정합니

다. 인증 절차를 사용하려면 로컬 서버와 원격 서버가 모두 이러한 목적으로 사용하도록

정의된 키와 키 식별자를 동일하게 공유해야 합니다. 하지만, 서버마다 다른 키를 사용할

수도 있습니다. 인수는 부호가 붙지 않은 32 비트 정수입니다. 하지만, key 0는 고정되어

있고 글로벌 영역에 알려져 있다는 점에 유의하십시오. 의미있는 인증을 실행해야 한다면,

0 키를 신뢰해서는 안됩니다.

 

controlkey #

ntpq(1M) 프로그램에서 사용할 키 식별자를 지정합니다. 이 프로그램은 xntpd 동작에 영

향을 주는 문제들을 진단하고 수리하는 데 도움이 됩니다. ntpq 프로그램과 xntpd의 동

작은 RFC 1305 규정의 내용과 일치합니다. 로컬 서버의 상태에 영향을 주는 원격 ntpq 프

로그램에서 보내는 요청은 인증되어야 합니다. 이렇게 하려면 원격 프로그램과 로컬 서버

가 모두 공통 키와 키 식별자를 공유해야 합니다. 이 명령의 인수는 부호가 붙지 않은 32

비트 정수입니다. 환경 설정 파일에 controlkey 명령이 포함되어 있지 않거나 키가 일치

하지 않은 경우, 이러한 요청은 무시됩니다.

 

authdelay seconds

로컬 컴퓨터의 NTP 인증 필드를 암호화하는 데 걸리는 시간을 알려줍니다. 이 값은 밖으

로 나가는 패킷에 대해 인증을 할 때 전송 타임스탬프를 교정하는 데 사용됩니다. 이 값

은 호스트 컴퓨터의 CPU 속도에 따라 다르지만 일반적으로 0.0001 초에서 0.003 초의 범

위에 있습니다.

 

액세스 제어 명령:

액세스를 제한하는 데 restrict를 사용하는 것 이외에는 지금은 사용하지 않습니다.

 

구문:

restrict address [ mask numeric_mask ] [ flag ] [ ... ]

이 환경 설정 파일의 제한 지시문은 이 호스트가 지정된 두 IP 주소와만 대화를 하도록

지정합니다. 호스트는 그 외의 다른 주소는 신뢰하지 않으며, 다른 주소에 시간을 할애

하지 않을 것입니다. 배포판에는 많은 제한 옵션에 대한 문서 자료가 포함되어 있습니다.

예를 들어, 다음 코드 라인을 사용하면 이 호스트를 시간 서버로 설정할 수 있습니다.

restrict default notrust nomodify

이 코드 라인은 요청을 받으면 시간 패킷을 보내지만 다른 피어에 동기화시키지는 않는다

는 의미입니다.

 

xntpd는 범용 주소-마스크 기준 제한 목록을 실행합니다.

자세한 내용은 xntpd에 관한 매뉴얼 페이지를 참조하십시오.

 

------------------- ntp.server 파일 해석 끝 -----------------------------

 

 

 

 

 

4. NTP Client Configuration

____________________________

 

# cd /etc/inet

# cp ntp.client ntp.conf

# /etc/init.d/xntpd stop

# /etc/init.d/xntpd start

 

 

 

 

 

5. NTP Practice

___________________

 

NTP Server : 172.16.8.254

NTP Client : 172.16.8.202

 

(NTP Server)

# cd /etc/inet

# cp ntp.server ntp.conf 

# vi ntp.conf

.....

server 210.98.16.100 prefer  (210.98.16.100 -> time.kriss.re.kr)

.....

# touch /var/ntp/ntp.drift

# /etc/init.d/xntpd stop

# /etc/init.d/xntpd start

 

TERM1)

# tail -f /var/adm/messages

TERM2)

# snoop -d hme0 | grep -i ntp

 

 

(NTP Client)

# cd /etc/inet

# cp ntp.client ntp.conf

# /etc/init.d/xntpd stop

# /etc/init.d/xntpd start

 

TERM1)

# tail -f /var/adm/messages

TERM2)

# snoop -d hme0 | grep -i ntp

 

(NTP Client) Time Changes

Manually set your NTP client systems time 30 seconds back. Do not

set your systems clock more than an one minute out because the

xntpd process requests manual intervention for large time changes.

 

# date              (current time :  21:20 15)

# date 11022120     (current time :  21:20 00)

....(1~2분후에)....

# date

# rsh 172.16.8.XXX date (NTP Server IP)

 

 

 

 

 

6. Reference

_____________________

 

[NTP Server Configuration File]

 

server 127.127.1.0 prefer     The IP address of the preferred NTP server. In this

                              case, the loopback address is used, indicating the

                              use of a local undisciplined clock. The server

                              keyword indicates an IP address of an NTP server

                              from which time will be received. If the system

                              happens to be a stratum-1, then you use X in the

                              127.127.X.0 syntax to identify a reference clock

                              source. If the server is a stratum-2 (or higher), this

                              entry would be an IP address of another NTP

                              server to contact for time information. The prefer

                              keyword means that if multiple systems of the

                              same strata are used to getting clock information,

                              a preferred server is the one that will always be

                              used when performing calculations.

 

fudge 127.127.1.0 stratum 0   The fudge entry is available to change (fudge) the

                                                             stratum that the server advertises.

 

broadcast 224.0.1.1 ttl 4             The address the server uses to advertise to the

                                                             network along with the time-to-live (TTL) value to

                                                             use in the IP datagrams.

 

enable auth monitor                   The configuration entry that enables

                                                             authentication and the monitoring facility.

 

 

driftfile /var/ntp/ntp.drift  The location of the drift file.

 

statsdir /var/ntp/ntpstats/   The location of NTP statistics.

 

keys /etc/inet/ntp.keys               The conventional name of the key file used for

                                                             authentication.

 

trustedkey 0                                 The encryption identifier. (Refer to RFC 1305 for

                                                             more information.)                   

 

controlkey 0                                 The key identifier. (Refer to RFC 1305 for more

                                                             information.)

 

 

 

 

 

6. 참고 사이트

 

[1] http://www.ntp.org

[2] http://www.kipt.co.kr/index.php?doc=bbs/gnuboard.php&bo_table=pds&page=1&wr_id=24

2008. 9. 4. 18:18

DHCP(Dynamic Host Configuration Protocol) Server

 

 

 

               DHCP(Dynamic Host Configuration Protocol) Server

 

 

 

 

- Private Addr, DHCP

- IPv6

IP 부족 현상에 대한 보상책

ㅁ 사설 IP(Private Addr.)

DHCP

IPv6

 

DHCP

IP 부족 현상으로 효율적인 IP 할당을 위해서 사용되었지만 현재는 IP의 효율적 관리를 위해서 주로 쓰인다.

 

 

1. DHCP Overview

___________________

 

DHCP enables you to provide network-related information to client systems through

a centrally located server system.

 

DHCP evolved from the bootstrap protocol(BOOTP). DHCP provides the following

enhanced functionality:

 

(1). Network Configuration for client        //information for client

- IP Address

- Boot Server IP Adress

- DNS Server, router, NTP Server's IP Address

 

(2). Lease Periods     // 사용 기간

(3). Routers can be configured to act as a BOOTP relay agent.

(4). Support is available for clients that need to boot over a network, effectively

     replacing the need for using the Reverse Address Resolution Protocol (RARP)

     and the bootparams file.

 

 

[참고] DHCP (Dynamic Host Configuration Protocol)

 

DHCP[디에이치씨피] 네트웍 관리자들이 조직 내의 네트웍 상에서 IP 주소를 중앙에서

관리하고 할당해줄 수 있도록 해주는 프로토콜이다. 인터넷의 TCP/IP 프로토콜에서는, 각

컴퓨터들이 고유한 IP 주소를 가져야만 인터넷에 접속할 수 있다. 조직에서 컴퓨터 사용

자들이 인터넷에 접속할 때, IP 주소는 각 컴퓨터에 반드시 할당되어야만 한다. DHCP를

사용하지 않는 경우에는, 각 컴퓨터마다 IP 주소가 수작업으로 입력되어야만 하며, 만약

컴퓨터가 네트웍의 다른 부분에 속한 장소로 이동되면 IP 주소를 새로이 입력해야 한다.

DHCP는 네트웍 관리자가 중앙에서 IP 주소를 관리하고 할당하며, 컴퓨터가 네트웍의 다른

장소에 접속되었을 때 자동으로 새로운 IP 주소를 보내줄 수 있게 해준다.

 

DHCP는 주어진 IP 주소가 일정한 시간동안만 그 컴퓨터에 유효하도록 하는 "임대" 개념을

사용한다. 임대시간은 사용자가 특정한 장소에서 얼마나 오랫동안 인터넷 접속이 필요할

것인지에 따라 달라질 수 있다. DHCP는 사용자들이 자주 바뀌는 학교와 같은 환경에서

특히 유용하다. DHCP는 사용 가능한 IP 주소의 개수보다 더 많은 컴퓨터가 있는 경우에도

IP 주소의 임대시간을 짧게 함으로써 네트웍을 동적으로 재구성할 수 있다.

 

DHCP는 영구적인 IP 주소를 필요로 하는 웹서버에 대해서는 정적인 주소를 제공한다.

 

DHCP는 네트웍 IP 관리 프로토콜인 BOOTP의 대안으로 사용된다. DHCP가 더욱 진보된 프로

토콜이지만, 두 개의 프로토콜 모두 일반적으로 사용된다. 어떤 조직에서는 두 개의 프로

토콜 모두를 사용하지만, 동일한 조직에서 그것을 언제, 어떻게 사용할지를 이해하는 것이

무엇보다 중요하다. 윈도우NT와 같은 몇몇 운영체계에는 DHCP 서버가 딸려 나온다. DHCP

또는 BOOTP 클라이언트는 네트웍이 구성될 수 있도록 각 컴퓨터에 위치하는 프로그램이다.

 

 

[참고] BOOTP (Bootstrap Protocol, 초기 적재 통신 규약)

 

BOOTP는 네트웍 사용자가 자동으로 구성되고(IP 주소를 받게), 사용자의 간여 없이도 부

트되는 운영체계를 가지고 있게 해주는 프로토콜이다. X 터미널 등과 같이 하드디스크를

갖지 않은 장치의 설정 정보를 자동적으로 할당, 관리하기 위해서 개발되었다. 네트웍 관

리자에 의해 관리되는 BOOTP 서버는, 일정 시간동안 IP 주소를 자동으로 할당한다.

 

BOOTP는 좀더 진보된 네트웍 관리 프로토콜인 DHCP의 기반이 된다. BOOTP는 공식적으로는

RFC 951에 설명되어 있다.

 

 

 

 

 

2. DHCP Process Principle

______________________________

 

 

 

(1). DHCP Server & DHCP Client Process

 

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

    |                             |

DHCP Server                   DHCP Client

 

 

<DHCP Server>             <DHCP Client>

in.dhcpd(67)               dhcpagent(68)

     |       DHCPDISCOVER        |

     | <-----------------------  |

     |                           |

     |     <-ARP request->       |

     |                           |

     |       DHCPOFFER           |

     |  -----------------------> |

     |       DHCPREQUEST         |

     |  <----------------------- |

     |       DHCPACK             |

     |  -----------------------> |

     |                           |

 

[참고] VMWare DHCP Server 동작시 IP 할당

 

DHCP 클라이언트가 부팅할때 DHCP 서버와 연동하는 동작과정을 살펴보면 다음과 같다.

(a). DHCP 클라이언트는 부팅하면서 현재 네트워크 안에 DHCP 서버가 있는지를 찾기 위해

     DHCPDISCOVER 메시지를 같은 서브넷에 있는 모든 시스템으로 브로드캐스트한다.

(b). DHCP 클라이언트로 부터 메시지를 받은 서버에서는 ARP 브로드캐스팅을 통해서 클라

     이언트에 제공할 IP주소를 선택한 후 네트워크 서비스 정보를 담은 DHCPOFFER 메시지

     를 전송한다.

(c). 서버로 부터 DHCPOFFER 메시지를 받은 클라이언트는 메시지에 포함되어 있는 IP 주소

     와 서비스 정보를 이용하여 네트워크 설정을 한 후, DHCP 서버에 사용 의사를 알리는

     DHCPREQUEST 메시지를 보내게 된다.

(d). DHCPREQUEST 메시지를 수신한 서버는 DHCPACK 메시지를 통해 사용 허가를 해주게 되

     고, 클라이언트는 ping 명령어를 이용하여 현재 할당받은 IP 주소를 이미 사용하고

     있는 다른 시스템이 있는지 확인한 후에 네트워크 설정을 마무리하게 된다.

 

 

 

(2). DHCP Server & BOOTP Relay & DHCP Client

 

DHCP Server ------------ Router--------------------

                                  |            |

                             BOOTP Relay  DHCP Client

                             Server

 

 

<DHCP Server>         <BOOTP Relay>          <DHCP Client>

     |                      |     DHCPDISCOVER     |

     |                      | <------------------- |

     |    DHCPDISCOVER      |                      |

     | <------------------- |                      |

     |    DHCPOFFER         |                      |

     | -------------------> | -------------------> |

     |                      |     DHCPREQUEST      |

     | <------------------- | <------------------- |

     |    DHCPACK           |                      |

     | -------------------> | -------------------> |

     |                      |                      |

 

[참고] 일반 가정에서의 DHCP 서버가 존재하지 않은 이유

 

DHCP 서버에 BOOT Relay 서버가 존재하는 경우에 동작 방식도 없는 경우와 흡사하게 동작

한다. 중간에 BOOT Relay 서버가 DHCP 서버의 역할을 중계하게 된다.

 

 

 

 

 

3. DHCP Server/Client Function

__________________________________

 

(1). DHCP Client Function

 

- Sufficient information to properly configure the network interface

        - IP Address

        - Netmask

 

- Parameters needed by system-level and application-level software

        - Boot Server Information

        - Router Address

        - Configuration Server

 

 

(2). dhcpagent process

- Constructs and sends packets

- Listens for responses from servers

- Caches the configuration information received

- Releases or renews leases

- Configures the interfaces with sufficient information to enable

  communications with the network through the interface

 

 

(3). DHCP Server Function

 

- Corresponding Information Sending

- "2. DHCP Process Principle Reference"

 

 

 

 

 

4. DHCP Startup Script

___________________________

 

부팅시에 /etc/rd3.d/S34dhcp 시작스크립트에 의해서 in.dhcpd 데몬이 뜨게 된다. 이 경우

/etc/inet/dhcpsvc.conf 설정파일이 있어야만 in.dhcpd 데몬이 뜨게 된다.

 

- /etc/init.d/dhcp stop/start      (in.dhcpd)

- /etc/init.d/dhcpagent stop/start (dhcpagent)

 

 

 

 

 

5. DHCP Client Configuration

________________________________

 

 

# man ifconfig

.....

     dhcp  This option is an alias for option auto-dhcp

 

     auto-dhcp

           Use DHCP to automatically acquire an address for  this

           interface.  This  option  has  a completely equivalent

           alias called dhcp.

 

           primary

                 Defines the interface as the primary. The inter-

                 face  is  defined  as  the preferred one for the

                 delivery of client-wide configuration data. Only

                 one  interface  can  be the primary at any given

                 time.  If  another  interface  is   subsequently

                 selected  as the primary, it replaces the previ-

                 ous one. Nominating an interface as the  primary

                 one  will  not  have  much significance once the

                 client work station has booted, as many applica-

                 tions will already have started and been config-

                 ured with data read from  the  previous  primary

                 interface.

 

           drop  Remove the specified interface  from  DHCP  con-

                 trol.  Additionally,  set the IP address to zero

                 and mark the interface as "down".

 

           extend

                 Attempt to extend the lease on  the  interface's

                 IPv4 address. This is not required, as the agent

                 will automatically extend the lease well  before

                 it expires

 

           inform

                 Obtain  network  configuration  parameters  from

                 DHCP without obtaining a lease on an IP address.

                 This is useful in situations where an IP address

                 is obtained through mechanisms other than DHCP.

 

           ping  Check whether the interface given is under  DHCP

                 control,  which  means  that  the  interface  is

                 managed by the DHCP agent and is  working  prop-

                 erly.  An  exit  status of 0 means success. This

                 subcommand has no meaning when the named  inter-

                 face represents more than one interface.

 

           release

                 Relinquish the IPv4 address  on  the  interface,

                 and mark the interface as "down."

 

           start Start DHCP on the interface.

 

           status

                 Display the DHCP  configuration  status  of  the

                 interface.

 

DHCP 클라이언트를 설정하는 방법은 (a)ifconfig 명령어를 사용하여 현재 수행하는 방법

과 (b)/etc/dhcp.XXn 파일을 사용하여 부팅시에 적정되도록 할 수 있다. /etc/dhcp.XXn

파일의 내용은 필요가 없다. 파일의 이름만 존재하면 된다.

 

(1). DHCP 클라이언트 현재 설정

Current Setting

# ifconfig hme0 dhcp

 

 

(2). DHCP 클라이언트 부팅시에 적용 설정

Configuration at Boot

# touch /etc/dhcp.hme0 (/etc/hostname.hme0)

# reboot

 

[참고] ifconfig hme0 dhcp CMD

# ifconfig hme0 dhcp start

# ifconfig hme0 dhcp inform

# ifconfig hme0 dhcp extend

# ifconfig hme0 dhcp release (> ipconfig /renew, # ifconfig hme0 dhcp)

# ifconfig hme0 dhcp drop (/etc/dhcp/hme0.dhc)

# ifconfig hme0 dhcp status

 

(ifconfig hme0 dhcp start)

# ifconfig pcn0 dhcp

# ifconfig pcn0 dhcp start

 

(ifconfig hme0 dhcp inform)

Obtain  network  configuration  parameters  from

DHCP without obtaining a lease on an IP address.

This is useful in situations where an IP address

is obtained through mechanisms other than DHCP.

 

(ifconfig hme0 dhcp extend)

Attempt to extend the lease on  the  interface's

IPv4 address. This is not required, as the agent

will automatically extend the lease well  before

it expires

 

<DHCP Server>             <DHCP Client>

in.dhcpd(67)               dhcpagent(68)

     |                           |

     |    IP(Lease Time:5)     |

     | ----------------------->  | ---

     |                           |  A

     |                           |  |

     |         Extend            |  | 5

     | <-----------------------  |  |  ---

     |                           |  V   A

     |                           | ---  |

     |                           |      | 5

     |                           |      |

     |                           |      V

     |                           |     ---

     |                           |

 

(ifconfig hme0 dhcp release)

c:\> ipconfig /renew

# ifconfig pcn0 dhcp release

# ifconfig pcn0 dhcp start

 

(ifconfig hme0 dhcp drop)

# ifconfig pcn0 dhcp drop

   (현재 IP 설정) ------> /etc/dhcp/hme0.dhc (현재 IP 설정)

 

DHCP Client 부팅 -----> DHCP Server IP 정보 받지 않음

                        /etc/dhcp/hme0.dhc 파일의 설정을 통해 설정

 

(ifconfig hme0 dhcp status)

# ifconfig pcn0 dhcp status

 

 

 

 

 

6. DHCP Server

____________________

 

DHCP 서버가 제공해 주는 정보는 크게 2가지로 구분할 수 있다. (a)IP에 관련한 정보나

(b)시스템 레벨이나 프로그램 레벨에서 필요한 부가적인 인자 값들이다.

 

- IP에 관련한 설정 정보 (/var/dhcp/dhcp_network)

- 부가적인 설정 정보    (/var/dhcp/dhcptab)

 

 

(1). DHCP Server Database File

- dhcp_network(Network Number, IP)           // ip와 대역

- dhcptab(Macro, Symbol)                             //부가정보

 

 

 

(2). DHCP Configuration Tools

- dhcpconfig (CLI)

       Solaris 8 버전의 , Solaris 9 버전의 - 설정 방법 다름

- dhcpmgr (GUI)

- pntadm, dhtadm(CLI)

 

[참고] pntadm / dhtadm

pntadm (p:dhcp, nt:network)-> /var/dhcp/dhcp_network

dhtadm (dht:dhcptab       )-> /var/dhcp/dhcptab

 

 

[참고] DHCP Server Unconfiguration

# /etc/init.d/dhcp stop

# dhcpconfig -U -x -h (매뉴얼 페이지 참조, dhcpconfig(1))

 

 

[참고] 현재 설정 확인

# ls -ld /var/dhcp

[ ]  /var/dhcp 디렉토리가 존재하는가?

[ ]  dhcp_network, dhcptab 파일이 존재하는가?

 

 

 

(3). DHCP Server Setting

 

# dhcpmgr &

or

# /usr/sadm/admin/bin/dhcpmgr &

 

- Network Address Admin(pcn0: 172.16.8.1XX)

- Network Address Admin(pcn1: 192.168.10.1XX)

- Network Virtual Interface Add

      /etc/hosts

      /etc/hostname.hme0:1

      /etc/netmasks

 

 

(아이피 할당 )

 

IP 대역 : 172.16.8.XXX ~ 172.16.8.YYY

 

---------

XXX   YYY

---------

100 ~ 104

105 ~ 109

110 ~ 114

115 ~ 119

120 ~ 124

125 ~ 129

130 ~ 134

135 ~ 139

140 ~ 144

145 ~ 149

150 ~ 154

155 ~ 159

160 ~ 164

165 ~ 169

170 ~ 174

175 ~ 179

180 ~ 184

185 ~ 189

190 ~ 195

---------

 

 

DHCP 서버 설정

# dhcpmgr &

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

서버 설정                                                                    [x] Conigure as DHCP server

 

DHCP Configuration Wizard

        Select data storage format                   [x] Text files

        Configure Data store                                 Path: /var/dhcp(기본값)

        Select hosts nameservice                             /etc/hosts

        Specify lease policy                                 Length of Lease [1] days(기본값)

        Specify DNS domain and servers        DNS Domain: [example.com]

        Specify network address and                  Network Address: [172.16.0.0] (기본값)

               subnetmask                                                   Subnet Mask: [255.255.0.0] (기본값)

        Specify network type and router              Network Type: Local-Area (기본값)

                                                                                   Routing: Use router: 172.16.0.1

        Specify NIS domain and servers        <Next>

        Specify NIS+ domain and servers              <Next>

 

Address Wizard

        Specify the number of IP addresses    Number of IP Addresses: [5]

                                                                                   Commnet: [DHCP Test]

        Specify the server and starting              Managed by Server: [solarisXXX]

               IP address                                                   Starting IP Address: [172.16.8.1XX]

                                                                                   [x] Generate Client Names

                                                                                           Root Name: solarisXXX

        Confirm the IP address list                  <Next>

        Enter client configuration                    <Next>

               information

        Select the lease type                                Lease Type: [x] Dynamic (기본값)

        Review                                                              <Finish>

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

 

 

 

(4). DHCP Configuration Files

 

Compare to dhcpmgr DB &  /var/dhcp/DB

 

 

 

 

 

7. DHCP Server & Client Practice

___________________________________

 

 

[EX1] DHCP Server / Client Packet Capturing

(1). DHCP Server Configuration

(2). DHCP Client Configuration

 

(DHCP Server)

# /usr/sadm/admin/bin/dhcpmgr &

 

# snoop -d hme0 -o /test/dhcp.pkt

 

(DHCP Client)

# ifconfig hme0 dhcp

# ifconfig -a

 

(DHCP Server)

# snoop -i /tmp/dhcp.pkt | more

# snoop -i /tmp/dhcp.pkt -v > /tmp/dhcp.txt (패킷을 선택한다.)

# vi /tmp/dhcp.txt

 

 

DHCP Server / Client Packet Analyze

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

ETHER:  ----- Ether Header -----

ETHER:

ETHER:  Packet 133 arrived at 15:56:10.37

ETHER:  Packet size = 342 bytes

ETHER:  Destination = ff:ff:ff:ff:ff:ff, (broadcast)

ETHER:  Source      = 0:c:29:4e:dd:b7,

ETHER:  Ethertype = 0800 (IP)

ETHER:

IP:   ----- IP Header -----

IP:

IP:   Version = 4

IP:   Header length = 20 bytes

IP:   Type of service = 0x00

IP:         xxx. .... = 0 (precedence)

IP:         ...0 .... = normal delay

IP:         .... 0... = normal throughput

IP:         .... .0.. = normal reliability

IP:         .... ..0. = not ECN capable transport

IP:         .... ...0 = no ECN congestion experienced

IP:   Total length = 328 bytes

IP:   Identification = 6

IP:   Flags = 0x4

IP:         .1.. .... = do not fragment

IP:         ..0. .... = last fragment

IP:   Fragment offset = 0 bytes

IP:   Time to live = 255 seconds/hops

IP:   Protocol = 17 (UDP)

IP:   Header checksum = 7a9f

IP:   Source address = 0.0.0.0, OLD-BROADCAST

IP:   Destination address = 255.255.255.255, BROADCAST

IP:   No options

IP:

UDP:  ----- UDP Header -----

UDP:

UDP:  Source port = 68

UDP:  Destination port = 67 (BOOTPS)

UDP:  Length = 308

UDP:  Checksum = 4EE4

UDP:

DHCP: ----- Dynamic Host Configuration Protocol -----

DHCP:

DHCP: Hardware address type (htype) =  1 (Ethernet (10Mb))

DHCP: Hardware address length (hlen) = 6 octets

DHCP: Relay agent hops = 0

DHCP: Transaction ID = 0x3953c664

DHCP: Time since boot = 0 seconds

DHCP: Flags = 0x0000

DHCP: Client address (ciaddr) = 0.0.0.0

DHCP: Your client address (yiaddr) = 0.0.0.0

DHCP: Next server address (siaddr) = 0.0.0.0

DHCP: Relay agent address (giaddr) = 0.0.0.0

DHCP: Client hardware address (chaddr) = 00:0C:29:4E:DD:B7

DHCP:

DHCP: ----- (Options) field options -----

DHCP:

DHCP: Message type = DHCPDISCOVER

DHCP: Maximum DHCP Message Size = 1472 bytes

DHCP: IP Address Lease Time = -1 seconds

DHCP: Client Class Identifier = "SUNW.i86pc"

DHCP: Requested Options:

DHCP:    1 (Subnet Mask)

DHCP:    3 (Router)

DHCP:   12 (Client Hostname)

DHCP:   43 (Vendor Specific Options)

 

ETHER:  ----- Ether Header -----

ETHER:

ETHER:  Packet 148 arrived at 15:56:11.39

ETHER:  Packet size = 371 bytes

ETHER:  Destination = 0:c:29:4e:dd:b7,

ETHER:  Source      = 0:c:29:4a:b2:cd,

ETHER:  Ethertype = 0800 (IP)

ETHER:

IP:   ----- IP Header -----

IP:

IP:   Version = 4

IP:   Header length = 20 bytes

IP:   Type of service = 0x00

IP:         xxx. .... = 0 (precedence)

IP:         ...0 .... = normal delay

IP:         .... 0... = normal throughput

IP:         .... .0.. = normal reliability

IP:         .... ..0. = not ECN capable transport

IP:         .... ...0 = no ECN congestion experienced

IP:   Total length = 357 bytes

IP:   Identification = 18293

IP:   Flags = 0x4

IP:         .1.. .... = do not fragment

IP:         ..0. .... = last fragment

IP:   Fragment offset = 0 bytes

IP:   Time to live = 255 seconds/hops

IP:   Protocol = 17 (UDP)

IP:   Header checksum = 9c5a

IP:   Source address = 192.168.10.250, nic2

IP:   Destination address = 192.168.10.109, solaris254-109

IP:   No options

IP:

UDP:  ----- UDP Header -----

UDP:

UDP:  Source port = 67

UDP:  Destination port = 68 (BOOTPC)

UDP:  Length = 337

UDP:  Checksum = 5EE8

UDP:

DHCP: ----- Dynamic Host Configuration Protocol -----

DHCP:

DHCP: Hardware address type (htype) =  1 (Ethernet (10Mb))

DHCP: Hardware address length (hlen) = 6 octets

DHCP: Relay agent hops = 0

DHCP: Transaction ID = 0x3953c664

DHCP: Time since boot = 0 seconds

DHCP: Flags = 0x0000

DHCP: Client address (ciaddr) = 0.0.0.0

DHCP: Your client address (yiaddr) = 192.168.10.109

DHCP: Next server address (siaddr) = 0.0.0.0

DHCP: Relay agent address (giaddr) = 0.0.0.0

DHCP: Client hardware address (chaddr) = 00:0C:29:4E:DD:B7

DHCP:

DHCP: ----- (Options) field options -----

DHCP:

DHCP: Message type = DHCPOFFER

DHCP: DHCP Server Identifier = 192.168.10.250

DHCP: UTC Time Offset = 32400 seconds

DHCP: RFC868 Time Servers at = 172.16.8.254

DHCP: IP Address Lease Time = 86400 seconds

DHCP: DNS Domain Name = example.com

DHCP: DNS Servers at = 172.16.8.254

DHCP: DNS Servers at = 172.16.8.252

DHCP: DNS Servers at = 168.126.63.1

DHCP: Broadcast Address = 192.168.10.255

DHCP: Router at = 192.168.10.2

DHCP: Subnet Mask = 255.255.255.0

DHCP: Client Hostname = solaris254-109

 

ETHER:  ----- Ether Header -----

ETHER:

ETHER:  Packet 163 arrived at 15:56:13.37

ETHER:  Packet size = 342 bytes

ETHER:  Destination = ff:ff:ff:ff:ff:ff, (broadcast)

ETHER:  Source      = 0:c:29:4e:dd:b7,

ETHER:  Ethertype = 0800 (IP)

ETHER:

IP:   ----- IP Header -----

IP:

IP:   Version = 4

IP:   Header length = 20 bytes

IP:   Type of service = 0x00

IP:         xxx. .... = 0 (precedence)

IP:         ...0 .... = normal delay

IP:         .... 0... = normal throughput

IP:         .... .0.. = normal reliability

IP:         .... ..0. = not ECN capable transport

IP:         .... ...0 = no ECN congestion experienced

IP:   Total length = 328 bytes

IP:   Identification = 7

IP:   Flags = 0x4

IP:         .1.. .... = do not fragment

IP:         ..0. .... = last fragment

IP:   Fragment offset = 0 bytes

IP:   Time to live = 255 seconds/hops

IP:   Protocol = 17 (UDP)

IP:   Header checksum = 7a9e

IP:   Source address = 0.0.0.0, OLD-BROADCAST

IP:   Destination address = 255.255.255.255, BROADCAST

IP:   No options

IP:

UDP:  ----- UDP Header -----

UDP:

UDP:  Source port = 68

UDP:  Destination port = 67 (BOOTPS)

UDP:  Length = 308

UDP:  Checksum = 20EF

UDP:

DHCP: ----- Dynamic Host Configuration Protocol -----

DHCP:

DHCP: Hardware address type (htype) =  1 (Ethernet (10Mb))

DHCP: Hardware address length (hlen) = 6 octets

DHCP: Relay agent hops = 0

DHCP: Transaction ID = 0x9aa14ebb

DHCP: Time since boot = 0 seconds

DHCP: Flags = 0x0000

DHCP: Client address (ciaddr) = 0.0.0.0

DHCP: Your client address (yiaddr) = 0.0.0.0

DHCP: Next server address (siaddr) = 0.0.0.0

DHCP: Relay agent address (giaddr) = 0.0.0.0

DHCP: Client hardware address (chaddr) = 00:0C:29:4E:DD:B7

DHCP:

DHCP: ----- (Options) field options -----

DHCP:

DHCP: Message type = DHCPREQUEST

DHCP: IP Address Lease Time = 86400 seconds

DHCP: Maximum DHCP Message Size = 1472 bytes

DHCP: Requested IP Address = 192.168.10.109

DHCP: DHCP Server Identifier = 192.168.10.250

DHCP: Client Class Identifier = "SUNW.i86pc"

DHCP: Requested Options:

DHCP:    1 (Subnet Mask)

DHCP:    3 (Router)

DHCP:   12 (Client Hostname)

DHCP:   43 (Vendor Specific Options)

 

ETHER:  ----- Ether Header -----

ETHER:

ETHER:  Packet 165 arrived at 15:56:13.38

ETHER:  Packet size = 371 bytes

ETHER:  Destination = 0:c:29:4e:dd:b7,

ETHER:  Source      = 0:c:29:4a:b2:cd,

ETHER:  Ethertype = 0800 (IP)

ETHER:

IP:   ----- IP Header -----

IP:

IP:   Version = 4

IP:   Header length = 20 bytes

IP:   Type of service = 0x00

IP:         xxx. .... = 0 (precedence)

IP:         ...0 .... = normal delay

IP:         .... 0... = normal throughput

IP:         .... .0.. = normal reliability

IP:         .... ..0. = not ECN capable transport

IP:         .... ...0 = no ECN congestion experienced

IP:   Total length = 357 bytes

IP:   Identification = 20283

IP:   Flags = 0x4

IP:         .1.. .... = do not fragment

IP:         ..0. .... = last fragment

IP:   Fragment offset = 0 bytes

IP:   Time to live = 255 seconds/hops

IP:   Protocol = 17 (UDP)

IP:   Header checksum = 9494

IP:   Source address = 192.168.10.250, nic2

IP:   Destination address = 192.168.10.109, solaris254-109

IP:   No options

IP:

UDP:  ----- UDP Header -----

UDP:

UDP:  Source port = 67

UDP:  Destination port = 68 (BOOTPC)

UDP:  Length = 337

UDP:  Checksum = 7243

UDP:

DHCP: ----- Dynamic Host Configuration Protocol -----

DHCP:

DHCP: Hardware address type (htype) =  1 (Ethernet (10Mb))

DHCP: Hardware address length (hlen) = 6 octets

DHCP: Relay agent hops = 0

DHCP: Transaction ID = 0x9aa14ebb

DHCP: Time since boot = 0 seconds

DHCP: Flags = 0x0000

DHCP: Client address (ciaddr) = 0.0.0.0

DHCP: Your client address (yiaddr) = 192.168.10.109

DHCP: Next server address (siaddr) = 0.0.0.0

DHCP: Relay agent address (giaddr) = 0.0.0.0

DHCP: Client hardware address (chaddr) = 00:0C:29:4E:DD:B7

DHCP:

DHCP: ----- (Options) field options -----

DHCP:

DHCP: Message type = DHCPACK

DHCP: DHCP Server Identifier = 192.168.10.250

DHCP: UTC Time Offset = 32400 seconds

DHCP: RFC868 Time Servers at = 172.16.8.254

DHCP: IP Address Lease Time = 86400 seconds

DHCP: DNS Domain Name = example.com

DHCP: DNS Servers at = 172.16.8.254

DHCP: DNS Servers at = 172.16.8.252

DHCP: DNS Servers at = 168.126.63.1

DHCP: Broadcast Address = 192.168.10.255

DHCP: Router at = 192.168.10.2

DHCP: Subnet Mask = 255.255.255.0

DHCP: Client Hostname = solaris254-109

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

 

 

 

 

 

 

[EX2] NIC 추가

 

새로운 NIC를 추가하지 않고 가상 NIC를 구성하여 192.168.8.XXX으로 추가하여 작업 하는

것으로 가정한다.(부팅시의 작업에 대해서는 정의하지 않고 현재 작업으로만 설정한다.)

 

(1). Virtual NIC 추가

# ifconfig -a          

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 172.16.8.254 netmask ffff0000 broadcast 172.16.255.255

        ether 0:c:29:18:75:5e

 

# ifconfig pcn0:1 plumb up

# ifconfig pcn0:1 192.168.8.254 netmask 255.255.255.0 broadcast +

 

 

(2). DHCP Manager 설정

# /usr/sadm/admin/bin/dhcpmgr &

 

(a). EDIT

(b). Network Wizard

     - Network Address : 192.168.8.0

     - Netmask         : 255.255.255.0

    

     - Network Type    : LAN

     - Routing         : Use router (192.168.8.XXX)

 

     - NIC Domain      : Next(Skip)

     - NIC+ Domain     : Next(Skip)

 

     - Verification    : Finish

(c). Address Wizard

     - Number of IP Addresses : 10

    

     - Starting IP Address    : 192.168.8.100

     - Generate Client Hostnames : Check

     - Next > Next > Next > Finish

 

 

 

 

 

8. pntadm, dhtadm 명령어를 사용한 DHCP 서버 관리

_________________________________________________

 

pntadm (p:dhcp, nt:network)-> /var/dhcp/dhcp_network

dhtadm (dht:dhcptab       )-> /var/dhcp/dhcptab

 

서버의 설정이 있다면 삭제하고 다시 설정 해야 한다.

 

# dhcpconfig -U -x -h

 

2008. 9. 2. 18:55

DNS Server Management

 

 

 

                DNS Server Management

 

 

 

 

 

[참고] 실무에서 많이 사용되고 있는 서비스

-> DNS, FTP, MAIL, WEB(WAS), DB Server

 

 

 

1. DNS 서버 설정 파일들

 

/etc/named.conf                DNS Configuration File

 

/var/named/exampleXXX.zone     DNS Forward Lookup Zone File

/var/named/exampleXXX.rev      DNS Reverse Loookup Zone File

/var/named/localhost.rev       DNS Localhost Reverse Lookup Zone File

/var/named/named.root          DNS Root Domain Lookup File

 

/etc/nsswitch.conf             Name Service Switching Configuration File

/etc/resolv.conf               DNS Client Resolver File     

 

 

 

(1). /etc/named.conf 파일 해석

 

/etc/named.conf 파일을 in.named 데몬이 읽어 들이는 DNS 서버의 주 설정 파일이다.

 

BIND 8.X 이후 버전에서는 이전의 버전에 비해 새로운 설정 파일을 사용한다.

■ 이전 설정 파일  : /etc/named.boot (BIND 4.x)

■ 새로운 설정 파일: /etc/named.conf (BIND 8.x, BIND 9.x)

 

BIND 4.9.x 버전의 /etc/named.boot 파일을 /etc/named.conf 파일로 변환하기 위해서는

/usr/sbin/named-bootconf 스크립트를 사용하면 된다.

 

/etc/named.conf 파일에서 사용되는 것은 다음과 같다.

- Root Server가 등록되어진 파일 위치 지정

- Primary / Secondary / Caching-Only Server 지정 및 DB 파일 지정

- DNS 서버의 zones of Authority 지정

- 서버용 파일들의 위치 지정

- 도메인에 대한 보안 설정

- 로그 기록 정의 지정

- zone 옵션 지정

 

 

# cat /etc/named.conf

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

options {

    directory "/var/named";

    allow-transfer { 172.16.8.154; 172.16.7.154; };//마스터와 슬레이브와의 관계

    allow-query    { 172.16.8.0/16; };//나에게 쿼리를 날릴 수 있는 대역 지정

};

 

acl "nets" {

    { 172.16.0.0/16; 172.15.0.0/16; };

};

 

zone "." IN {

    type hint;

    file "named.root";

};

 

zone "localhost" IN {

    type master;

    file "localhost.zone";

};

 

zone "0.0.127.in-addr.arpa" IN {

    type master;

    file "localhost.rev";

};

 

zone "example.com" IN {

    type master;

    file "example.zone";

    allow-transfer { 172.16.8.154; };

    allow-query    { "nets"; };

};

 

zone "8.16.172.in-addr.arpa" IN {

    type master;

    file "example.rev";

};

 

zone "daum.net" IN {

    type master;

    file "db1/daum.zone";

};

 

zone "7.16.172.in-addr.arpa" IN {

    type master;

    file "db/daum.rev";

};

zone "daum.net" IN {

    type slave;

masters { 172.16.8.254;};

    file "db1/daum.zone";

};

 

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

 

zone block 에 정의된 것을 순서대로 나열하면 다음과 같다.

- Hint Server(캐쉬 네임서버 지정)

- Reverse Localhost(로컬네트워크 리버스 도메인 지정)

- Forward Primary Name Server(네임서버가 위치하는 곳의 포워드 도메인 지정)

- Reverse Primary Name Server(네임서버가 위치하는 곳의 리버스 도메인 지정)

 

 

 

(1-1). 각 도메인 설정 파일들의 위치 지정

 

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

options {

    directory "/var/named";

};

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

 

각 도메인의 설정파일들이 위치할 디렉토리를 정의한다. 보통 /var/named 디렉토리를 많이

지정한다. 하지만 보안상의 이유로 기본 위치를 지정하지 않고 /named와 같이 다른 디렉토

리를 지정하는 경우도 많다. 이 경우의 대부분은 chroot 환경을 구성하는 경우이다.

 

이 파일의 전반적인 부분에서 "file" 다음에 나오는 모든 파일은 /var/named 디렉토리 하

위에 존재하게 된다. 경우에 따라서 다음과 같이 지정하는 경우도 존재한다.

 

zone "example254.com" IN {

           type master;

           file "zone1/example254.zone";

};

 

위와 같은 경우 포워드 존 파일의 위치는 /var/named/zone1/example254.zone 파일이 된다.

여러개의 도메인을 관리하는 도메인 위임 서버(웹 호스팅 업체)에서는 위와 같은 경우의

선언이 흔하게 된다.

 

 

[참고] options statemnet, directory element

 

     options

           Controls global server configuration options and  sets

           defaults for other statements.

 

     directory

           The working directory of the server.  Any non-absolute

           pathnames  in  the configuration file will be taken as

           relative to this directory.  The default location  for

           most  server  output files, for example, named.run, is

           this  directory.  If a directory is not specified, the

           working  directory defaults to ".", the directory from

           which the server was started.  The directory specified

           should be an absolute path.

 

 

 

(1-2). ACL 설정

 

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

acl "nets" {

    { 172.16.0.0/16; 172.15.0.0/16; };

};

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

 

allow-transfer, allow-query 같은 지시자를 사용해서 설정할때 사용하기 위한 ACL(Access

Control List) 설정할 사용한다.

 

 

[참고] acl statement allow-transfer element

 

     acl   Defines a named IP address matching list,  for  access

           control and other uses.

 

           allow-transfer

                 Specifies which hosts  are  allowed  to  receive

                 zone  transfers from the server.  allow-transfer

                 may also be specified in the zone statement,  in

                 which  case  it  overrides  the  options  allow-

                 transfer  statement.   If  not  specified,   the

                 default is to allow transfers from all hosts.

 

 

 

(1-3). 캐쉬 네임서버와 로컬네트워크 설정

 

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

 

zone "." IN {

    type hint;

    file "named.root";

};

 

zone "0.0.127.in-addr.arpa" IN {

    type master;

    file "localhost.rev";

};

 

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

 

캐쉬 네임 서버와 로컬 네트워크 설정은 반드시 있어야 하는 부분이다. 캐쉬 네임서버는

자신의 DB 정보(Forward Zone File, Reverse Zone File)이 없는 경우에 참고할 Root Name

Server의 위치를 지정하거나 로컬호스트에 대한 지정을 하는 부분이다.

 

[참고] zone statement, hint / master elements

 

     zone  Defines a zone.

 

     hint  The initial set of  root  name  servers  is  specified

           using  a hint zone. When the server starts up, it uses

           the root hints to find a root name server and get  the

           most recent list of root name servers.

 

   master  The server has a master copy of the data for the  zone

           and  will be able to provide authoritative answers for

           it.

 

 

 

(1-4). 포워드 도메인 / 리버스 도메인 파일 설정

 

Forward / Reverse Lookup Zone Files 설정을 한다. 아래 예제는 example.com 도메인에 대

해서 Master DNS 서버로 동작하고 Forward Lookup Zone 파일은 /var/named/example.zone

파일임을 나타낸다. 또한 "nets" 네트워크에 대해서만 Zone 파일들이 전송할수 있도록 한

정이 되어 있다.(Master Server에서 Slave Server로)

 

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

zone "example.com" IN {

    type master;

    file "example.zone";

    allow-transfer { "nets"; };

    allow-query { "nets"; };

};

 

zone "8.168.192.in-addr.arpa" IN {

    type master;

    file "example.rev";

};

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

 

 

 

(2). /var/named/named.root 파일 해석

 

named.root 파일은 ftp.internic.net 이나 rs.internic.net 사이트에서 FTP 접속하여

을 수 있다. 접속하여 파일을 받을수 있는 디렉토리는 /domain 디렉토리에 존재한다.

 

다음은 ftp.internic.net 사이트에서 받은 named.root 파일의 내용이다.

 

# cat /var/named/named.root

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

.                        3600000  IN  NS    A.ROOT-SERVERS.NET.

A.ROOT-SERVERS.NET.      3600000      A     198.41.0.4

.                        3600000      NS    B.ROOT-SERVERS.NET.

B.ROOT-SERVERS.NET.      3600000      A     192.228.79.201

.                        3600000      NS    C.ROOT-SERVERS.NET.

C.ROOT-SERVERS.NET.      3600000      A     192.33.4.12

.                        3600000      NS    D.ROOT-SERVERS.NET.

D.ROOT-SERVERS.NET.      3600000      A     128.8.10.90

.                        3600000      NS    E.ROOT-SERVERS.NET.

E.ROOT-SERVERS.NET.      3600000      A     192.203.230.10

.                        3600000      NS    F.ROOT-SERVERS.NET.

F.ROOT-SERVERS.NET.      3600000      A     192.5.5.241

.                        3600000      NS    G.ROOT-SERVERS.NET.

G.ROOT-SERVERS.NET.      3600000      A     192.112.36.4

.                        3600000      NS    H.ROOT-SERVERS.NET.

H.ROOT-SERVERS.NET.      3600000      A     128.63.2.53

.                        3600000      NS    I.ROOT-SERVERS.NET.

I.ROOT-SERVERS.NET.      3600000      A     192.36.148.17

.                        3600000      NS    J.ROOT-SERVERS.NET.

J.ROOT-SERVERS.NET.      3600000      A     192.58.128.30

.                        3600000      NS    K.ROOT-SERVERS.NET.

K.ROOT-SERVERS.NET.      3600000      A     193.0.14.129

.                        3600000      NS    L.ROOT-SERVERS.NET.

L.ROOT-SERVERS.NET.      3600000      A     198.32.64.12

.                        3600000      NS    M.ROOT-SERVERS.NET.

M.ROOT-SERVERS.NET.      3600000      A     202.12.27.33

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

 

 

하지만 수업을 위해서 변경이 된 파일을 사용할 것이다. 다음은 변경된 파일이다.

 

# cat /var/named/named.root

.                       86400     IN    NS     ns.example.com.

ns.example.com.         86400     IN     A     172.16.8.254

 

 

 

(3). /var/named/exampleXXX.zone 파일 해석

 

Forward-Domain 파일안에는 호스트 이름을 IP에 맵핑시키는 정보가 주로 설정된다. 이 정

보를 설정하기 위해서는 A Record를 사용한다. 이 외에도 SOA, NS, MX, CNAME 등의 Record

를 지정할 수 있다.

 

다음은 /var/named/exampleXXX.zone 파일을 예제이다.

 

# cat /var/named/exampleXXX.zone

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

$TTL 4

$ORIGIN example.com.   //선언이안되어있다면 /etc/named.conf example.com 이 오리지날

@  IN SOA ns.example.com. root.example.com. (

2007051801 ; serial number

3M         ; refresh time

1M         ; retry time

1W         ; expiry day

1D         ; time to live

)

 

example.com.        IN  NS    ns.example.com.

ns.example.com.     IN  A     172.16.8.254

example.com.        IN  NS    ns2.example.com.

ns2.example.com.    IN  A     172.16.8.154

 

;================================================

; Basic Network

;================================================

www                 IN  A     172.16.8.254

www                 IN  A     172.16.8.253

www                 IN  A     172.16.8.252

 

example.com.        IN  MX 10 mail.example.com.

mail                IN  A     172.16.8.254

example.com.        IN  MX 20 mailhost.example.com.

mailhost            IN  A     172.16.8.254

 

ftp                 IN  A     172.16.8.254

 

cname1              IN  A     172.16.8.253

cname2              IN  CNAME cname1

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

 

 

파일을 해석할 때 필요한 정보들에 대해 자세히 알아 보자.

 

(3-1). DNS Zone Files Entry Format

 

(형식)

[Domain]   [TTL]  CLASS  RecordType  Data

 

* [Domain] 부분이 생략되면 오리지널 도메인이 된다. 오리지널 도메인을 찾는 순서는 다

  음과 같다.

  - zone 파일내의 $ORIGIN 값에 지정된 것

  - /etc/named.conf 파일의 포워드 존의 도메인

 

* [TTL] 부분이 생략된면 $TTL 에 의해 지정된 값이 된다. TTL(Time To Live)가 지정되는

  순서는 다음과 같다.

  - 각 엔트리의 TTL 값에 지정된 것

  - $TTL로 지정된 값

  - SOA 지시자의 TTL 필드의 값

 

* CLASS는 현재 다른 것이 없고 IN(Internet)만 존재한다.

* RecoredType에 따라서 첫번째 필드와 마지막 필드가 결정된다.

 

[EX] 다양한 RecordType의 예

example.com.       IN SOA   ns.example.com. root.example.com (Number .....)

                     SOA domain

example.com.       IN NS    ns.example.com.

                     NS - nameserver

ns.example.com.    IN A     172.16.8.254

                     A - address

www.example.com.   IN A     172.16.8.254   

example.com.       IN MX 10 mail.example.com.

172.16.8.254       IN PTR   ns.example.com.

 

[EX] RecordType TEST

# nslookup -q=NS example.com

# nslookup -q=A ns.example.com

# nslookup -q=MX example.com

# nslookup -q=PTR 172.16.8.254

 

 

(3-2). 주석처리(Comment)

- ;       (Window 주석처리)

- #       (Unix 주석처리)

- /* */   (C 주석처리)

- //      (C++ 주석처리)

 

 

 

(3-3). SOA(Start Of Authority) Record

 

(예) SOA Record Type

@  IN SOA ns.example.com. root.example.com. (

2007051801 ; serial number

3H         ; refresh time

1H         ; retry time

1W         ; expiry day

1D         ; time to live

)

 

====== Master ========           ======= Slave ==========

in.named(53)                       in.named(53)

/etc/named.conf                    /etc/named.conf

/var/named/DB                      /var/named/copy DB

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

 

(a). Serial Number

 

    exampleXXX.zone      ---->       exampleXXX.zone

      Serial : 1                        Serial : 1

      Modify

      Serial : 2           >            Serial : ?

      (권장) Serial : 2006122000

 

(b). Refresh Time                     // 동기화타임

    Mater Server        ----->       Slave Server

                       3 hours

      (권장) 12시간, 24시간

 

(c). Retry Time                              // 재시도 타임

    Master Server       --X-->       Slave Server

                       3 hours       Fail

                        ----->

                       1 hours

      (권장) 1시간, 3시간

 

(d). Expire Date                      // 마스터가 죽었을 때 대체 복구 시간

    Master Server                    Slave Server

                        ------>

      Fail              ---X-->

                                      Data(7 Days)

      (권장) 7

 

(e). TTL(Time To Live)

    Server              ------>      Client

      (권장) 1

 

 

 

(3-4). 여러가지 레코드 종류(Record Types)

 

(a). NS Record (Name Server)

example.com.     IN   NS   ns.example.com.

domain                    full domain (nameserver)

ns.example.com.  IN   A    172.16.8.254

nameserver                    ip

 

(b). A Record (Address)

www.example.com. IN   A   172.16.8.254

 

(c). MX Record (Mail Exchange)

example.com.     IN   MX  10  mail1.example.com.

domain                        full domain

mail1            IN   A       172.16.8.254

name                          ip

example.com.     IN   MX  20  mail2.example.com.

mail2            IN   A       172.16.10.254

 

[참고] SPAM 메일서버, 일반 메일 서버 등록 방식

 

(d). CNAME Record (Canonical Name)

www1             IN   A       172.16.8.254

www2             IN   A       172.16.8.254

or

www1             IN   A       172.16.8.254

www2             IN  CNAME    www1

 

(e). PTR Record (Pointer)

254              IN   PTR      www.example.com.

 

 

 

(4) /var/named/exampleXXX.rev 파일 해석

 

Reverse Domain 파일은 주로 IP 주소에 Domain Name 맵핑된 정보가 주로 설정된다.

정을 하기 위해서는 PTR Record를 사용한다. Reverse Domain 파일안에 반드시 등록 되어 있

어야 하는 정의는 자신의 도메인안에 존재하는 DNS 서버에 대한 Reverse Domain이다.

 

# cat /var/named/exampleXXX.rev

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

$TTL 4

$ORIGIN 8.16.172.IN-ADDR.ARPA.

@ 1D IN SOA ns.example.com. root.example.com. (

2007051800 ; serial number

3M         ; refresh time

1M         ; retry time

1W         ; expiry day

1D         ; minimum time

)

 

8.16.172.IN-ADDR.ARPA.  IN  NS    ns.example.com.

254                     IN  PTR   ns.example.com.

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

 

[참고] 리버스 존 파일안에 반드시 정의 되어야 하는 설정

DNS Client                 DNS Server

          --------------->

          <---------------

          --------------->

          <---------------

 

# nslookup www.itbank.co.kr

.....

59.5.100.166 -> 168.126.63.1 DNS C 1.63.126.168.in-addr.arpa. Internet PTR ?

168.126.63.1 -> 59.5.100.166 DNS R 1.63.126.168.in-addr.arpa. Internet PTR kns.kornet.net.

59.5.100.166 -> 168.126.63.1 DNS C www.itbank.co.kr. Internet Addr ?

168.126.63.1 -> 59.5.100.166 DNS R www.itbank.co.kr. Internet Addr 58.185.71.171

.....

 

 

 

(4-1). PTR Record

 

PTR Record Type(Pointer)

254              IN   PTR      www.example.com.

 

[EX] Recored Type 필드

8.16.172.IN-ADDR.ARPA.  IN  NS    ns.example.com.

254                     IN  PTR   ns.example.com.

200                     IN  PTR   solaris200.example.com.

201                     IN  PTR   solaris201.example.com.

202                     IN  PTR   solaris202.example.com.

 

 

[EX] PTR / A Record Type 실습

 

ftp.example.com -> 172.16.8.200

 

# vi /var/named/example254.zone

.....

ftp                     IN  A     172.16.8.200

.....

# vi /var/named/example254.rev

.....

200                     IN  PTR   ftp.example.com.

.....

 

 

 

(5) /var/named/localhost.rev 해석

 

Reverse Loopback Domain 파일은 Reverse Loopback Domain 주소에 대해 Domain Name으로

변환하는 역할을 갖는다. 모든 도메인 서버는 자신의 주소를 master DNS Server 설정이

되어야 한다.

 

형식은 위의 파일과 같다. 해석하는 방법은 같다.

 

# cat /var/named/localhost.rev

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

$TTL 4

@ 1D IN SOA ns.example.com. root.example.com. (

2007051800 ; serial number

3M         ; refresh time

1M         ; retry time

1W         ; expiry day

1D         ; minimum time

)

 

0.0.127.IN-ADDR.ARPA. IN  NS    ns.example.com.

1                     IN  PTR   ns.example.com.

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

 

 

(6). /etc/nsswitch.conf 파일 해석

 

/etc/nsswitch.conf 파일은 이름서비스를 제공하는 서버들의 정보를 얻어 올수 있는 순서

를 정하는 중요한 파일이다.

 

# cat /etc/nsswitch.conf

......

# You must also set up the /etc/resolv.conf file for DNS name

# server lookup.  See resolv.conf(4).

hosts:      files dns

......

 

 

 

(7) /etc/resolv.conf 파일 해석

 

# cat /etc/resolv.conf

domain example.com

search example.com

nameserver 172.16.8.XXX

nameserver 172.16.8.254

 

/etc/resolve.conf 파일안에 정의 될수있는 statements

 

* domain      - 자신의 lcoal domain을 적어 주면된다. domain이 설정되지 않아도 운영

                하는데 아무런 지장이 없다.

                (예) domain example.com

 

* search      - search에 의해 지정된 되메인 부분은 생략할 수 있도록 하는 것이다. 만

                약 "search example.com"로 지정되어 있다면 example.com의 서브 도메인

                들은 그냥 호스트이름만으로도 찾을 수 있게 된다.

                예를 들어 www.example.com를 찾을려고 한다면 www 만으로도 사용이 가능

                하다.

                (예) search example.com

                (사용예) # ping www

                         # nslookup www

 

* nameserver  - DNS 서버를 지칭한다. 일반적으로 3개까지 지정할수 있으면 그 이상 정의

                된것은 인식이 되지 않는다. 회사내에서는 1차 DNS 서버와 2차 DNS 서버

                를 정의하면 된다.

                (예)     nameserver 168.126.63.1

                                      nameserver 168.126.63.2

                                      nameserver 168.126.63.3

 

 

[EX] /etc/resolv.conf 해석 순서 확인

 

# cat /etc/resolv.conf

nameserver 172.16.8.XXX

 

 

http://www.daum.net -> /etc/hosts -> DNS(172.16.8.XXX) -> .(Nameless Root)

 

 

# nslookup www.daum.net      

Server:  ns.solarisXXX.example.com

Address:  172.16.8.XXX

 

*** ns.solarisXXX.example.com can't find www.daum.net: Server failed  <----- 에러 메세지 확인

 

# vi /etc/resolv.conf

nameserver 168.126.63.1   <----- 정보 라인 추가

nameserver 172.16.8.XXX

 

# nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.213, 211.115.77.212, 211.115.115.212, 211.32.117.30

          211.115.115.211, 222.231.51.78, 211.115.77.214, 222.231.51.40

Aliases:  www.daum.net

 

# vi /etc/resolv.conf

nameserver 172.16.8.XXX   <----+---- 정의 순서 교체

nameserver 168.126.63.1   <----+

 

# pkill -9 in.named

# pgrep -lf in.named

(in.named 데몬 종료 여부 확인)

 

# nslookup www.daum.net

( 15초정도의 Time Interval 걸린다.)

*** Can't find server name for address 172.16.8.20X: No response from server

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.115.212, 211.32.117.30, 222.231.51.77, 211.115.77.213

          211.115.77.214, 211.115.77.211, 222.231.51.78, 222.231.51.40

Aliases:  www.daum.net

 

# in.named

# nslookup www.daum.net

-> 정보 요청이 되지 않는다.

 

 

 

 

 

 

               DNS Server Administrator Role

 

 

 

 

DNS Server Admin. Role List

도메인 등록 (Domain Insert)

서브 도메인 위임(Sub Domain Configuration = Domain Delegation)

마스터 / 슬레이브 DNS 서버 (Master Server, Slave Server)

캐싱 / 포워딩 DNS 서버 (Caching Olny Server, Forwarding Server)

DNS 부하 분산 (DNS Load Balancing = Web Load Balancing )

동적 업데이트 설정(Dynamic Updates)

보안 설정 (Security / ACL(Access Control List))

 

 

 

(1). 도메인 등록(Domain Insert)

 

DNS 서버 관리자에게 다음과 같은 도메인에 대한 IP 설정 요청이 들어 왔다고 해보자.

 

도메인에 IP 주소 등록 요청 예

- 172.16.8.254   ===>   www.solaris254.example.com

- 172.16.8.254   ===>   mail.solaris254.example.com

- 172.16.8.254   ===>   ftp.solaris254.example.com

 

Forward Domain 파일에 등록

Forward Zone File (example254.zone)

 

# vi /var/named/example254.zone

.....

www          IN   A      172.16.8.254

             IN   MX 10  mail

mail         IN   A      172.16.8.254

ftp          IN   A      172.16.8.254

.....

 

# vi /var/named/example254.rev

254          IN   PTR     www.solaris254.example.com.

254          IN   PTR     ftp.solaris254.example.com.  (X)

254          IN   PTR     mail.solaris254.example.com. (X)

//중복 정보 x

 

(EX1) 도메인 등록

 

■ 도메인에 IP 주소 등록 요청 예

- 172.16.8.XXX   ===>   cafe.solarisXXX.example.com

 

# cd /var/named

# vi exampleXXX.zone

......

;================================

; Domain Configuration for Test

;================================

[수정전]

test         IN   A   172.16.8.XXX

[수정후]

test         IN   A   172.16.8.XXX

cafe         IN   A   172.16.8.XXX    <----- 라인 추가

......

 

# pkill -1 in.named

# nslookup cafe.solarisXXX.example.com

(출력 정보 확인)

 

 

 

 

 

Client -------> DNS(192.168.10.XXX)

(Windows XP)   /var/named/exampleXXX.zone

                www     IN  A  192.168.10.XXX

       -----------------------------------------> Apache(192.168.10.XXX)

                                                  httpd(80, httpd.conf)

http://www.solarisXXX.example.com

 

 

■ Apache 설정

(주 설정 파일 설정)

# cd /etc/apache

# cp httpd.conf-example httpd.conf

 

(index.html 파일 생성)

# cd /var/apache/htdocs

# cp /etc/passwd index.html

 

(Apache 서버 기동)

# /etc/init.d/apache restart

# pgrep -lf httpd

-> 떠 있는 httpd 데몬들 확인

 

(DNS 설정 변경)

# cd /var/named

# vi exampleXXX.zone

[수정전]

;www          IN   A       172.16.8.XXX

www           IN   A       192.168.10.1

www           IN   A       192.168.10.2

www           IN   A       192.168.10.3

[수정후]

www           IN   A       192.168.10.XXX    <----- 라인 추가

;www          IN   A       172.16.8.XXX     

;www          IN   A       192.168.10.1      <----- 주석 처리

;www          IN   A       192.168.10.2      <----- 주석 처리

;www          IN   A       192.168.10.3      <----- 주석 처리

 

# pkill -1 in.named

# nslookup www.solarisXXX.example.com

 

(Window Server에서 확인)

네트워크 환경 > 로컬영역 연결 > 속성 > TCP/IP > DNS 서버 정보(192.168.10.XXX)

 

웹브라우저 에서 확인

http://www.solarisXXX.example.com

 

=> DNS 서버 정보 복원(Windows 서버)

 

 

 

(EX2) 부하분산(Load Balancing)

 

웹 부하 분산을 시킬때 DNS 서버를 사용할 수도 있다. 하지만 이것은 정확한 부하 분산이

라고 말할수는 없다. 이런경우 L4 스위치를 사용하는 경우와는 조금의 차이점이 존재한다.

 

         예: www.daum.net

        +----- www(IP1)      +---- NAS

        |                    |

[L4]----+----- www(IP2) -----+---- DB

        |

        +----- www(IP3)

 

     [그림] L4 스위치를 사용한 웹 부하 분산의 예

 

 

        +----- www(IP1)      +---- NAS

        |                    |

[DNS]---+----- www(IP2) -----+---- DB

        |

        +----- www(IP3)

 

     [그림] DNS 서버를 이용한 웹 부하 분산의 예

 

[참고] NAS?

/root/docs/Reference/DAS_NAS_SAN.txt

 

 

[EX] Windows 서버에서의 테스트

C:\> nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.213, 211.115.77.211, 211.32.117.30, 211.115.115.212

          211.115.77.214, 222.231.51.78, 222.231.51.77, 211.115.115.211

Aliases:  www.daum.net

 

 

C:\> nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.211, 211.115.115.212, 222.231.51.77, 211.115.115.211

          211.32.117.30, 211.115.77.213, 211.115.77.212, 222.231.51.40

Aliases:  www.daum.net

 

 

C:\> nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.213, 211.115.77.211, 211.32.117.30, 211.115.115.212

          211.115.77.214, 222.231.51.78, 222.231.51.77, 211.115.115.211

Aliases:  www.daum.net

 

 

C:\> nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.212, 222.231.51.40, 211.115.77.211, 222.231.51.78

          211.115.77.214, 211.32.117.30, 211.115.77.213, 211.115.115.212

Aliases:  www.daum.net

 

 

Forward Zone File (exampleXXX.zone)

# vi /var/named/exampleXXX.zone

.....

[수정전]

www           IN   A       192.168.10.XXX

;www          IN   A       172.16.8.XXX     

;www          IN   A       192.168.10.1 

;www          IN   A       192.168.10.2 

;www          IN   A       192.168.10.3 

[수정후]

;www          IN   A       192.168.10.XXX     <----- 주석 처리

;www          IN   A       172.16.8.XXX 

www           IN   A       192.168.10.1       <----- 주석 제거

www           IN   A       192.168.10.2       <----- 주석 제거

www           IN   A       192.168.10.3       <----- 주석 제거

.....

 

# pkill -1 in.named

# nslookup www.solarisXXX.example.com

(정보 확인 1초후에 다시 시도)

# nslookup www.solarisXXX.example.com

(정보 확인 및 1초후에 다시 시도)

# nslookup www.solarisXXX.example.com

(정보 확인 및 1초후에 다시 시도)

# nslookup www.solarisXXX.example.com

(정보 확인 및 1초후에 다시 시도)

 

 

 

(2). 도메인 위임(Domain Delegation)

 

도메인 위임은 일반적으로 웹호스팅 업체(예:가비아)에서 일반적으로 많이 사용하고 있다.

 

[참고] domain 할당 받는 방법(예: 가비아)

 

+---------------------- example.com ------------------------+

|* DNS(ns.example.com)                                      |

|                                                           |

|   +----- solarisXXX.example.com ------+                   |

|   | * DNS(ns.solarisXXX.example.com)  |                   |

|   |                                   |                   |

|   |                                   |                   |

|   +-----------------------------------+                   |

|                                                           |

+-----------------------------------------------------------+

 

DNS(ns.example.com)

# vi /var/named/example254.zone

.....

solaris200.example.com.       IN  NS  ns.solaris200.example.com.

ns.solaris200.example.com.    IN  A   172.16.8.200

.....

or

solaris200                    IN  NS  ns.solaris200

ns.solaris200                 IN  A   172.16.8.200

.....

 

# vi /var/named/example254.rev

.....

200                           IN  PTR  ns.solaris200.example.com.

 

 

[EX] Hint Domain Administration

+----------------- . (Nameless Root Domain)-----------------+

|* DNS(A.ROOT-SERVERS.NET)                                  |

|                                                           |

|   +----------- .com ------------------+                   |

|   | * DNS(ns.com)                     |                   |

|   |                                   |                   |

|   |                                   |                   |

|   +-----------------------------------+                   |

|                                                           |

+-----------------------------------------------------------+

 

# vi /var/named/example254.zone

....

com.                          IN  NS  ns.com.

ns.com.                       IN  A   172.16.8.200

....

 

 

 

(3). 마스터 / 슬레이브 DNS 서버 구성

 

Master Server / Slave Server

 

====== Master Server =======    ======== Slave Server ========

    in.named(53)                    in.named(53)

    /etc/named.conf                 /etc/named.conf

      - Forward Zone File(M)           - Forward Zone File(S)

      - Reverse Zone File(M)           - Reverse Zone File(S)

      - Localhost Zone File(M)         - Localhost Zone File(M)

      - Zone File for Hint             - Zone File for Hint

    /var/named/Zone File            /var/named/Copy Zone File

      - Forward Zone File              - Copy Forward Zone File

      - Reverse Zone File              - Copy Reverse Zone File

      - Localhost Zone File            - Localhost Zone File

      - Zone File for Hint             - Zone File for Hint

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

 

             [그림] Master/Slave DNS Server

 

 

(전제 조건)

- Master DNS 서버의 도메인을 따른다.

        solaris201(Master DNS Server) - solaris201.example.com => solaris201.example.com

        solaris202(Slave DNS Server)  - solaris202.example.com => solaris201.example.com

- 자리 배치에 따른 서버 결정

        왼: Master, 오: Slave, 앞: Master, 뒤: Slave

 

(자리 배치도)

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

                solarisXXX(172.16.8.XXX)

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

200 201 202            203 204 205

 

206 207 208            209 210 211

 

212 213 214            215 216 217

 

218 219 220            221 222 223

 

224 225 226            227 228 229

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

 

 

 

(3-1). Master DNS Server 서버쪽 설정

 

# vi /var/named/example254.zone

......

example.com.     IN   NS   ns1.example.com.

example.com.     IN   NS   ns2.example.com.

ns1              IN   A    172.16.8.254

ns2              IN   A    172.16.8.253

......

 

# vi /var/named/example254.rev

......

                 IN   NS   ns1.example.com.

                 IN   NS   ns2.example.com.

254              IN   PTR  ns1.example.com.

253              IN   PTR  ns2.example.com.

......

 

 

 

(3-2). Slave DNS Server 서버쪽 설정

 

# vi /etc/named.conf

......

     zone "example.com" in {

          type slave;

          file "example254.zone";

          masters { 172.16.8.254; };    <----- 172.16.8.254: Master DNS IP

     };

 

     zone "8.16.172.in-addr.arpa" in {

          type slave;

          file "example254.rev";

          masters { 172.16.8.254; };    <----- 172.16.8.254: Master DNS IP

     };

......

 

# cd /var/named

# ls

localhost.rev  named.root

 

 

 

[실습] DNS Master / Slave Server Configuration

 

(실습시나리오)

Domain : solaris201.example.com(Master DNS Server 도메인)

DNS1   : ns.solaris201.example.com  (solaris201)

            ^^^^^^^^^^^^^^^^^^^^^^

DNS2   : ns2.solaris201.example.com (solaris202)

             ^^^^^^^^^^^^^^^^^^^^^^

 

+---------------------- example.com ------------------------+

|* DNS(ns.example.com)                                      |

|                                                           |

|   +----- solarisXXX.example.com ------+                   |

|   | * DNS-ns.solarisXXX.example.com   |                   |

|   | *    -ns2.solarisXXX.example.com  |                   |

|   |                                   |                   |

|   +-----------------------------------+                   |

|                                                           |

+-----------------------------------------------------------+

 

 

(At Master DNS Server)

- Forward Zone File 편집

- Reverse Zone File 편집

 

(a). Forward Zone File 편집

# vi /var/named/example201.zone

.....

;

; DNS Server(Primary)

;

solaris201.example.com.  IN   NS      ns.solaris201.example.com.

solaris201.example.com.  IN   NS      ns2.solaris201.example.com.  <----- 라인 추가

ns                       IN   A       172.16.8.201

ns2                      IN   A       172.16.8.202                 <----- 라인 추가

.....

 

(b). Reverse Zone File 편집

# vi /var/named/example201.rev

......

8.16.172.IN-ADDR.ARPA. IN   NS      ns.solaris201.example.com.

8.16.172.IN-ADDR.ARPA. IN   NS      ns2.solaris201.example.com.    <----- 라인 추가

201                    IN   PTR     ns.solaris201.example.com.

202                    IN   PTR     ns2.solaris201.example.com.    <----- 라인 추가

......

 

# pkill -1 in.named

# tail -f /var/adm/messages

 

 

 

(At Slave DNS Server)

- /etc/named.conf 설정

- /var/named 파일 정리

 

(a). /etc/named.conf 파일 편집

# vi /etc/named.conf

.....

zone "solaris201.example.com" in {       <----- 정보 수정(solaris202 -> solaris201)

         type slave;                     <----- 정보 수정(master -> slave)

         masters { 172.16.8.201; };      <----- 라인 추가

         file "example201_backup.zone";  <----- 정보 수정

                                         (example202.zone -> example201_backup.zone)

};

 

zone "8.16.172.in-addr.arpa" in {

         type slave;                     <----- 정보 수정(master -> slave)

         masters { 172.16.8.201; };      <----- 라인 추가

         file "example201_backup.rev";   <----- 정보 수정

                                         (example202.rev -> example201_backup.rev)

};

.....

 

(b). /var/named 파일 정리

# cd /var/named

# rm example202.zone example202.rev

 

# tail -f /var/adm/messages

# pkill -1 in.named

# cd /var/named

# ls

(새로 생성된 Zone File 확인)

 

 

 

[Check Point] Slave Server

-> /var/named/(Zone File) 생성 확인

-> /var/adm/messages 로그 기록 정보 확인

 

 

 

(Master / Slave Zone Data Update 설정 테스트)

(At Master DNS Server)

# cd /var/named

# vi example201.zone

......

;--------------------------------

; Configuration for Test Domain

;--------------------------------

[수정전]

test          IN   A       172.16.8.201

cafe          IN   A       172.16.8.254

[수정후]

test          IN   A       172.16.8.201

cafe          IN   A       172.16.8.254

test1         IN   A       172.16.8.254     <----- 라인 추가

......

 

# pkill -1 in.named

# nslookup test1.solaris201.example.com

-> 출력 화면 확인

 

 

(At Slave DNS Server)

# cd /var/named

# grep test example201_backup.zone

test    4       IN      A       172.16.8.201

 

# pkill -1 in.named

# grep test example201_backup.zone

test    4       IN      A       172.16.8.201

 

 

(At Master DNS Server)

# vi example201.zone

......

20060930    ; serial number  (serial number 값을 높였다.)

......

;

; Configuration for Test Domain

;

[수정전]

test          IN   A       172.16.8.201

cafe          IN   A       172.16.8.254

test1         IN   A       172.16.8.254

[수정후]

test          IN   A       172.16.8.201

cafe          IN   A       172.16.8.254

test1         IN   A       172.16.8.254

test2         IN   A       172.16.8.254      <----- 라인 추가

......

# pkill -1 in.named

 

 

(At Slave DNS Server)

# pkill -1 in.named

 

# grep test example201_backup.zone

test    4       IN      A       172.16.8.201

test1   4       IN      A       172.16.8.254

test2   4       IN      A       172.16.8.254

 

 

 

(4). Caching-Only DNS Server / Forwarding DNS Server 구성

 

(4-1). Caching Only Server 설정

 

====== Caching Only Server ======= 

    in.named(53)                  

    /etc/named.conf              

      - Localhost Zone File(M)

      - Zone File for Hint  

    /var/named/Zone File   

      - Localhost Zone File

      - Zone File for Hint

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

 

[그림] Caching Only DNS Server

 

 

 

(4-2). Forwarding DNS Server 구성

 

====== Forwarding Server =======    ======== DNS Server ========

    in.named(53)                    in.named(53)

    /etc/named.conf                 /etc/named.conf

                                                   - Forward Zone File

                                       - Reverse Zone File

                                       - Localhost Zone File

                                       - Zone File for Hint

                                    /var/named

                                                   - Forward Zone File

                                       - Reverse Zone File

                                       - Localhost Zone File

                                       - Zone File for Hint

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

 

              [그림] Forwarding DNS Server

 

 

Forwarding Server 설정

 

# vi /etc/named.conf

.....

options {

        directory "/var/named";

        forwarders { 172.16.10.254; };

        forward only;

};

.....

 

 

 

(5). Dynamic Updates 기능 설정

 

DNS 서버에서 동적 업데이트(Dynamic Updates) 기능은 DHCP 서버로 부터 호스트에 대한

정보를 동적으로 업데이트하는 기능이다. 이 기능을 통해 DHCP 서버로 부터 동적으로 할

당받은 클라이언트들이 관리자의 특별한 설정 없이도 서버 시스템에 접근하거나 서비스를

받을수 있다. Dynamic Update 기능을 설정하기 위해서는 DNS Master Server의 설정을 다음

과 같이 해야 한다.

 

Dynamic Update 는 해당 도메인의 Authority 를 갖는 네임서버를 통해  Zone 파일을 수정

치 않고도 레코드를 동적으로 원격 갱신할 수 있도록 한다. 도메인 관리를 자동화 하거나,

사용자 별로 접속 도메인을 실시간 변경하여 제공하거나, DHCP에서의 주소-IP 매칭등과

같이 실시간적으로 레코드가 변경, 갱신 될 필요가 있는 서비스에 특히 유용할 수 있다.

 

Dynamic Update 는 BIND 8 부터 지원이 되며 BIND 9 에서의 변화는 dnssec-key 를 이용한

인증부분의 강화되었다.

 

 

■ Master DNS 서버 설정

 

# vi /etc/named.conf

 

     zone "example.com" in {

          type master;

          file "example254.zone";

          allow-update { 127.0.0.1; 172.16.8.254; };

     };

     zone "8.16.172.in-addr.arpa" in {

          type master;

          file "example254.rev";

          allow-update { 127.0.0.1; 172.16.8.254; };

     };

 

# pkill -1 in.named

 

 

 

(6). DNS 보안 설정

 

DNS 서버의 설정은 인증되지 않은 클라이언트에게도 정보가 노출될수 있다. BIND 8.X 버전

부터 /etc/named.conf 파일에 allow-query, allow-transfer 키워드를 통해 보안 설정을 할

수 있다.

 

allow-query 키워드는 DNS 쿼리를 요청할 수 있는 지역을 IP에 기반해서 설정 할 수 있다.

일반적으로 DNS Server와 DNS Client의 관계를 보안적으로 구성할 수 있다. 일반적으로 회

사내에 존재하는 DNS 서버에 DNS 서버에 쿼리를 요청할 수 있는 클라이언트 대역을 회사내

로 한정하여 설정하는 것을 권장한다.

 

allow-transfer 키워드는 DNS 존 파일을 전송받을수 있는 지역을 선택할수 있다.

DNS Master Server와 DNS Slave Server의 관계를 보안적으로 구성할 수 있다. 일반적으로

회사내에 존재하는 DNS Master Server에서 allow-transfer를 통해 존 파일을 전송할 수 있

는 DNS Slave Server의 IP를 지정할 것을 권장한다.

 

■ Security / ACL(Access Control List)

- 데이터 암호화(Data Encryption)

- chroot 환경 설정

- 프로그램 업데이트, 프로그램 패치

- Master => Slave(Zone 파일들이 전달될수 있는 영역 지정)

- Server => Client(Zone File에 대한 Query 영역 지정)

 

(At Master DNS System)

# vi /etc/named.conf

.....

options {

    allow-query { 172.16.0.0/16; 172.17.0.0/16; 192.168.8.0/24 };

    .....

};

.....

zone "example.com" in {

        type master;

        file "exmaple254.zone;

        allow-transfer { 172.16.8.253; 192.168.8.252; };

        allow-query { 172.16.0.0/16; 172.15.0.0/16; };

}

.....

 

 

 

(7). ndc 명령어

 

ndc 명령어를 사용하여 DNS Server의 설정을 변경할 수 있고 in.named 데몬을 제어 할 수

있다. 기본의 방식은 in.named 데몬에 대해 SIGHUP, SIGIINT 등과 같은 시그널을 사용해서

제어 했지만 ndc 명령어를 사용하면 좀 더 세세한 정보와 제어가 가능하다. ndc 명령어는

대화형 모드와 비 대화형 모드의 실행이 가능하다. BIND 9.X 버전에서는 rndc 명령어로 변

경이 되었다.

 

# ndc

Type   help  -or-   /h   if you need help.

ndc> /h

        /h(elp)                 this text

        /e(xit)                 leave this program

        /t(race)                toggle tracing (protocol and system events)

        /d(ebug)                toggle debugging (internal program events)

        /q(uiet)                toggle quietude (prompts and results)

        /s(ilent)               toggle silence (suppresses nonfatal errors)

 

ndc> help

(builtin) start - start the server

(builtin) restart - stop server if any, start a new one

getpid

status

stop

exec

reload [zone] ...

reconfig [-noexpired] (just sees new/gone zones)

dumpdb

stats [clear]

trace [level]

notrace

querylog

qrylog

help

quit

args

 

ndc> restart

new pid is 1197

/e                           <----- '/e' 입력

 

# ndc

ndc> status

in.named BIND 8.3.3 Thu Jun 16 08:11:42 PDT 2005  Generic Patch-5.9-June 2005

config (/etc/named.conf) last loaded at age: Thu Oct 18 00:11:35 2007

number of zones allocated: 64

debug level: 0

xfers running: 0

xfers deferred: 0

soa queries in progress: 0

query logging is OFF

server is initialising itself

 

ndc> dumpdb

Database dump initiated.

 

ndc> /e                           <----- '/e' 입력

 

# cd /var/named

# ls -l named_dump.db

-rw-r--r--   1 root     root        2.5K Oct 18 01:45 named_dump.db

 

 

[참고] ndc 명령어 사용을 다른 예

 

ndc> /t

tracing now on

 

ndc> restart

ndc: [command 'exec']

ndc: [220 BIND 8.3.3]

ndc: [250 Restart initiated.]

ndc: [command 'getpid']

ndc: [220 BIND 8.3.3]

ndc: [250 my pid is <1210>]

pid 1210 is running

new pid is 1210

/e                           <----- '/e' 입력

 

 

# ndc

ndc> /t        //trace mode

tracing now on

 

ndc> /d        //usr1 signal

debugging now on

 

ndc> restart

ndc: [command 'exec']

ndc: [isc/ctl_clnt::new_state: initializing -> connecting]

ndc: [isc/ctl_clnt::new_state: connecting -> connected]

ndc: [isc/ctl_clnt::readable: read 16, used 16]

ndc: [220 BIND 8.3.3]

ndc: [isc/ctl_clnt::readable: read 24, used 24]

ndc: [250 Restart initiated.]

ndc: [isc/ctl_clnt::new_state: connected -> destroyed]

ndc: [command 'getpid']

ndc: [isc/ctl_clnt::new_state: initializing -> connecting]

ndc: [isc/ctl_clnt::new_state: connecting -> connected]

ndc: [isc/ctl_clnt::readable: read 16, used 16]

ndc: [220 BIND 8.3.3]

ndc: [isc/ctl_clnt::readable: read 22, used 22]

ndc: [250 my pid is <1217>]

ndc: [isc/ctl_clnt::new_state: connected -> destroyed]

pid 1217 is running

new pid is 1217

/e                           <----- '/e' 입력

 

 

 

[참고] ndc 명령어(Non-Interractive Mode) 실행

# ndc getpid      in.named 데몬의 PID 번호 보여주기

# ndc status      in.named 상태 보기

# ndc reload      /etc/named.conf & Zone 파일 다시 읽기

# ndc stats       통계 남기기

# ndc querylog    /var/adm/messages 파일에 로그 남기기

 

 


2008. 9. 2. 18:42

nslookup CMD

 

 

 

                  nslookup CMD

 

 

 

 

 

 

1. nslookup CMD

_____________________

 

query name servers interactively

 

     Nslookup is a program to query Internet domain name servers.

     Nslookup has two modes: interactive and non-interactive.

     Interactive mode allows the user to query name servers for

     information about various hosts and domains or to print a

     list of hosts in a domain. Non-interactive mode is used to

     print just the name and requested information for a host or

     domain.

 

     Interactive mode is entered in the following cases:

 

     1. when no arguments are given (the default name server will

        be used)

 

     2. when the first argument is a hyphen (-) and the second

        argument is the host name or Internet address of a name

        server.

 

     Non-interactive mode is used when the name or Internet

     address of the host to be looked up is given as the first

     argument. The optional second argument specifies the host

     name or address of a name server.

 

     Options can also be specified on the command line if they

     precede the arguments and are prefixed with a hyphen. For

     example, to change the default query type to host

     information, and the initial timeout to 10 seconds, type:

 

 

 

 

 

2. Name Service Lookup CMD(s)

__________________________________

 

- dig

- host

- nslookup

 

 

 

(1). dig CMD

 

     dig (domain information groper) is a flexible tool for

     interrogating DNS name servers. It performs DNS lookups and

     displays the answers that are returned from the name

     server(s) that were queried. Most DNS administrators use dig

     to troubleshoot DNS problems because of its flexibility,

     ease of use and clarity of output. Other lookup tools tend

     to have less functionality than dig.

 

     Although dig is normally used with command-line arguments,

     it also has a batch mode of operation for reading lookup

     requests from a file. A brief summary of its command-line

     arguments and options is printed when the -h option is

     given. Unlike earlier versions, the BIND9 implementation of

     dig allows multiple lookups to be issued from the command

     line.

 

     Unless it is told to query a specific name server, dig will

     try each of the servers listed in /etc/resolv.conf.

 

     When no command line arguments or options are given, will

     perform an NS query for "." (the root).

 

     It is possible to set per-user defaults for dig via

     ${HOME}/.digrc. This file is read and any options in it are

     applied before the command line arguments.

 

 

# dig www.daum.net

 

; <<>> DiG 8.3 <<>> www.daum.net

;; res options: init recurs defnam dnsrch

;; got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 2

;; flags: qr rd ra; QUERY: 1, ANSWER: 9, AUTHORITY: 9, ADDITIONAL: 9

;; QUERY SECTION:

;;      www.daum.net, type = A, class = IN

 

;; ANSWER SECTION:

www.daum.net.           3h47m46s IN CNAME  daumtop.daum.akadns.net.

daumtop.daum.akadns.net.  2m58s IN A  211.115.77.211

daumtop.daum.akadns.net.  2m58s IN A  211.115.77.212

daumtop.daum.akadns.net.  2m58s IN A  211.115.77.214

daumtop.daum.akadns.net.  2m58s IN A  211.32.117.30

daumtop.daum.akadns.net.  2m58s IN A  211.115.77.213

daumtop.daum.akadns.net.  2m58s IN A  222.231.51.40

daumtop.daum.akadns.net.  2m58s IN A  211.115.115.211

daumtop.daum.akadns.net.  2m58s IN A  222.231.51.78

 

;; AUTHORITY SECTION:

akadns.net.             21h47m45s IN NS  eur1.akadns.net.

akadns.net.             21h47m45s IN NS  za.akadns.org.

akadns.net.             21h47m45s IN NS  zd.akadns.org.

akadns.net.             21h47m45s IN NS  use4.akadns.net.

akadns.net.             21h47m45s IN NS  zc.akadns.org.

akadns.net.             21h47m45s IN NS  usw2.akadns.net.

akadns.net.             21h47m45s IN NS  asia9.akadns.net.

akadns.net.             21h47m45s IN NS  use3.akadns.net.

akadns.net.             21h47m45s IN NS  zb.akadns.org.

 

;; ADDITIONAL SECTION:

asia9.akadns.net.       1d23h48m18s IN A  220.73.220.4

eur1.akadns.net.        1d23h57m54s IN A  213.254.204.197

use3.akadns.net.        1d23h34m19s IN A  204.2.178.133

use4.akadns.net.        1h42m11s    IN A  208.44.108.137

usw2.akadns.net.        1d49m46s    IN A  63.209.3.132

za.akadns.org.          21h47m45s   IN A  195.219.3.169

zb.akadns.org.          21h47m45s   IN A  206.132.100.105

zc.akadns.org.          21h47m45s   IN A  124.211.40.4

zd.akadns.org.          21h47m45s   IN A  63.209.3.132

 

;; Total query time: 14 msec

;; FROM: solaris254 to SERVER: default -- 168.126.63.1

;; WHEN: Wed Mar  5 13:43:52 2008

;; MSG SIZE  sent: 30  rcvd: 510

 

[참고] /root/SERVER/DNS/Reference/dig_활용방법_가이드.pdf

 

 

 

 

 

 

(2). host

 

     host is a simple utility for performing DNS lookups. It is

     normally used to convert names to IP addresses and vice

     versa. When no arguments or options are given, host prints a

     short summary of its command line arguments and options.

 

     name is the domain name that is to be looked up. It can also

     be a dotted-decimal IPv4 address or a colon-delimited IPv6

     address, in which case host will by default perform a

     reverse lookup for that address.  server is an optional

     argument which is either the name or IP address of the name

     server that host should query instead of the server or

     servers listed in /etc/resolv.conf.

 

 

# host www.daum.net

 

 

 

(3). nslookup

 

자세한 내용은 "4. nslookup 사용법"를 참고한다.

 

# nslookup www.daum.net

 

 

 

 

 

3. Debugging for DNS

______________________

 

DNS 서버 설정이 이상이 있는 경우 디버깅하는 방법은 (a)nslookup 명령어를 사용하는 방

법, (b) /var/adm/messages 파일을 활용하는 방법, (c)signal을 사용하는 방법등이 있다.

 

■ nslookup 명령어를 사용하는 경우

■ /var/adm/messages & SIGHUP 사용하는 경우

■ 시그널 (SIGINT, SIGUSR1) 사용하는 경우

 

 

 

[EX1] nslookup 명령어를 사용하는 방법

# nslookup

> server 172.16.8.XXX            (자신의 DNS 서버 지정)

 

> set q=NS

> solarisXXX.example.com         (자신의 도메인 지정)

 

> set q=MX

> solarisXXX.example.com         (자신의 메일 서버 도메인 지정)

 

> set q=A

> www.solarisXXX.example.com     (자신의 웹서버 도메인 지정)

 

 

[EX2] /var/adm/messages 파일과 signal(SIGHUP) 사용하는 경우

<TERM1> 관리자 윈도우 1

# tail -f /var/adm/messages (# mlog)

..... (중략) .....

Jul  1 16:26:37 solaris254 named[189]: [ID 295310 daemon.notice] reloading nameserver

Jul  1 16:26:37 solaris254 named[189]: [ID 295310 daemon.notice] Ready to answer queries.

 

<TERM2> 관리자 윈도우 2

# pkill -HUP in.named

 

 

[EX3] 다른 시그널을 사용하는 경우

# pkill -INT in.named

# cat /var/named/named_dump.db

.... (내용 생략).....

 

# pkill -USR1 in.named (Debug Mode ON)

# cat /var/named/named.run

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

Debug level 1

Version = in.named BIND 8.3.3 Thu Jun 16 08:11:42 PDT 2005

        Generic Patch-5.9-June 2005

conffile = /etc/named.conf

datagram from [172.16.8.203].32967, fd 23, len 17

req: nlookup() id 11692 type=2 class=1

req: missed '' as '' (cname=0)

ns_req: answer -> [172.16.8.203].32967 fd=23 id=11692 size=60 rc=0

prime_cache: priming = 0, root = 0

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

 

# pkill -USR2 in.named (Debug Mode OFF)

 

 

 

 

4. nslookup 사용법

____________________

 

(1). How to using the nslookup CMDs

 

- Non-interractive Mode( 대화형 모드 실행)

- Interractive Mode(대화형 모드 실행)

 

EX) Interractive/Non-interractive Mode

# nslookup  www.daum.net

# nslookup

> www.daum.net

 

 

 

(2). nslookup CMD EXAMPLE

 

(2-1). 대화형 모드(Non-interractive Mode) 실행

# nslookup -query=NS solarisXXX.example.com

# nslookup -q=A ns.solarisXXX.example.com

# nslookup -q=MX solarisXXX.example.com

# nslookup -q=PTR 172.16.8.XXX

 

 

 

(2-2). 대화형 모드(Interractive Mode) 실행

 

# nslookup

> test.solarisXXX.example.com

> 172.16.8.XXX

> ls solarisXXX.example.com

 

(1st Style)

> ls -a www.solarisXXX.example.com  (a: alias)

> ls -d solarisXXX.example.com      (d: detail)

 

> ls -t MX solarisXXX.example.com

> ls -t A www.solarisXXX.example.com

> ls -t PTR 172.16.8.XXX

> ls -t NS solarisXXX.example.com

 

(2nd Style)

> set type=MX

> solaris254.example.com

> set type=A

> www.solaris254.example.com

> set type=PTR

> 172.16.8.254

> set type=NS

> solaris254.example.com

 

(3rd Style)

> set q=NS        (Name Server)

> solarisXXX.example.com

 

> set q=MX        (Mail Exchange)

> solarisXXX.example.com

 

> set q=A         (Address)

> www.solarisXXX.example.com

 

> set q=PTR       (Address Pointer)

> 172.16.8.XXX

 

> server 168.126.63.1

 

> set q=NS

> kornet.net      //도메인 네임

 

> set q=MX 

> kornet.net      //도에인 네임

 

> set q=A   //adress

> www.kornet.net

 

> set q=PTR

> 211.216.50.150

 

> exit

 

 

 

2008. 9. 2. 18:17

DNS Server(Domain Name System)

 

 

 

                       DNS Server(Domain Name System)

 

 

 

 

 

 

0. DNS 관련 용어(Terms)

_______________________

 

 

DNS 서버에 대한 자세한 정보를 논하기 전에 DNS 서버에서 사용하는 도메인에 대한 명확한

용어의 개념을 알아 보자.

 

 

URL : "http://www.itbank.com"

 

       www            : Hostname

       itbank.com     : Domainname

       www.itbank.com : FQDN(Fully Qualified Domain Name)

 

 

+------------ itbank.com ------------+

| [DNS Server]                       |

| IP1 --> www        X (www)         |

| IP2 --> mail                       |

| IP3 --> ftp        X (mail)        |

|                                    |

|                    X (ftp)         |

|                                    |

+------------------------------------+

 

[참고] 일반적인 Domainname : www.itbank.com

 

 

 

(1). Host Name?

 

인터넷에서 호스트는, 인터넷을 통해 다른 컴퓨터들과 쌍방향 통신이 가능한 컴퓨터를 말

한다. 호스트는 특정한 호스트번호를 갖는데, 이는 네트웍 번호와 합해져서, 고유의 IP

주소를 이루게된다. 인터넷 서비스 제공업체를 통한 PPP 사용자의 경우에는, 접속되어있

는 동안에만 고유한 IP 주소를 갖게되며, 그 시간동안은 해당 사용자의 컴퓨터도 하나의

호스트가 되는 것이다. 이러한 맥락에서 보면, 호스트란 네트웍의 하나의 노드라고 볼 수

도 있다.

 

 

 

(2). Domain Name?

 

인터넷에 연결된 다른 컴퓨터와 통신을 하기 위해서는 컴퓨터가 인터넷에 연결되어 있어

야 하고 컴퓨터의 주소를 알고 있어야 한다. 컴퓨터의 주소는 숫자로 표현된 주소와 영문

자로 표현된 주소의 2가지가 있다.

 

203.247.51.32 (IP주소)

 

숫자로 표현된 주소는 왼쪽 그림과 같이 점으로 구분되어 4단계로 표시되는데, 점으로 구

분된 각 숫자에는 0 ∼ 255 까지의 숫자를 사용할 수 있으며, 전세계적으로 중복되지 않

도록 사용해야 한다. 숫자로 표현된 이러한 주소를 인터넷 공인 IP 주소라고 한다.

 

그러나 인터넷 사용자들이 다른 컴퓨터와의 통신을 위해 숫자로 표현된 주소를 사용하게

되면, 주소를 이해하거나 기억하기 어렵다는 단점이 있다. 따라서 숫자로 표현된 주소대

신에 영문자로 표현된 주소를 사용할 수 있도록 하였는데, 영문자로 표현된 주소는 우리

가 실생활에서 사용하는 영문단어로 구성되어 인터넷 사용자들이 쉽게 기억할 수 있고 편

리하게 다른 컴퓨터와 통신할 수 있다.

 

 

itwill.co.kr (도메인주소)

1단계: kr

2단계: co

3단계: itwill

 

영문자로 표현된 주소는 왼쪽 그림과 같이 점으로 구분되어 여러 단계로 구성된다. 각 단

계는 오른쪽 맨 마지막에서부터 1단계, 2단계, 3단계 등으로 불리며, 전세계적으로 중복

되지 않는 고유한 이름이 부여된다. 이를 인터넷 도메인이라고 하는데, 인터넷 도메인 이

름은 인터넷에 연결된 전세계의 어떠한 컴퓨터와도 통신을 가능하게 해준다. 

 

[인터넷 도메인 이름의 부여 원칙]

 

* 영문자 A~z, 숫자 0~9 또는 하이픈(-)의 조합으로만 표현되며, 영문자의 대, 소문자는

  구별하지 않고 같은 것으로 간주한다.

* 첫 글자는 영문자로 시작하여야 하며, 하이픈으로 끝날수 없다 (우리나라에서는 1999년

  6월 30일부터 숫자로 시작되는 도메인 이름도 허용되었다).

* 길이는 각 단계별로 최소 2자에서 최대 63자까지 가능하다.

* 컴마(,), 언더바(_) 등의 기호는 사용할 수 없다.

* 전세계적으로 중복되지 않도록 고유해야 한다 (이미 사용되고 있는 도메인 이름은 쓸

  수 없다).

 

 

 

(3). FQDN(Fully Qualified Domain Name)?

 

FQDN[에프큐디엔]은 시스템을 지칭하는 완전한 이름으로서, 호스트 이름과 그것의 도메인

이름으로 구성된다. 예를 들어, "www"가 호스트 이름이고, "terms.co.kr"이 도메인 이름

이라면, FQDN은 "www.terms.co.kr"가 된다. FQDN은 인터넷상의 특정 호스트를 지칭하기

위한 고유한 인터넷 주소를 가져야한다. 인터넷상에 있지 않지만, 전자우편 주소를 위한

이름공간을 공유하는 일부 호스트를 위해서도, 동일한 이름 구조가 사용된다. FQDN을 가

지고 있지 않은 호스트는 뱅 경로를 사용하여 지칭되어야한다.

 

모든 인터넷 컴퓨터들과 대부분의 UUCP 사이트들은 1980년부터 작성된 막후의 많은 량의

소프트웨어 덕분에 이제 FQDN을 해석할 수 있다.

 

 

 

(4). Internet?

 

인터넷은 전세계적인 컴퓨터 네트웍 시스템으로서, 사용자가 어떤 컴퓨터에 있든지 간에

그가 사용권한을 가지고 있다면 그 어떤 다른 컴퓨터에도 접속해서 정보를 얻을 수 있는

"네트웍의 네트웍"이다. 인터넷은 1969년에 미국 정부의 ARPA (Advanced Research

Projects Agency)에 의해 태동되었으며, 처음에는 ARPANet으로 알려졌었다. 인터넷의 원

래 목표는 한 대학에 있는 연구용 컴퓨터의 사용자가 다른 대학에 있는 연구용 컴퓨터의

사용자와 "대화할 수 있는" 네트웍을 만드는 것이었다. ARPANet 설계의 부산물 중 하나

는, 메시지가 한 방향 이상으로 나뉘어 전달되거나 또는 다른 길로 전달될 수 있기 때문

에, 적의 군사공격이나 기타 다른 재해로 인해 네트웍의 일부가 파괴된 경우에도 제 기능

을 발휘할 수 있다는 것이다.

 

오늘날 인터넷은 전세계의 수 십억 인구가 액세스할 수 있는 대중 전체를 위한, 협동적이

며, 스스로 유지되는 자립 설비이다. 인터넷은 물리적으로 기존의 공중 전화망의 전체 자

원의 일부를 활용하고 있으며, 기술적으로는 TCP/IP라고 불리는 일련의 프로토콜들을 사

용함으로써 다른 것들과 구별된다. 인터넷 기술에 있어 최근에 나타난 2개의 변화는, 인

트라넷과 엑스트라넷이며, 이들 역시 TCP/IP 프로토콜을 사용한다.

 

많은 인터넷 사용자들을 위하여, 전자우편이 짧은 편지의 처리를 위한 우편서비스를 실용

적으로 대체하고 있다. 전자우편은 인터넷에서 가장 널리 사용되는 응용프로그램이다.

사용자는 또한 IRC를 이용하여 다른 컴퓨터의 사용자와 실시간으로 채팅을 할 수 있다.

최근에는 인터넷 전화설비 및 소프트웨어를 이용하여 실시간으로 음성통화까지 가능하게

되었다.

 

인터넷에서 가장 널리 사용되는 서비스 중의 하나가 월드와이드웹이다. 웹의 가장 두드러

진 특성은 즉시 상호 참조를 할 수 있게 해주는 방법인 하이퍼텍스트인데, 대부분의 웹사

이트들에서 텍스트 내에 다른 색으로 표시되어 있거나 또는 밑줄로 표시되어 있는 단어나

문장이 바로 그 것이다. 사용자가 이러한 단어나 구절을 선택하면, 이것과 관련 있는 사

이트나 페이지로 전환된다. 때로는 이러한 링크는 클릭이 가능하도록 만들어진 이미지

(또는 이미지의 일부)에도 숨겨져 있을 수 있다. 마우스의 포인터를 하이퍼텍스트 링크에

갖다대면, 포인터의 모양이 화살표에서 손 모양으로 바뀌는데, 이것은 다른 사이트나 페이

지로 전환하기 위해 클릭할 수 있다는 것을 가리킨다.

 

웹을 사용하면 무수히 많은 량의 정보에 쉽게 액세스할 수 있다. 웹 서핑은 웹 브라우저

를 통해 이루어지는데, 유명한 것으로는 넷스케이프 네비게이터와 마이크로소프트의 인터

넷익스플로러가 있다. 특정 웹사이트의 모습은 어떤 브라우저를 사용하느냐에 따라 다소

다르게 보일 수도 있다. 또한 최신 버전의 브라우저들은 애니메이션, 가상현실, 소리, 음

악파일 등에 있어 이전 버전에 비해 더 많은 특수기능들을 제공한다.

 

 

 

(5). ARPANet (Advanced Research Projects Agency Network)?

 

아파넷은 인터넷의 기초가 된 네트웍이다. 아파넷은 패킷 스위칭 개념을 이용하여 전용회

선으로 서로 연결된 여러 대의 컴퓨터로 구성되었으며, 주로 미 군당국에서 자금을 지원

하였다.

 

아파넷은 이후 1980년대에 들어서면서 새로운 군사용 네트웍인 DDF(Defense Data Network)

와 국립과학재단의 후원을 받는 과학 및 학술컴퓨터 네트웍인 NSFNet으로 분리되었다.

1995년에 NSFNet은, 인터넷 백본(vBNS라고 불린다)을 PSINet, UUNET, ANS/AOL, 스프린트,

MCI, 및 AGIS-Net99 등과 같은 상용 백본 제공업체의 컨소시움으로 바꾸기 위해, 차례대

로 단계적 철수를 시작했다.

 

 

 

 

 

 

1. DNS 개요(Concept)

____________________

 

- DNS(Domain Name System / Service)

 

(1). 초기의 도메인 관리

 

 

 

+-------------Domain-----------------+

|                                    |

|  SERVER -------+------> SERVERA    |

|  HOST.txt      |                   |

|                +------> SERVERB    |

|                |                   |

|                +------> SERVERC    |

|                |                   |

|                +------> .....      |

|                                    |

+------------------------------------+

 

[Main Server] -------------------> [Domin Server]

  HOST.TXT                          /etc/hosts

(Domain <--> IP)

 

      [그림] 초기의 도메인 관리

 

 

 

(2). 현재의 도메인 관리

 

DNS(Domain Name System), BIND(Berkeley Internet Name Domain)

- BIND 4.X

- BIND 8.X

- BIND 9.X

 

 

 

==== DNS Client ====       ==== DNS Server =====                              

Resolver                     in.named(53)

- /etc/nsswitch.conf        /etc/named.conf

- /etc/resolv.conf           DB : /var/named/

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

Web Browser                   - Forward Zone File(D==>IP)

- http://www.itbank.com       - Reverse Zone File(IP==>D)

                              - localhost Zone File(Caching)

                              - hint File(named.root, hint)

 

             [그림] BIND 동작

 

 

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

도메인           

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

.                             - Nameless Root Domain

.com                   - 1차 도메인(국가 도메인 포함)

                                      (예) kr, jp, ....

                                      (예) .com, .org, ....

.itbank.com            - 2차 도메인

                                      (예) yahoo.com, itbank.com, daum.net

.yahoo.co.kr   - 3차 도메인

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

       

(예) www.yahoo.co.kr

            A   A  A

|   |  |

           (a) (b)(c)

(a) : 3차 도메인

(b) : 2차 도메인

(c) : 1차 도메인

 

            [그림] 도메인 이름 체계

 

 

* 수업시에 사용하는 도메인 이름 체계

(예) www.solarisXXX.example.com

 

 

 

[참고] BIND (Berkeley Internet Name Domain)?

BIND는 BSD 기반의 유닉스 시스템을 위해 설계된 DNS이다. BIND는 서버와 resolver 라이

브러리로 구성되어 있다. 네임서버는 클라이언트들이 이름 자원들이나 객체들에 접근하여,

네트웍 내의 다른 객체들과 함께 이러한 정보를 공유할 수 있게 해주는 네트웍 서비스이

다. 이것은 사실상, 컴퓨터 네트웍 내의 객체들을 위한 분산 데이터베이스 시스템이다.

BIND는 호스트 이름과 주소를 저장하고 검색하는데 사용되기 위한 BSD 네트웍 프로그램

(버전 4.3 이상)에 완전히 통합되어 있다.

 

시스템 관리자는 BIND를 네트웍 호스트들의 file(/etc/hosts) 내에 있는 호스트 테이블

룩업의 대체용으로 사용하도록 시스템을 설정할 수 있다. BSD의 기본 설정은 BIND를 사용

하는 것이다.

 

 

 

 

 

2. Solaris 9 DNS 기본 설정

______________________________________

 

솔라리스 9에서는 기본적으로 BIND 8.2.X 버전이 설치 되어 있다. 현재 솔라리스 09/05 버

전에는 8.2.4 버전이 설치되어 있다. 기본적으로 설치 되어 있는 Bind 프로그램을 사용하

는 경우 데몬만 존재하고 /etc/named.conf, /var/named/DB 파일들이 존재하지 않기 때문에

생성을 해 줘야 한다. 설정 파일들은 특정한 문법(Syntax)가 존재하기 때문에 매뉴얼 페이

지를 참고하여 작성하여야 한다.

 

[참고] /etc/named.conf, /var/named/DB 작성시 주의점

경험상, 설정파일이나 DB 파일들에는 탭이나 스페이스를 모두 사용할 수 있다고 되어 있

지만 탭을 사용하는 경우 알수 없는 에러가 생기는 경우를 많았다. 반드시 스페이스를 사

용하여 필드를 구분하자. 일부 다른 문서에서는(특히나 다른 유닉스) 스페이스 대신해서

탭을 쓸것을 권장하지만 솔라리스의 특성으로 여겨진다. 주의하자.

 

 

 

패키지 : SUNWinamd

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

==== DNS Server =====                             

   in.named(53)

   /etc/named.conf

   DB : /var/named/

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

- Forward Zone File(D==>IP)

- Reverse Zone File(IP==>D)

- localhost Zone File(Caching)

- hint File(named.root, hint)

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

 

 

(0). Bind 프로그램 설치 확인

 

패키지를 살펴 보면 특별한 설정파일은 없고 in.named, in.named-xfer 프로그램만 존재한

다는 것을 확인할 수 있다.

 

# pkginfo | grep Domain

system      SUNWidnd       Internationalized Domain Name Support Developer Files

system      SUNWidnl       Internationalized Domain Name Support Library Files

system      SUNWinamd      Internet Domain Name Server   <----- Bind 프로그램 확인

 

# pkgchk -v SUNWidnd

# pkgchk -v SUNWidnl

# pkgchk -v SUNWinamd

/usr

/usr/sbin

/usr/sbin/in.named

/usr/sbin/named-xfer

 

 

 

(1). DNS 서비스 데몬 확인

 

DNS 서비스 데몬 in.named는 기본적으로 설치가 되어 있다.

 

# which in.named

/usr/sbin/in.named

 

# in.named -v

in.named BIND 8.3.3 Thu Jun 16 08:11:42 PDT 2005

        Generic Patch-5.9-June 2005

 

 

 

(2). DNS 서비스 포트 확인

 

DNS 서비스 포트는 53으로 설정 되어 있다.

 

# grep 53 /etc/services

domain          53/udp

domain          53/tcp

 

 

 

(3). /etc/named.conf, /var/named/* 확인

 

DNS 서버 주설정 파일인 /etc/named.conf 존재하지 않는다. 또한 /etc/named.conf 파일이

없으므로 /var/named/DB 파일들도 존재하지 않는다.

 

# ls -l /etc/named.conf

/etc/named.conf: No such file or directory

 

# ls -ld /var/named

/var/named: No such file or directory

 

 

 

(4). DNS Server 설정

 

DNS 서버 설정을 위해서 /etc/named.conf 파일을 만들고 /var/named/DB 파일들을 생성해

주는 DNS.sh 스크립트를 실행하자. DNS.sh 스크립트는 /etc/named.conf 파일을 생성하고

/var/named 디렉토리를 만든후 그안에 exampleXXX.zone, exampleXXX.rev, localhost.rev

named.root 파일을 생성한다. 또한 /etc/nsswitch.conf, /etc/resolv.conf 파일도 설정

해 준다.

 

# mkdir /mnt/server

# mount 172.16.8.254:/root/shell /mnt/server

# cd /mnt/server

# ./DNS.sh

 

 

 

(5). DNS Server 설정 확인

 

DNS 서버 설정을 다음과 같이 확인하자. in.named 데몬을 띄우고 nslookup 명령어를 통해

확인해 보자. 각 설정 파일의 정보가 정확한지 확인을 해야 한다. in.named 데몬을 띄울때

/var/adm/messages 파일을 모니터링 하는 것을 잊지 말자.

 

# ls -l /etc/named.conf

# ls -l /var/named

# cat /etc/resolv.conf

# cat /etc/nsswitch.conf | grep hosts

....

hosts: files dns

....

 

 

 

(6). DNS 서버 실행

 

# in.named

# pgrep -lf in.named

  193 /usr/sbin/in.named

 

# nslookup www.solarisXXX.example.com

 

 

 

(7). DNS Server 관련 파일들

 

/etc/named.conf                                   DNS Main Conifguration File

 

/var/named/exampleXXX.zone         Forward Zone File

/var/named/exampleXXX.rev          Reverse Zone File

/var/named/localhost.rev           Localhost Zone File

/var/named/named.root                      Hint File

 

/etc/nsswitch.conf                         DNS Client File

/etc/resolv.conf                           DNS Client File

 

 

 

 

 

3. Bind 8.2.4(Solaris 9)

 

각 서버들에 대한 자세한 소개는 "2_DNS8x.txt" 파일에 있다. DNS 서버in.named 데몬은

/etc/named.conf 파일을 설정을 가지고 부팅시에 /etc/rc2.d/S72inetsvc Startup Script

에 의해 설정된다. 솔라리스 9 버전에는 BIND 8.2.X, 또는 BIND 8.3.X 버전이 설치 되어

있다.

 

 

 

(1). 서버의 종류(Server Types)

 

서비스를 제공하는 서버의 영역에 따른 분류

Root Servers(Nameless Root)

■ 1차 도메인 서버/2차 도메인 서버/....

 

서버의 목적에 따른 분류

■ Primary / Secondary Servers(Master / Slave Servers)

■ Caching-Only Servers

■ Forwarding Servers

 

 

 

(2). 클라언트 쿼리 종류(Answer Types)

 

Answers that are returned from DNS servers can be described as authoritative or

non-authoritative.

 

Answers from authoritative DNS servers are:

* Sourced from a disk-based file.

* Usually correct. Because humans administer the DNS, it is possible for

 incorrect data to enter the DNS database.

 

Answers from non-authoritative DNS servers are:

* Sourced from a server cache

* Usually correct

* Can be incorrect if the server’s cache contains stale data

 

 

[EX] nslookup 명령어 확인(Windows에서 확인)

 

C:\> nslookup www.daum.net

Server:  kns.kornet.net

Address:  168.126.63.1

 

Non-authoritative answer:        <----- 출력 정보 확인

Name:    daumtop.daum.akadns.net

Addresses:  211.115.77.214, 211.115.77.211, 222.231.51.78, 211.115.115.212

          222.231.51.77, 211.115.77.213, 222.231.51.40, 211.115.77.212

 

 

2008. 9. 1. 18:21

IPv6-IPv4-IPv6 Tunnel Configuration

 

 

 

               IPv6-IPv4-IPv6 Tunnel Configuration

 

 

 

 

 

                                   172.16.0.0

------+---------------------------------------+--------

      |                                       |

   (pcn0)  172.16.8.200                     (pcn0)  172.16.8.205

<solaris200>                             <solaris205>

   (pcn0:1)192.168.1.1                      (pcn0:1)192.168.2.1

      |                                       |

      +-192.168.1.2(pcn0)                     +-192.168.2.2(pcn0)

      |                                       |

      +-192.168.1.3                           +-192.168.2.3

      |                                       |

      +-192.168.1.4                           +-192.168.2.4

      |                                       |

      +-192.168.1.5                           +-192.168.2.5

      |                                       |

      +-192.168.1.6                           +-192.168.2.6

      |                                       |

      +-192.168.1.7                           +-192.168.2.7

      |                                       |

      +-192.168.1.8                           +-192.168.2.8

      |                                       |

      +-192.168.1.9                           +-192.168.2.9

      |                                       |

      +-192.168.1.10                          +-192.168.2.10

 

                                     [그림] 실습 구성도

 

 

(자리배치도)

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

200 201 202            203 204 205

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

206 207 208            209 210 211

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

212 213 214            215 216 217

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

218 219 220            221 222 223

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

224 225 226            227 228 229

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

 

자리 번호: 201 -> 번호 할당: 2

        - pcn0   192.168.1.2

        - pcn0:1 192.168.1.202

자리 번호: 203 -> 번호 할당: 2

        - pcn0   192.168.2.2

        - pcn0:1 192.168.2.202

 

 

 

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

1. 공통 작업

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

 

(준비사항) 전체적인 설정

- IPv6 NIC 설정은 없는것으로 한다.

- in.ndpd 데몬이 뜨지 않아야 한다.

- routing table 정보에 default router 설정이 없어야 한다.

- 라우터 설정은 "강사"가 설정한다.

 

# ls /etc/hostname6.*

# rm /etc/hostname6.pcn0

 

# ifconfig pcn0 inet6 down unplumb

# ifconfig lo0 inet6 down unplumb

# ifconfig -a

 

# pgrep -lf in.routed

# pgrep -lf in.rdisc

 

# pkill -9 in.routed

# pkill -9 in.rdisc

 

# pgrep -lf in.ndpd

# pkill in.ndpd    (# pkill -9 in.ndpd)

 

# route flush

 

 

 

 

 

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

2. Router 작업

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

 

(At Router)

 

인터페이스 설정

        pcn0   인터페이스(172.16.8.XXX)

        pcn0:1 가상인터페이스 설정(192.168.[1-2].1)

        pcn1   unplumb

라우터 설정

        in.routed -s

        in.rdisc -r

        ■ ip_forwarding ON

 

 

(1). 인터페이스 설정

 

(a). pcn0 설정

서버와 통신이 되는지 확인한다. 기존의 설정을 그래도 사용한다.

# ifconfig -a

# ping -s 172.16.8.254

 

(b). pcn0:1 가상인퍼테이스 설정(192.168.X.1)

# ifconfig pcn0:1 plumb up

# ifcofnig pcn0:1 192.168.[1-2].1 netmask 255.255.255.0 broadcast +

 

(c). pcn1 unplumb

NAT Device에 연결된 NIC는 unplumb 시켜 놓는다.

# ifconfig pcn1 down unplumb

 

 

 

(2). 라우터 설정

 

# route flush

 

# in.routed -s

# in.rdisc -r

# ndd -set /dev/ip ip_forwarding 1

 

# pgrep -lf in.routed

# pgrep -lf rdisc

# ndd -get /dev/ip ip_forwarding

 

# netstat -nr

(상대방 라우터가 반드시 보여야 한다.)

 

 

 

(3). 라우터 상태 점검(Router1, 예: 172.16.8.200)

 

(IP 설정 점검) Router1

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 172.16.8.200 netmask ffff0000 broadcast 172.16.255.255

        ether 0:c:29:ab:48:bd

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.1 netmask ffffff00 broadcast 192.168.1.255

 

-> pcn1 unplumb 시킴

-> pcn0:1 IP 192.168.1.1 설정

 

 

(Routing Table 점검) Router1

# netstat -nr

Routing Table: IPv4

  Destination           Gateway           Flags  Ref   Use   Interface

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

192.168.1.0          192.168.1.1          U         1     11  pcn0:1

192.168.2.0          172.16.8.205         UG        1      0  pcn0  <----- 정보 확인

172.16.0.0           172.16.8.200         U         1      5  pcn0

224.0.0.0            172.16.8.200         U         1      0  pcn0

127.0.0.1            127.0.0.1            UH       21   5418  lo0

 

 

(Router 설정 점검) Router1

# pgrep -lf in.routed

  567 in.routed -s

# pgrep -lf in.rdisc

  570 in.rdisc -r

# ndd -get /dev/ip ip_forwarding

1

 

 

 

(4). 라우터 상태 점검(Router2, 예: 172.16.8.205)

 

(IP 설정 점검) Router2

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 172.16.8.205 netmask ffff0000 broadcast 172.16.255.255

        ether 0:c:29:da:a8:1e

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.1 netmask ffffff00 broadcast 192.168.2.255

 

-> pcn1 unplumb

-> pcn0:1 IP 192.168.2.1 설정

 

 

(Routing Table 점검) Router2

# netstat -nr

Routing Table: IPv4

  Destination           Gateway           Flags  Ref   Use   Interface

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

192.168.1.0          172.16.8.200         UG        1      0  pcn0   <----- 설정 확인

192.168.2.0          192.168.2.1          U         1      1  pcn0:1

172.16.0.0           172.16.8.205         U         1     17  pcn0

224.0.0.0            172.16.8.205         U         1      0  pcn0

127.0.0.1            127.0.0.1            UH       45  75281  lo0

 

 

(Router 설정 점검) Router2

# pgrep -lf in.routed

 2223 in.routed -s

# pgrep -lf in.rdisc

 2225 in.rdisc -r

# ndd -get /dev/ip ip_forwarding

1

 

 

 

 

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

3. Host 작업

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

 

(At Client) 예: 192.168.2.2

 

(가정) 인터페이스는 Bridge Device 연결된 NIC1(pcn0)만 사용하는것으로 가정한다.

- 인터페이스 설정

        - pcn0 설정 (예: 192.168.[1-2].X)

        - pcn1 unplumb

        - Default Router 설정(192.168.[1-2].1)

- 테스트

 

 

 

(1). 인터페이스 설정

 

(a). pcn0 설정

# ifconfig pcn0 192.168.[1-2].X netmask 255.255.255.0 broadcast + up

 

(b). pcn1 unplumb

# ifconfig pcn1 down unplumb (-> 솔라리스 CDE 환경에서 작업)

# ifconfig -a

 

(c). Default Router 설정

# route flush

# route add default 192.168.[1-2].1

# netstat -nr

 

 

 

(2). Host 설정 점검

 

(IP 설정 점검) 192.168.2.2

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.2 netmask ffffff00 broadcast 192.168.2.255

        ether 0:c:29:4d:b1:ff

 

-> pcn1 unplumb

-> pcn0 IP 192.168.2.2

 

 

(Routing Table 점검) 192.168.2.2

# netstat -nr

Routing Table: IPv4

  Destination           Gateway           Flags  Ref   Use   Interface

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

192.168.2.0          192.168.2.2          U         1      4  pcn0

224.0.0.0            192.168.2.2          U         1      0  pcn0

default              192.168.2.1          UG        1      5          <----- 설정 확인

127.0.0.1            127.0.0.1            UH       20  27673  lo0

 

 

 

 

(IP 설정 점검) 192.168.1.2

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255

        ether 0:c:29:5d:97:e

 

 

(Routing Table 점검) 192.168.1.2

# netstat -nr

Routing Table: IPv4

  Destination           Gateway           Flags  Ref   Use   Interface

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

192.168.1.0          192.168.1.2          U         1      1  pcn0

224.0.0.0            192.168.1.2          U         1      0  pcn0

default              192.168.1.1          UG        1     14        <----- 설정 확인

127.0.0.1            127.0.0.1            UH       35   7139  lo0

 

 

 

192.168.2.2 ------- Router1 ------------------ Router2 ------- 192.168.1.2

          192.168.2.1 172.16.8.205   172.16.8.200 192.168.1.1     |

                 |           |             |            |         |

-------------->  |           |             |            |         |

                             |             |            |         |

-------------------------->  |             |            |         |

                                           |            |         |

---------------------------------------->  |            |         |

                                                        |         |

----------------------------------------------------->  |         |

                                                                  |

----------------------------------------------------------------> |

 

(192.168.2.2) -> (192.168.2.1)

              -> (172.16.8.205)

                  -> (172.16.8.200)

                  -> (192.168.1.1)

                  -> (192.168.1.2)

 

# ping 192.168.2.1

# ping 172.16.8.205

# ping 172.16.8.200

# ping 192.168.1.1

# ping 192.168.1.2

 

 

 

(Trouble Shooting)

라우터에 이상이 있는 경우

- (a). 라우팅 테이블을 확인한다.

- (b). 라우터의 아이피를 재 설정해 본다.

 

호스트에 이상이 있는 경우

- (a). 아이피를 재 설정 해 본다.

 

 

 

 

 

4. Configuring IPv6-Over-IPv4 Tunnels

 

(1). 가상 NIC 추가 및 IPv6 설정 (예: 192.168.1.202 <----> 192.168.2.202)

- pcn0:1 (192.168.[1-2].20X) : 가상 인터페이스 설정

- pcn0에 IPv6 주소 생성

- ip.tun0 설정

 

(At 192.168.1.202) 192.168.1.2

 

(a). pcn0에 IPv6 주소 생성

# ifconfig pcn0 inet6 plumb up

 

(b). pcn0:1(192.168.1.20X) 설정

# ifconfig pcn0 addif 192.168.1.20X up

 

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255

        ether 0:c:29:20:b:b6

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.202 netmask ffffff00 broadcast 192.168.1.255     <----- IP 정보 확인

pcn0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2

        ether 0:c:29:20:b:b6

        inet6 fe80::20c:29ff:fe20:bb6/10                                <----- IPv6 정보 확인

 

 

(At 192.168.2.202) 192.168.2.2

 

(a). pcn0에 IPv6 주소 생성

# ifconfig pcn0 inet6 plumb up

 

(b). pcn0:1(192.168.2.20X) 설정

# ifconfig pcn0 addif 192.168.2.20X up

 

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.2 netmask ffffff00 broadcast 192.168.1.255

        ether 0:c:29:20:b:b6

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.202 netmask ffffff00 broadcast 192.168.1.255     <----- IP 정보 확인

pcn0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2

        ether 0:c:29:20:b:b6

        inet6 fe80::20c:29ff:fe20:bb6/10                                <----- IPv6 정보 확인

 

 

 

(IP Tunnel 설정) 192.168.1.2   -> 192.168.2.2

                 192.168.1.202 -> 192.168.2.202

 

(At 192.168.1.202) 192.168.1.2

 

# ifconfig ip.tun0 inet6 plumb

# ifconfig ip.tun0 inet6 tsrc 192.168.1.202 tdst 192.168.2.202 up

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.2 netmask ffffff00 broadcast 192.168.1.255

        ether 0:c:29:20:b:b6

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.1.202 netmask ffffff00 broadcast 192.168.1.255

pcn0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2

        ether 0:c:29:20:b:b6

        inet6 fe80::20c:29ff:fe20:bb6/10

ip.tun0: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 index 4

        inet tunnel src 192.168.1.202 tunnel dst 192.168.2.202

        tunnel hop limit 60

        inet6 fe80::c0a8:1ca/10 --> fe80::c0a8:2ca       <----- 정보 확인

 

 

(IP Tunnel 설정) 192.168.2.2   -> 192.168.1.2

                 192.168.2.202 -> 192.168.1.202

 

(At 192.168.2.202) 192.168.2.2

 

# ifconfig ip.tun0 inet6 plumb tsrc 192.168.2.202 tdst 192.168.1.202 up

# ifconfig -a

lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1

        inet 127.0.0.1 netmask ff000000

pcn0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.2 netmask ffffff00 broadcast 192.168.2.255

        ether 0:c:29:4d:b1:ff

pcn0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2

        inet 192.168.2.202 netmask ffffff00 broadcast 192.168.2.255

pcn0: flags=2000841<UP,RUNNING,MULTICAST,IPv6> mtu 1500 index 2

        ether 0:c:29:4d:b1:ff

        inet6 fe80::20c:29ff:fe4d:b1ff/10

ip.tun0: flags=2200851<UP,POINTOPOINT,RUNNING,MULTICAST,NONUD,IPv6> mtu 1480 index 6

        inet tunnel src 192.168.2.202 tunnel dst 192.168.1.202

        tunnel hop limit 60

        inet6 fe80::c0a8:2ca/10 --> fe80::c0a8:1ca      <----- 정보 확인

 

# ping fe80::c0a8:1ca

# ping -s fe80::c0a8:1ca

 

=> 패킷 캡쳐를 통해 확인해 본다.

 

 

 

 

 

 

 

 

 

 

 

 

 


2008. 8. 29. 17:48

ref_ipv6

 

 

 

 

[첫번째그림] IP Autoconfiguration

 

---------------------------------------- Router

         |               |

       ClientA         ClientB

 

(1). EUI-64 생성

7번째 bit toggle

중간에 ffeb 삽입

 

 

 

(2). Link-Local Address 생성

Fe80|                   | eui -64삽입

 

 

 

 

(3). Prefix 설정(Global Address 생성)

prefix  | eui - 64

 

 

 

 

 

 

[두번째그림] Router Prfix Modification

 

---------------------------------------- Router

         |               |        Prefix 1 -> Prefix 2

       ClientA         ClientB

prefix1|mac1        prefix1|mac2

(1). 라우터 Prefix 변경

prefix1    ->  prefix2

 

(2). Unycast Address 설정

prefix2|mac1,2

 

 

 

 

[세번째그림] IP Duplicated Address Detection

 

 

---------------------------------------- Router

         |               |

       ClientA         ClientB

       in.ndpd         in.ndpd

       - IP1           - IP1 or IP2

 

 

(1). NDP Messages 1(ARP Request와 비슷)

 

 

 

 

(2). NDP Messages 2(ARP Reply와 비슷)

 

 

 

2008. 8. 29. 17:36

ref-NICspeedconfiguration



  Network Interface Parameter Administration



INDEX
____________________________________________________

1. NIC(Network Interface Card) Instance Name
2. Network Interface Parameter Configuration Problem
3. Network Interface Parameter Configuration
4. Network Interface Status Verification
5. Driver Parameters, Status
6. Auto-Negotiation
7. Reference URL



1. NIC(Network Interface Card) Instance Name
_______________________________________________

썬에서 지원하는 NIC 인스턴스 이름은 다음과 같다. 아래의 NIC 인스턴스 이름은 솔라리
스10 버전을 기준으로 작성되었다.

-----------------------------------------------------------------------------------
NIC     Description
-----------------------------------------------------------------------------------
bge - SUNW,bge Gigabit Ethernet driver for Broadcom BCM57xx
ce - Cassini Gigabit-Ethernet device driver
chxge - Chelsio Ethernet network interface controllers
dmfe - Davicom Fast Ethernet driver for Davicom DM9102A
dnet - Ethernet driver for DEC 21040, 21041, 21140 Ethernet cards
elxl - 3Com Ethernet device driver
eri - eri Fast-Ethernet device driver
ge - GEM Gigabit-Ethernet device driver
hme - SUNW,hme Fast-Ethernet device driver
ipge - PCI-E Gigabit-Ethernet device driver for Intel 82571?based ethernet
   controller.
ixgb - SUNWixgb, 10 Gigabit Ethernet driver for Intel 82597ex controllers
   and Sun Kirkwood adapters
nge - Nvidia ck8-04 Gigabit Ethernet driver
nxge - Sun 10/1 Gigabit Ethernet network driver
pcelx - 3COM EtherLink III PCMCIA Ethernet Adapter
pcn - AMD PCnet Ethernet controller device driver
qfe - SUNW,qfe Quad Fast-Ethernet device driver
rge - Realtek Gigabit Ethernet Network Adapter driver
rtls - Realtek Fast Ethernet 8139?based network interface controllers
sk98sol - SysKonnect Gigabit Ethernet SK-98xx device driver
spwr - SMC EtherPower II 10/100 (9432) Ethernet device driver
xge - Neterion Xframe 10Gigabit Ethernet Network Adapter driver
-----------------------------------------------------------------------------------

위의 표는 다음을 참고 하였습니다.
http://docs.sun.com
Solaris 10 Reference Manual Collection
>> man pages section 7: Device and Network Interfaces
>> Device and Network Interfaces



2. Network Interface Parameter Configuration Problem
________________________________________________________

서버의 Network Interface는 기본적으로 Auto Negotiation 기능이 활성화 되어 허브의 포
트와 동기화 되게 된다. 10/100/1000, Half/Full Duplex에 맞게 설정이 된다. 하지만 이
기능(Auto Negotiation) 없는 장비나 또는 다른 이유로 하여 Negotiation을 하지 못하는
경우가 존재한다. 이런 경우 Network Interface가 활성화 되지 않거나 다운로드 속도가
엄청 느리게 된다. 이 경우에는 Auto Negotiation 기능을 사용하지 말고 연결된 장비의
설정에 맞추어 수동으로 설정하여야 한다.

만약 아래와 같이 서로 통신하는 방식이 틀리게 설정이 된경우 파일 다운로드 속도는 현
저하게 떨어지게 된다. Server 쪽의 NIC가 10/100Mbps를 지원하고 Half/Full Duplex을 지
원하는 인터페이스라면 HUB의 Port쪽은 당연히 100M로 설정이 될것이다. 그럼 Server 쪽
도 100M 설정이 될것이다. 하지만 Auto Neg. 설정이 비정상적으로 동작하게 되어서 설정
이 잘못되는 경우가 발생할 수 있다. 이런 경우 네트워크 통신이 원할하게 진행되지 않는
다.

해결책은 HUB에 콘솔 케이블을 연결하고 HUB Port 설정을 NIC쪽에 맞추던지, NIC를 HUB
Port쪽에 맞추어 주어야 한다. 아니면 둘다 설정을 고정으로 맞추어 주면 된다.


       [HUB] Port ---------------------- NIC [Server]
            Auto Neg.                    Auto Neg.
            100M Full Duplex             10M Half Duplex

             [그림] NIC Auto Negotiation 문제


link mode   전송모드 half / full duflex
lind speed  전송속도 10/100/1000m

3. Network Interface Parameter Configuration
_______________________________________________

다음은 hme Interface에 관련해 설정하는 예를 들었다.

(1). How to Network Interface Device Driver Parameter Configuration

방식은 3가지가 존재한다.
- ndd 명령어를 사용하는 방법
- /etc/system 파일을 사용하는 방법
- hme.conf 파일을 사용하는 방법


(2). ndd 명령어를 사용하는 방법

ndd 명령어를 통해서 hme 인터페이스에 관해서 (a)Autho Negotiation Mode로 동작을 시킬
수도 있고 Local Transceiver를 (b)Force Mode로 설정할 수도 있다.


(a) Auto Negotiation Mode로 동작시키는 방법

다음의 패러미터 중 한개이상의 1로 설정이 되어야 한다.
* adv_100T4_cap
* adv_100fdx_cap
* adv_100hdx_cap
* adv_10fdx_cap
* adv_10hdx_cap

위의 패러미터 중 한개이상의 1이 설정이 되면, 1로 설정된 값을 Link Partner에게 전달
하게 된다. Link Partner도 이 전달된 값을 참고하여 우선순위가 높은 가장 좋은 방법을
택하게 된다. 우선순위는 가장 성능이 잘 나는 형태가 높다.

10,100은 전송속도이고 T4, fdx, hdx는 전송모드이다.

(예) 100Mbps Full-duplex로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 1
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

(예) 100 Mbps half-duplex 로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 1
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 1
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

(예) 10Mbps full-duplex 로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 1
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 1
ndd -set /dev/hme adv_10hdx_cap 0

(예) 10Mbps half-duplex로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg 1
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 1


(b) Local Transceiver Force Mode로 동작시키는 방법

다음의 패러미터 중 한개가 설정이 되어야 한다.
* adv_100T4_cap
* adv_100fdx_cap
* adv_100hdx_cap
* adv_10fdx_cap
* adv_10hdx_cap

(예) 100Mbps Full-duplex로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

(예) 100 Mbps half-duplex 로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 1
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

(예) 10Mbps full-duplex 로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 1
ndd -set /dev/hme adv_10hdx_cap 0

(예) 10Mbps half-duplex로 사용할 경우
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 0
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 1


(c) 설정을 부팅시에도 적용하기 위해서 스크립트 생성

ndd 명령어로 설정한 값은 리부팅이 되면 없어지는 값이 된다. 그래서 부팅시에 실행할수
있도록 Startup Script을 생성하여 설정 하면된다.

# vi /etc/init.d/nddset.sh
----------------------------------------
#!/sbin/sh
ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0
----------------------------------------
# ln -s /etc/init.d/nddset /etc/rc2.d/S98nddset


(d) Instance Number

만약 NIC가 여러개 존재하는 경우 각 네트워크 인터페이스마다 설정을 해야 한다.
instance의 기본값은 0이다. 0은 첫번째 인터페이스를 나타낸다.

다음은 NIC가 2개 존재하는 경우 Force Mode, 100Mbps, Full-duplex로 설정하는 예이다.

ndd -set /dev/hme instance 0
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

ndd -set /dev/hme instance 1
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0

ndd -set /dev/hme instance 2
ndd -set /dev/hme adv_autoneg_cap 0
ndd -set /dev/hme adv_100T4_cap 0
ndd -set /dev/hme adv_100fdx_cap 1
ndd -set /dev/hme adv_100hdx_cap 0
ndd -set /dev/hme adv_10fdx_cap 0
ndd -set /dev/hme adv_10hdx_cap 0



(3). /etc/system 파일을 사용하는 경우

/etc/system 파일을 설정하는 것도 (a)Autho Negotiation Mode로 동작을 시킬수도 있고
Local Transceiver를 (b)Force Mode로 설정할 수도 있다. ndd 명령어를 사용하는 방법과
거의 흡사하다. 설정하는 패러미터의 이름만 약간 틀릴뿐이다. /etc/system 파일은 부팅
시에 커널에 의해 읽혀지는 파일이므로 설정 후 적용하기 위해서 반드시 리부팅을 해야
한다.

다음은 /etc/system 파일에 Force Mode로 설정한 예이다.


(예) 10MB full duplex로 설정
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100T4_cap=0
set hme:hme_adv_100fdx_cap=0
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_10fdx_cap=1
set hme:hme_adv_10hdx_cap=0

(예) 10MB half duplex로 설정
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100T4_cap=0
set hme:hme_adv_100fdx_cap=0
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_10fdx_cap=0
set hme:hme_adv_10hdx_cap=1

(예) 100MB full duplex로 설정
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100T4_cap=0
set hme:hme_adv_100fdx_cap=1
set hme:hme_adv_100hdx_cap=0
set hme:hme_adv_10fdx_cap=0
set hme:hme_adv_10hdx_cap=0

(예) 100MB half duplex로 설정
set hme:hme_adv_autoneg_cap=0
set hme:hme_adv_100T4_cap=0
set hme:hme_adv_100fdx_cap=0
set hme:hme_adv_100hdx_cap=1
set hme:hme_adv_10fdx_cap=0
set hme:hme_adv_10hdx_cap=0


(4). hme.conf 파일을 사용하는 방법

이 부분에 관해서는 생략한다. 다음 문서를 참고하기 바란다.
http://docs.sun.com/source/816-2348-10/paramset.html#pgfId-640749



4. Network Interface Status Verification
__________________________________________

테스트는 hme 인터페이스를 예로 들었습니다.

(1). dmesg 명령어를 사용하여 현재 Network Interface의 스피드 설정 확인

# dmesg | grep hme
...
Oct  1 17:42:03 atmsw-27 genunix: [ID 936769 kern.notice] hme0 is
                            /sbus@1f,0/SUNW,hme@e,8c00000Oct
Oct  1 17:42:07 atmsw-27 hme: [ID 517527 kern.notice] SUNW,hme0 :
                            Internal Transceiver Selected.Oct 
Oct  1 17:42:07 atmsw-27 hme: [ID 517527 kern.notice] SUNW,hme0 :
                            Auto-Negotiated  100 Mbps Half-Duplex Link Up


(2). ndd 명령어를 사용하여 현재 Network Interface의 스피드 설정 확인

# ndd /dev/hme \?
# ndd -set /dev/hme instance 0
# ndd -get /dev/hme link_speed
1
# ndd -get /dev/hme link_mode
1

* link_speed가 0 이면 10Mbps, 1 이면 100Mbps이다. link_mode가 0 이면 half-duplex,
  1 이면 full-duplex이다.

* 만약 한개의 hme 인터페이스가 더 존재한다면 다음과 같이 instance을 1로 설정하여 점
  검하면 된다. 만약 또 다른 hme가 존재한다면 instance을 2로 설정하여 점검하면 된다.
  아무런 설정이 없는 경우 기본값인 instance는 0이다.

# ndd -set /dev/hme instance 1
# ndd -get /dev/hme link_speed
1
# ndd -get /dev/hme link_mode
1


(3). netstat -k 명령어를 사용하여 현재 Network Interface 스피드 설정 확인

# netstat -k hme0
hme0:
ipackets 317522 ierrors 0 opackets 9790 oerrors 0 collisions 43
defer 0 framing 0 crc 0 sqe 0 code_violations 0 len_errors 0
ifspeed 100000000 buff 0 oflo 0 uflo 0 missed 0 tx_late_collisions 0
retry_error 0 first_collisions 0 nocarrier 0 nocanput 0
allocbfail 0 runt 0 jabber 0 babble 0 tmd_error 0 tx_late_error 0
rx_late_error 0 slv_parity_error 0 tx_parity_error 0 rx_parity_error 0
slv_error_ack 0 tx_error_ack 0 rx_error_ack 0 tx_tag_error 0
rx_tag_error 0 eop_error 0 no_tmds 0 no_tbufs 0 no_rbufs 0
rx_late_collisions 0 rbytes 141596475 obytes 1237354 multircv 0 multixmt 9
brdcstrcv 307824 brdcstxmt 59 norcvbuf 0 noxmtbuf 0   newfree 0
ipackets64 317522 opackets64 9790 rbytes64 141596475 obytes64 1237354 align_errors 0
fcs_errors 0   sqe_errors 0 defer_xmts 0 ex_collisions 0
macxmt_errors 0 carrier_errors 0 toolong_errors 0 macrcv_errors 0
link_duplex 0 inits 12 rxinits 0 txinits 0 dmarh_inits 0
dmaxh_inits 0 link_down_cnt 0 phy_failures 0 xcvr_vendor 524311
asic_rev 193

- ifspeed 패러미터는 100Mbps을 의미한다.
- link_duplex는 half-duplex을 의미한다.



5. Driver Parameters, Status
_______________________________

hme 인터페이스에 대한 예를 들었다.

-----------------------------------------------------------------------------------
Parameter          Status           Description
-----------------------------------------------------------------------------------
transceiver_inuse  Read only        Defines the current status
link_status        Read only        Defines the current status
link_speed         Read only        Defines the current status
link_mode          Read only        Defines the current status
ipg1               Read and write   Inter-packet gap parameter
ipg2               Read and write   Inter-packet gap parameter
use_int_xcvr       Read and write   Operational mode parameter
pace_size          Read and write   Operational mode parameter
adv_autoneg_cap    Read and write   Operational mode parameter
adv_100T4_cap      Read and write   Operational mode parameter
adv_100fdx_cap     Read and write   Operational mode parameter
adv_100hdx_cap     Read and write   Operational mode parameter
adv_10fdx_cap      Read and write   Operational mode parameter
adv_10hdx_cap      Read and write   Operational mode parameter
autoneg_cap        Read only        Local transceiver auto negotiation capability
100T4_cap          Read only        Local transceiver capability of the hardware
100fdx_cap         Read only        Local transceiver capability of the hardware
100hdx_cap         Read only        Local transceiver capability of the hardware
10fdx_cap          Read only        Local transceiver capability of the hardware
10hdx_cap          Read only        Local transceiver capability of the hardware
lp_autoneg_cap     Read only        Link partner auto negotiation capability
lp_100T4_cap       Read only        Link partner capability
lp_100fdx_cap      Read only        Link partner capability
lp_100hdx_cap      Read only        Link partner capability
lp_10fdx_cap       Read only        Link partner capability
lp_10hdx_cap       Read only        Link partner capability
instance           Read and write   Device instance
lance_mode         Read and write   Additional delay before transmitting a packet
ipg0               Read and write   Additional delay before transmitting a packet
-----------------------------------------------------------------------------------


(Table) Read-Only Parameters Defining the Current Status
-----------------------------------------------------------------------------------
Parameter          Description                    Values
-----------------------------------------------------------------------------------
link_status        Current link status            0 = Link down
                                                  1 = Link up

transceiver_inuse  Current transceiver status     0= Internal transceiver
                                                  1= External transceiver

link_speed         Valid only if the link is up   0 = 10 Mbps
                                                  1 = 100 Mbps

link_mode          Valid only if the link is up   0 = Half duplex
                                                  1 = Full duplex
-----------------------------------------------------------------------------------


(Table) Read-Write Inter-Packet Gap Parameter Values and Descriptions
-----------------------------------------------------------------------------------
Parameter          Values             Description
                   (Byte-time)
-----------------------------------------------------------------------------------
ipg1               0, 255             ipg1 = 8 (default at initialization)
ipg2               0, 255             ipg2 = 4 (default at initialization)
-----------------------------------------------------------------------------------


(Table) Parameters Defining lance_mode and ipg0
-----------------------------------------------------------------------------------
Parameter    Values   Description
-----------------------------------------------------------------------------------
lance_mode     0      lance_mode disabled
               1      lance_mode enabled (default)

ipg0           0-31   Additional IPG before transmitting a packet (after receiving
                      a packet) -- Note The default value is 16 nibble-times, which
                      is 6.4 microseconds for 10 Mbps and 0.64 microseconds for
                      100 Mbps
-----------------------------------------------------------------------------------


(Table) Operational Mode Parameters
-----------------------------------------------------------------------------------
Parameter          Descrition
-----------------------------------------------------------------------------------
adv_autoneg_cap    Local transceiver capability advertised by the hardware
                   0 = Forced mode
                   1 = Auto-negotiation (default)

adv_100T4_cap      Local transceiver capability advertised by the hardware;
                   read/write parameter
                   0 = Not 100BASE-T4 capable (default)
                   1 = 100BASE-T4 capable

adv_100fdx_cap     Local transceiver capability advertised by the hardware;
                   read/write parameter
                   0 = Not 100 Mbit/sec full-duplex capable
                   1 = 100 Mbit/sec full-duplex capable (default)
 
adv_100hdx_cap     Local transceiver capability advertised by the hardware;
                   read/write parameter
                   0 = Not 100 Mbit/sec half-duplex capable
                   1 = 100 Mbit/sec half-duplex capable (default)
 
adv_10fdx_cap      Local transceiver capability advertised by the hardware;
                   read/write parameter
                   0 = Not 10 Mbit/sec full-duplex capable
                   1 = 10 Mbit/sec full-duplex capable (default)
 
adv_10hdx_cap      Local transceiver capability advertised by the hardware;
                   read/write parameter
                   0 = Not 10 Mbit/sec half-duplex capable
                   1 = 10 Mbit/sec half-duplex capable (default)
 
use_int_xcvr       Local transceiver capability selected for networking by the user
                   0 = External transceiver is used if connected
                   1 = Internal transceiver is used, even if the external transceiver
                       is connected (default)
-----------------------------------------------------------------------------------



(Table) Read-Only Transceiver Capabilities
-----------------------------------------------------------------------------------
Parameter           Descrition
-----------------------------------------------------------------------------------
autoneg_cap         Local transceiver capability of the hardware
                    0 = Not capable of auto-negotiation
                    1 = Auto negotiation capable

100T-4_cap          Local external transceiver capability of the hardware
                    0 = Not 100BASE-T4 capable
                    1 = 100BASE-T4 capable
 
100fdx_cap          Local transceiver capability of the hardware; initialized at
                    startup
                    0 = Not 100 Mbit/sec full-duplex capable
                    1 = 100 Mbit/sec full-duplex capable
 
100hdx_cap          Local transceiver capability of the hardware; initialized at
                    startup
                    0 = Not 100 Mbit/sec half-duplex capable
                    1 = 100 Mbit/sec half-duplex capable
 
10fdx_cap           Local transceiver capability of the hardware; initialized at
                    startup
                    0 = Not 10 Mbit/sec full-duplex capable
                    1 = 10 Mbit/sec full-duplex capable
 
10hdx_cap           Local transceiver capability of the hardware; initialized at
                    startup
                    0 = Not 10 Mbit/sec half-duplex capable
                    1 = 10 Mbit/sec half-duplex capable
 
-----------------------------------------------------------------------------------


(Table)
-----------------------------------------------------------------------------------
Parameter           Values
-----------------------------------------------------------------------------------
lp_autoneg_cap      0 = No auto-negotiation
                    1 = Auto-negotiation
 
lp_100T4_cap        0 = No 100BASE-T4
                    1 = 100BASE-T4
 
lp_100fdx_cap       0 = No 100 Mbit/sec full-duplex transmission
                    1 = 100Mbit/sec full-duplex
 
lp_100hdx_cap       0 = No 100 Mbit/sec half-duplex transmission
                    1 = 100 Mbit/sec half-duplex
 
lp_10fdx_cap        0 = No 10 Mbit/sec full-duplex transmission
                    1 = 10 Mbit/sec full-duplex
 
lp_10hdx_cap        0 = No 10 Mbit/sec half-duplex transmission
                    1 = 10 Mbit/sec half-duplex
 
-----------------------------------------------------------------------------------



6. Auto-Negotiation
______________________

Auto-Negotiation?

Auto-negotiation matches the local device speed and mode with the link partner
capability.

The auto-negotiation protocol does the following.
- Identifies all link partner-supported modes of operation
- Advertises its capabilities to the link partner
- Selects the highest common denominator mode of operation based on the following
  priorities
     (EX) 100BASE-T4  => 100M Full-duplex => 100M Half-duplex =>
          10M Full-duplex => 10M Half-duplex

The link partner is the networking device (system, Ethernet hub, or Ethernet switch)
at the other end of the link or cable.  



7. Reference URL
_____________________

http://docs.sun.com/source/816-2348-10/index.html
http://ntech.in/blog/index.php/post/14
http://www.5gibsons.com/scripts_etc/ce_admin.txt
http://docs-pdf.sun.com/819-3159/819-3159.pdf
http://docs-pdf.sun.com/817-7634-10/817-7634-10.pdf
http://www.tek-tips.com/faqs.cfm?fid=5832
http://oldfaq.phoneboy.com/gurus/200403/msg00057.html
http://sysunconfig.net/unixtips/set_nic_settings.txt
http://www.webservertalk.com/archive103-2006-1-1361811.html
http://www.sun.com/bigadmin/scripts/submittedScripts/network-config.sh.txt
http://www.bsdconsulting.no/tools/netlink
http://www.wowunix.com/cgi-bin/CrazyWWWBoard.cgi?mode=read&num=249&db=solaris&fval
                                         =%C1%B6%C8%B8&backdepth=1

2008. 8. 29. 17:34

ref_ethernet



  Fast Ethernet / Gigabit Ethernet



1. Fast Ethernet
___________________


(1). 개요
패스트 이더넷은 스위치를 중심으로 실제 데이터를 전송한다.이때 스위치는 리피터
기능을 수행하여 송신 시스템으로 부터 오는 모든 신호를 증폭 시킬 수 있으며 동
시에 여러 포트로 부터 오는 모은 수신되는 신호에 대하여 다른 모든 포트로 중계한
다.


(2). 동작
- 패스트 이더넷 네트워크에 참여하는 모든 호스트는 신호를 스위치에게 보내게 된다.
- 스위치는 수신되는 모든 신호를 동시에 해당 수신 시스템에게 전송한다.
- 스위치는 충돌을 감지할 필요가 없는 CSMA/CD Free 방식을 사용한다.


(3). 특징
- 10Mbps NIS을 장착한 시스템도 Fast Ethernet에 접속될수 있다.
- 스타형의 토폴로지를 사용한다.
- 스위치 네트워크의 경우 CAMA/CD Free 방식을 사용한다.
- 일반 패스트 이더넷은 CAMA/CD Backoff 방식을 사용한다.


(4). 종류
[100Base-TX]
- 카테고리 5 UTP 케이블 사용
- 4쌍의 동선 중 2쌍만 사용
- 10Base-T, 100Base-TX 2쌍의 동선을 사용하므로 호환가능하다.

[100Base-T4]
- 카테고리 3,4,5 UTP 케이블 사용
- 4쌍의 동선을 모두 사용

[100Base-FX]
- 2쌍의 다중 모드 광섬유 케이블을 사용
- UTP을 이용하는 이더넷이 광섬유를 사용하는 경우보다 거리 제한이 더 크다.



2. Gigabit Ethernet
_______________________

(1). 개요
IEEE의 표준안 802.3z(1000Base-X)와 802.3ab(1000Base-T) 규격으로 1Gbps의 대용량
대역폭을 제공하며 이더넷 표준과 완벽하게 호환된다.


(2). 특징
- 스타형의 토플로지를 사용한다.
- 전송매체는 광섬유 케이블, UTP를 모두 지원한다.


(3). 종류
[1000Base-LX]
- 1Gbps의 속도, 베이스 밴드 전송
- 2쌍의 장파장 다중모드 또는 단일모드 광섬유 사용 가능

[1000Base-SX]
- 1Gbps의 속도, 베이스 밴드 전송
- 2쌍의 단파장 다중 모드 광섬유를 사용

[1000Base-CX]
- 1Gbps의 속도, 베이스 밴드 전송
- 2쌍의 STP 사용

[1000Base-TX]
- 1Gbps의 속도, 베이스 밴드 전송
- 4쌍 또는 8쌍의 카테고리 5 UTP 사용



2008. 8. 29. 17:34

ref_icmp



  ICMP(Internet Control Messages Protocol)



1. ICMP?
IP 프로토콜의 문제점을 해결하기 위해 생성된 프로토콜로 데이터 전송시 제어 정보 전달
을 위한 프로토콜을 의미한다.

[Ref.] IP 프로토콜의 문제점
송신자 시스템이 수신자 시스템에게 데이터그램을 전송할때 비 연결성에 주안점을 둔 IP
프로토콜은 오류제어와 같은 메커니즘이 없으므로 이로 인해 다음과 같은 데이터 그램 전
송시 문제가 생길수 있다.
- 최종 목적지 도달불가나 호스트 사용불가를 탐지 불가능
- 경로 설정 루프의 오류로 인한 TTL 매캐변수 만료 전달 불가능
- 데이터그램 단편의 사라짐으로 인한 데이터그램이 전달되지 않을 가능성
- 단편화가 혀용되지 않고 데이터그램 크기가 중간 네트워크에 비해 너무 커서 데이터 그
  램을 발송 불가능
- 라우터에서 네트워크 혼잡으로 인한 수신 데이터그램을 처리 할 수 없을 경우가 발생



2. ICMP의 주요 기능
- 모든 IP 구현은 ICMP를 동반해야 한다.
- ICMP는 IP 패킷과 함께 실행된다. 즉 ICMP는 비록 IP 모듈에서 구현되지만 IP의 클라이언
  트라고 할 수 있다.
- ICMP는 오류보고나 제어 목적이지 IP 데이터 패킷을 신뢰할 수 있는 전송을 가능하게 하
  는 것은 아니다.
- ICMP는 첫번째 IP 데이터그램 단편화에 대해서만 오류를 보고한다. 즉, 단편 오프셋 필
  드가 0(zero)으로 설정된 IP 데이터그램 단편만을 보고한다는 의미이다. 나머지 데이터
  그램 단편에 대해 ICMP 메세지를 보내지 않게 하는 것이다.
- ICMP는 IP 데이터그램에 관한 오류보고 메커니즘이지 데이터그램 문제에 관한 오류 메시
  지는 생성하지 않는다.


[Ref.] ICMP 프로토콜 사용시 오류보고를 할수 없는 상황
- ICMP 메시지의 경로 설정 또는 전달시
  ICMP 오류메시지 생성시 메시지 개수가 늘고 네트워크 트래픽 발생 우려가 있다.
- IP 동보전송 또는 다중 전송 데이터그램 전송시
  동보전송이나 다중 전송시 발생하는 ICMP 오류메시지는 브로드캐스팅, 멀티캐스팅 데이터
  그램을 수신하는 각 노드가 ICMP 메시지를 생성하여 네트워크 트래픽 발생 우려
- 데이터링크 계층 동보전송 또는 다중 전송시
  위의 경우와 같음
- 루프백 주소 127.x.x.x 나 0.0.0.0과 같은 고유 IP 노드를 식별하지 않는 출발지 주소
  또는 네트워크 접두어가 0인 주소를 가진 데이터그램 전송시



3. ICMP 구조

송신 시스템에게 IP 전달에 대한 다양한 메시지를 전달하기 위한 프로토콜이다.


(1). 메시지 종류

오류보고 메시지(Error Reporting Messages)
 Type 3 : 목적지 도달 불가
 Type 4 : 발신지 억제
 Type 5 : 경로 재지정
 Type 11: 시간 초과
 Type 12: 매개변수 문제

질의 메시지(Query Messages)
 Type 8 : Echo Request
 Type 0 : Echo Reply
 Type 9 : Router 광고
 Type 10: Router 요청
 Type 13: Timestamp Request
 Type 14: Timestamp Reply
 Type 15: IP 정보 요구(구형)
 Type 16: IP 정보 응답(구형)
 Type 17: 주소마스크 요구
 Type 18: 주소마스크 응답


(2). 메시지 형식

총 8Bytes 헤더로 구성되어 있으며 처음 4Bytes는 모든 ICMP에서 동일하며 나머지 4Bytes
는 조금씩 다르게 구성되어 있다.


+------------+------------+---------------------------------+
|   Type     |    Code    |    Checksum                     |
+-----------------------------------------------------------+
|                Type 별로 다른 부분                        |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                   [그림] ICMP 메시지 형식


(3). ICMP & IP 상관 관계

ICMP는 TCP/IP 모델 중 Internet 계층에 속하며 IP 모듈 내 ICMP 모듈이 포함된 형태의 관
계성을 갖는다.

-------------------------------------------
Application Layer        (예) ping 명령어

-------------------------------------------
Transport Layer                |
                               V
-------------------------------------------
Internet Layer               ICMP
                             IP
-------------------------------------------
Network Interface Layer      Packet

-------------------------------------------
Hardware Layer               Signal

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


(3-1) ICMP 캡슐화

ICMP 메시지는 인터넷과 라우터를 거쳐서 운반되어야 하므로 IP에 의해 캡슐화 되어 진다.
즉, IP가 없으면 상위 계층 프로토콜 데이터는 라우터 경계에 도달할 수 없게 된다. 이는
ICMP 메시지가 IP 데이터 그램의 데이터 부분에 포함된다는 것을 의미한다.

(특징) ICMP는 IP 데이터그램의 일부에 포함
       IP 헤더 중 프로토콜 종류 번호는 1로 명시


                  +-------------------------------------------+
                  |         ICMP 데이터         |
                  +-------------------------------------------+
                                                            
         +--------+-------------------------------------------+
         | IP헤더 |         IP 데이터그램        |
         +--------+-------------------------------------------+
                                                            
+--------+----------------------------------------------------+
|DataLink|                  프레임 데이터        |
|Header  |                      (MTU)                         |
+--------+----------------------------------------------------+

                    [그림] ICMP Encapsulation


(4). ICMP 유형


■ ICMP 유형 8, 0
에코 요청/응답(Echo Request/Reply Header)


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=8   |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|       Identifier        |    Sequence Number              |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] ICMP Echo Request

Identifire 필드와 Sequence Number 필드는 프로토콜에 의해 전형적으로 정의되지는 않았
으며 송신자에 의해 임의로 사용될 수 있음.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=0   |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|       Identifier        |    Sequence Number              |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] ICMP Echo Reply


■ ICMP 유형 3
목적지 미도달(Destination Unreachable)

IP패킷은 최적의 경로를 통해 목적지에 도착하려고 하지만 모든 패킷이 전달되지는 않는다.
일반적인으로 이 경우 패킷이 전달되지 않은 라우터에서 탐지되고 ICMP 유형 3을 출발지
호스트에게 전달한다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=3   | Code=0~15  |    Checksum                     |
+-----------------------------------------------------------+
|                       Not Used                            |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] Network Unrereachable Messages


코드(Code)는 다음표를 참고하자.

[표] 코드 유형(Code)
----------------------------------------------------------------------------------
Code Description
----------------------------------------------------------------------------------
0 - 하드웨어 고장등의 이유로 네트워크에 도달할 수 없음. 라우터만 생성가능
1 - 호스트에 도달할 수 없음. 라우터에 의해서만 생성 가능
2 - 프로토콜에 도달할 수 없음. 즉, IP 데이터그램이 도착했으나 상위 TCP 프로토
   콜이 수행되지 않고 있다면 이 메시지가 보내짐. 목적지 호스트만 생성 가능
3 - 포트에 도달할 수 없음. 데이터그램이 향하고 있는 응용프로세스가 수행되지
   않고 있음. 목적지 호스트만 생성 가능함.
4 - 단편화가 필요하나 데이터그램의 DF 필드가 설정되어 있음. 즉 다른 네트워크로
   보내기 위해서는 데이터그램을 잘라야 하는데 자를 수 없음.
5 - 발신지 라우팅이 수행될수 없음. 발신지 라우팅 옵션에 정의된 한개 이상의 라
   우터를 방문 할 수 없음(엄격한 소스 라우팅이 설정된 경우에 발생)
6 - 목적지 네트워크가 알려져 있지 않음. 0번과는 다르게 목적지 네트워크에 대한
   정보를 가지고 있지 않은 경우 발생.
7 - 목적지 호스트가 알려져 있지 않음. 0번과는 다르게 목적지 호스트의 존재를 라
   우터가 알고 있지 못하는 경우 발생.
8 - 발신지 호스트가 고립되어 있음.
9 - 목적지 네트워크와의 통신이 관리상의 이유로 금지되어 있음.
10 - 목적지 호스트로의 통신이 관리상의 이유로 금지되어 있음.
11 - 명시된 서비스 유형에 대해 네트워크에 도달할 수 없음.
12 - 명시된 서비스 유형에 대해 호스트에 도달할 수 없음.
13 - 관리자가 필터를 유형에 대해 호스트에 도달할 수 없음.
14 - 호스트 우선순위가 위반되었기 때문에 호스트에 도달할 수 없음. 요청된 우선순
   위가 목적지를 향해서는 허용되지 않을 경우 발생.
15 - 우선순위가 충분히 높지 않아서 호스트에 도달할 수 없음. 네트워크 관리자가
   네트워크의 운용을 위해 우선 순위의 최소값을 설정하였는데 데이터그램의 우선
   순위가 최소값보다 낮을때 발생.
----------------------------------------------------------------------------------


■ ICMP Type 4
출발지 억제(Source Quench)

라우터 집중?

송신시스템이 100Mbps급 이더넷을 통해 라우터로 패킷을 보내지만 라우터 외부 이더넷 인
터페이스가 1.544Mbps 밖에 되지 않는다면 일시적으로 라우터 버퍼는 더 이상 송신 시스템
에서 보내온 패킷을 받지 못한 상태에 빠지게 된다. 이것을 라우터 집중이라고 한다.


해결책

집중현상을 보이고 있는 라우터가 송신자 시스템에게 버퍼가 가득차 더 이상 패킷을 받을
수 없다는 메시지를 보냄으로써 해결할 수 있으며, 이는 ICMP 유형 4를 사용하여 전달하면
된다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=4   |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|                       Not Used                            |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] Route Source Quench



■ ICMP Type 5
라우트 재지정(Route Redirection)

라우터간에 서로 경로 설정표를 주고 받음으로써 경로 설정에 관한 최적의 정보 또는 최
적에 가까운 정보를 갖게 되지만 호스트는 최소한 경로 설정 정보를 갖도록 설계 된다.
이 때 호스트는 데이터그램을 전달하도록 하기 위해 라우터에서 제공하는 최적의 경로로
데이터그램을 전달하도록 하기 위해 라우터에서 제공하는 최적의 경로로 데이터그램을 전
달하려고 하며 라우터가 자기 구간의 부하나 트래픽으로 인해 다른 라우터에게 데이터그
램을 전송하기 위해 생성되는 메시지이다.

라우터가 송신하고자 하는 데이터그램을 좀 더 좋은 경로로 보내기 위해 다수 라우터 중
최적의 라우터를 탐지할 경우 이를 알리고자 위해서다.


                                RIP/OSPF
Internet -------- Router1 ------------------ Router2 --------- Internet
               172.16.8.254       |        172.16.0.1
                                  |
                            HOSTA(172.16.8.XXX)

- RIP(Routing Information Protocol)
- OSPF(Open Shortest Path First)


■ ICMP Type 9
라우터 광고(Route Advertisement)

ICMP 유형 9, 10은 호스트들이 직접 연결된 네트워크의 모든 라우터를 동적으로 발견할
수 있게 해 주는 ICMP 라우터 발견 메커니즘을 구현하기 위해서 사용한다. 라우터가 사용
하는 설정 프로토콜과 상관없이 모든 라우터를 찾을 수 있다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=9   |   Code=0   |        Checksum                 |
+-----------------------------------------------------------+
| Number of  | Address    |        Life Time                |
| Address    | Entry Size |                                 |
+-----------------------------------------------------------+
|             Router Address 1                              |
+-----------------------------------------------------------+
|             Router Preference 1                           |
+-----------------------------------------------------------+
|             Router Address 2                              |
+-----------------------------------------------------------+
|             Router Preference 2                           |
+-----------------------------------------------------------+
|             .....                                         |
+-----------------------------------------------------------+

                [그림] Route Advertisement


한 세그먼트에 존재하는 호스트들은 기본 게이트웨이 IP 주소를 구성할 필요가 없다. 라우
터는 ICMP 유형 9를 이용하여 매 7분 ~ 10분 간격으로 세그먼트내에 존재하는 시스템에게
메시지를 송부한다.


■ ICMP Type 10
라우터 선택 메시지(Route Solicitation)

ICMP 유형 10 즉, 라우터 선택 메시지는 호스트 시스템이 지역에 존재하는 IP 주소를 획득
하기 위해 사용되어 진다. 호스트가 라우터의 주소를 발견하기 위해 사용한다. 호스트는
같은 세그먼트내에 존재하는 라우터를 발견하기 위해 ICMP 유형 10을 브로드캐스트나 멀
티게스트를 이용하여 전송한다. 그럼 라우터는 이 메시지를 받고, 라우터는 ICMP 유형 9
(라우터 광고 메시지)를 통해 응답한다. 이 때 호스트는 매 7분 ~ 10분 간격으로 부터
ICMP 유형 9 메시지를 받게 된다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=10  |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|       Identifier        |    Sequence Number              |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] ICMP Echo Reply


■ ICMP Type 11
시간 초과(Time Exceeded)

(a) ICMP 시간 초과 메시지 생성 상황(1)
TTL 필드의 원래 설정값이 너무 낮거나 데이터그램의 여행 경로가 너무 길거나 무한 루프
가 발생한 경우에 생성된다.

(b) ICMP 시간 초과 메시지 생성 상황(2)
데이터그램이 단편화 되어 있음에도 불구하고 단편화된 데이터그램이 모두 도달하지 않아
재조립이 불가능한 경우에 생성된다. 특정 데이터그램이 단편화 되면 최종 호스트는 단편
화된 데이터그램에 대해 재조립에 책을을 져야 한다. 단편화된 데이터그램은 개별적으로
라우터를 통과하여 목적지까지 여행을 하게 된다. 만약 특정 단편화된 데이터그램이 경로
여행 중 없어진다면 호스트는 데이터그램을 재조립할 수 없으므로 전체 데이터그램을 삭
제하게 된다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
|   Type=11  |  Code=0~1  |    Checksum                     |
+-----------------------------------------------------------+
|                       Not Used                            |
+-----------------------------------------------------------+
|                          데이터                           |
+-----------------------------------------------------------+

                [그림] Time Exceeded

Code 0 : TTL 만료로 인한 시간 초과
Code 1 : 데이터그램의 미도착으로 인한 시간 초과


■ ICMP Type 13, 14
시간 요청, 응답(Timestamp Request / Reply)

IP 노드는 자체의 시계를 유지하고 있다. ICMP 유형 13과 14 메시지는 원격 IP 노드로 부
터 시간을 알아 보기 위해 사용된다. 이는 NTP라는 프로토콜이 존재하지만 가장 단순화된
IP 노드의 시간을 동기화 한다.


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
| Type=13,14 |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|       Identifier        |    Sequence Number              |
+-----------------------------------------------------------+
|                 Original Timestamp                        |
+-----------------------------------------------------------+
|                 Receive Timestamp                         |
+-----------------------------------------------------------+
|                 Transmit Timestamp                        |
+-----------------------------------------------------------+

                [그림] Timestamp Request / Reply


Type 필드 13 : 시간 요청
Type 필드 14 : 시간 응답
협정 시계시(UT) 자정으로 부터 계산함. 밀리초 단위로 계산
시작 시간(Original Timestamp)은 송신 호스트에서 지정
수신 시간(Receive Timestamp)은 수신 호스트에서 지정
변화 시간(Transmit Timestamp)은 ICMP 응답 메시지가 출발하는 시점의 시간을 지정


■ ICMP Type 15, 16
정보 요청, 응답(Information Request, Reply)

ICMP 요청 15는 요청 호스트의 IP 주소를 알아내기 위한 거이며, 유형 16은 응답을 되돌려
주기 위해 사용된다. 더이상 사용치 않고 있으며 RFC 1122에서 사용하지 말것 을 권장하고
있다. RARP, BOOTP 또는 DHCP를 사용할 것을 권장하고 있다.

- ICMP 유형 15 : 요청한 호스트 IP 주소를 알기 위함
- ICMP 유형 16 : 요청한 호스트 IP 주소에 대한 응답


■ ICMP Type 17, 18
주소 마스크 요청, 응답(Address Mask Request / Reply)

ICMP 유형 17, 18은 특정 호스트가 요청한 서브넷 마스크를 획득하고 사용하기 위해 생성
된다. 메시지가 생성되는 위치는 호스트이다. 디스크 없는 워크스테이션과 같은 자체 구성
시스템이 부트 할 때 자체의 서브넷 마스크를 발견할 수 있도록 하기 위함.

- ICMP 유형 17 : 요청한 호스트의 서브넷 마스크를 알아 보기 위함
- ICMP 유형 18 : 요청한 호스트의 서브넷 마스크에 대한 응답


    1Bytes       1Bytes                  2Bytes
|<---------->|<---------->|<------------------------------->|
+------------+------------+---------------------------------+
| Type=17,18 |   Code=0   |    Checksum                     |
+-----------------------------------------------------------+
|       Identifier        |    Sequence Number              |
+-----------------------------------------------------------+
|                     Address Mask                          |
+-----------------------------------------------------------+

                [그림] ICMP Address Mask

2008. 8. 29. 17:27

ref_ipmp

          

     
  IPMP(Internet Protocol Multi-Pathing, IP Multi-Pathing)
     



INDEX
_____________________

1. IPMP Feature
2. IPMP Overview
3. IPMP Configuration Type
4. IPMP Implementation
5. Reference



현재 썬에서는 (a)IPMP, (b)Sun Trunking Software 등을 제공함으로써 썬 고객들의 네트워
크 대역폭에 대한 요구를 충족시키고 있다. IPMP Software는 운영체제에 기본 내장 되어
있지만 Sun Trunking Software는 기본 내장되어 있지 않다.



0. IPMP의 필요성
______________________

현재 사용하고 있는 방식의 NIC 카드의 문제점은 Hub, Switch 같은 장치와 연결되는 케이
블에 이상이 있는 경우 서버의 통신은 문제가 발생되게 된다. 그리고 NIC 카드가 노후화로
인해 이상이 있다고 하더라도 문제가 발생된다.

이런 문제점을 해결하기 위해서는 같은 네트워크에 여러개의 네트워크 인터페이스(NIC)를
달고 IPMP 설정을 통해서 높은 대역폭을 제공하면서 각 NIC의 Failover 기능을 수행할 수
있도록 설정하면 문제가 해결된다.


------+-----+-----+-----+-----------------+-----------
      |     |     |     |                 |
      |     |     |     |                 |
  +--qfe0--qfe1--qfe2--qfe3--+          CLINET
  |                          |
  |          SERVER          |
  |                          |
  +--------------------------+

       [그림] IP Multipath Configuration


[Ref.] Sun Trunking Software
Sun Trunking Software는 솔라리스 운영체제에 기본 내장되어 있는 프로그램이 아니므로
라이센스 비용을 들여서 사야 한다.

Sun Trunking software is not part of the Solaris OE and must be purchased separately.
Sun Trunking software is an aggregation technology that:

* Up to eight full-duplex ports on two Sun Quad FastEthernet™ (qfe) adapters to 
  obtain 800-Mbps full-duplex performance
* Links up to two full-duplex ports on a Sun™ Gigabit Ethernet Adapter (ge) to
  obtain 2-Gbps full-duplex performance between a Sun server and a Sun Trunking
  compatible switch.


                        SERVER

                       ||||||||
                       ||||||||
                       ||||||||        Network links are aggreagted
                       ||||||||  ----> in to a fat network pipe.
                       ||||||||
                       ||||||||
                       ||||||||

                        Switch

                           |
   ------------------------+---------------------------
         |       |       |       |       |      |
       ClientA ClientB ClientC ClientD ......



1. IPMP Feature
______________________

솔라리스 9버전부터 내장되기 시작했는데 9버전이 나올당시에 출시 되었던 8버전에도 기술
이 내장되었다.


(1). IPMP Feature

■ Eliminates a single network adapter as a single point-of-failure in these cases:
   * Network adapter failure detection (failover)
   * Network adapter repair detection  (failback)

■ Provides outbound load spreading when traffic is flowing to multiple destinations.

■ Enables interfaces to failover within approximately 10 seconds when using the
   default configuration.

■ Can be configured by adjusting the parameters in the /etc/default/mpathd file.

■ Can be configured for both IPv4 and IPv6.

■ Allows interfaces to be configured as Standby Interfaces. These types of
   interfaces are only used for failover and are not used for outbound load
   spreading, unless they are explicitly chosen by an application.


(2). IPMP Requirements

■ The Solaris 8 10/00 OE, as a minimum.

■ Unique media access control (MAC) addresses must be configured on each network
   interface.

   - The default configuration for most Sun network adapters has all network
     interfaces on a specific server using the same MAC address.
   - IPMP requires that all interfaces exist on the same network. Switched
     configurations use MAC addresses when making network decisions.
   - Therefore, you must change the system’s default configuration for MAC
     addresses to avoid a MAC address conflict.

■ Multiple network adapter interfaces must be connected on each subnet.
   - You can configure IPMP with a single network interface to take advantage of
     network failure detection. To use the full benefit ofIPMP, make sure that two
     or more network interfaces are connected to the same subnet.

■ A network adapter group name must be assigned to IPMP interfaces.

   - Interfaces that are to be deployed as multipath interfaces must belong to a
     multipath group. The in.mpathd multipath process uses the multipath group.
     Use a meaningful name that does not include spaces when you choose a group
     name. The multipath name is local to the system and is not used across the
     network.

■ A test address is assigned to an interface.

   - The multipath process uses test addresses, which must be routable addresses,
     to monitor the status of each individual interface. Use the test addresses to
     detect failure and recovery of an interface. These addresses are deprecated at
     configuration time to make sure that they cannot be used to pass network
     traffic from other applications.

■ Additional hosts must exist on the same subnet.

    - The test interfaces use ICMP echo request, reply, or both to hosts that they
      reach by addressing the 224.0.0.1 multicast group or the default router, as
      listed in the /etc/defaultrouter file.


솔라리스 8 10/00(2000.10) 버전부터 이 기능이 내장 되었습니다.
■ SUNWcsr(운영체제 core 패키지)에 포함되어 있습니다.
■ 각 NIC는 유일한 MAC 주소를 가져야 한다.
■ in.mpathd 데몬의해서 동작 된다.
■ 각 NIC에 Test Address가 존재해야 한다.
■ Test NIC는 각 NIC와 224.0.0 또는 동일한 Default router 접근할수 있
  어야 한다.


(3). Interface Failure Detection and Repair

The in.mpathd process can detect both the failure and the repair of an interface by:

* Sending and receiving ICMP echo requests and responses through the interface.
* Monitoring the internal IFF_RUNNING flag on the interface.



2. IPMP Overview
_______________________

IPMP는 다음과 같은 2가지 기능을 갖습니다.
- Failover
- Failback

(1). Failover
는 하나의 시스템에 여러개의 NIC(Network Interface Card)를 사용할때 NIC 카드를
Grouping 해서 그 중 하나의 NIC가 통신 실패(Fail)하는 경우 이를 점검하고 정상적인
다른 NIC로 Failover 해 주는 기능입니다.

(2). Failback
장애(통신 실패, Fail)가 발생한 NIC를 복구한 후(Failover 기능), 관리 자의 특별한 설
정 없이 자동으로 원래 설정으로 돌려 주는 기능입니다.



3. IPMP Configuration Type
______________________________

IPMP를 설정 하는 방법은 다음과 같이 2가지가 존재합니다.
- Standby NIC 갖는 환경     (Active-Standby)
- Standby NIC 갖지 않는 환경(Active-Active)


(1). Standby NIC 갖는 IPMP 환경
서비스를 하는 NIC와 서비스를 하지 않는 NIC를 그룹으로 묶고(Grouping) 실제 서비스를
하지 않는 NIC로 서비스를 하고 있는 NIC에 대해 Failover 기능을 제공해 주기 위한 환경
입니다. 다시 말해서 서비스를 안정적으로 가지고 가기 위해서 백업 NIC를 갖는 것과 같
습니다.


(2). Standby NIC 갖지 않는 IPMP 환경
그룹으로 묶여있는 NIC들이 네트워크 서비스를 각각하고 있다가 그룹내의 NIC 하나가 통신
실패(Fail)이 발생한 경우 남아있던 정상적인 NIC로 Failover 하는 환경입니다. 다시 말해
서 서비스를 안정적으로 가지고 가기 위해서 그룹내의 모든 NIC가 활성화 상태에 있다가
하나의 NIC가 이상이 있지만 다른 NIC가 정상 서비스를 하는 것입니다.


(3). 두 가지 방법의 차이점
<Standby NIC 갖지 않는 IPMP 환경>
- 그룹내의 하나의 NIC가 이상이 있는 경우(통신 실패가 있는 경우) 다른 NIC가 다른 NIC
  들이 서로 Failover 기능을 제공한다.

<Standby NIC 갖는 IPMP 환경>
- 그룹내의 NIC 중 Standby NIC가 서비스 NIC의 Failover 기능을 제공하지만 반대로
  Standby NIC에 대한 Failover 기능은 제공되지 않는다.


[Ref.] Failover, Failback 기능을 사용하기 위해서는 Test NIC(Logical Interface) 필요
<Standby NIC 갖지 않는 IPMP 환경>
- 그룹내 모든 NIC에 Test NIC(Logical Interface) 필요
 
<Standby NIC 갖는 IPMP 환경>
- Test NIC(Interfaec)로만 설정한다.



4. IPMP Implementation
______________________________

(1). Standby NIC 갖는 IPMP 설정

    +=======HOSTA=======+
    |                   |
    |               hme0   (192.168.8.100)
    |               hme0:1 (192.168.8.101)
    |
    |               hme1   (192.168.8.200)
    |               hme1:1 (192.168.8.201)
    |                   |
    +===================+

    Grouping : hme0, hme1 (testgroup)
    Test NIC : hme0:1(For hme0), hme1:1(For hme1)



(현재 설정)
# cat /etc/release
솔라리스 8 버전 이상(Solaris 8 10/00 이상)

# eeprom local-mac-address?=true

# ifconfig hme0 down unplumb
# ifconfig hme1 down unplumb

# ifconfig hme0 plumb 192.168.8.100 group testgroup up
# ifconfig hme0 addif 192.168.8.101 deprecated -failover up
(# ifconfig hme0 addif 192.168.8.101 deprecated netmask + broadcast + -failover up)

# ifconfig hme1 plumb 192.168.8.200 group testgroup up
# ifconfig hme1 addif 192.168.8.201 deprecated -failover up
(# ifconfig hme1 addif 192.168.8.201 deprecated netmask + broadcast + -failover up)

# pgrep -lf in.mpathd

(주의) 만약 in.mpathd 데몬이 떠 있지 않은 경우 띄워 준다.
# ps -ef | grep in.mpathd
# /sbin/in.mpathd


-------------------------- Solaris 9 x86 on VMWare TEST ---------------------------
[EX] Active-Active IPMP 설정(Solaris 9 x86 on VMWare)

    +=======HOSTA=======+
    |                   |
    |               pcn0   (192.168.8.100)
    |               pcn0:1 (192.168.8.101)
    |
    |               pcn1   (192.168.8.200)
    |               pcn1:1 (192.168.8.201)
    |                   |
    +===================+

    Grouping : pcn0, pcn1 (testgroup)
    Test NIC : pcn0:1(For pcn0), pcn1:1(For pcn1)


0. 전제 조건
- NIC 2장 모두 NAT Device에 연결한다.


1. 작업 순서
- NIC1 -> (Bridge -> NAT)
- IPMP 설정
 pcn0   (192.168.10.100)
 pcn0:1 (192.168.10.101)
 pcn1   (192.168.10.200)
 pcn1:1 (192.168.10.201)
- TEST

(a) NIC1 (Bridge -> NAT)

(b). IPMP Configuration
# cat /etc/release
                         Solaris 9 9/05 s9x_u8wos_05 x86
           Copyright 2005 Sun Microsystems, Inc.  All Rights Reserved.
                        Use is subject to license terms.
                            Assembled 01 August 2005

# ifconfig pcn0 down unplumb
# ifconfig pcn1 down unplumb

# ifconfig pcn0 plumb 192.168.10.100 group testgroup up
# ifconfig pcn0 addif 192.168.10.101 deprecated -failover up

# ifconfig pcn1 plumb 192.168.10.200 group testgroup up
# ifconfig pcn1 addif 192.168.10.201 deprecated -failover up

# pgrep -lf in.mpathd


(c). TEST

(At Clinet)
# ping -s 192.168.10.100
-> 메세지 확인

(At Server)
# if_mpadm -d pcn0
-> Clinet 확인
# ifconfig -a
-> pcn0 설정 값 확인

# if_mpadm -r pcn0
-> Client 확인
# ifconfig -a
-> pcn0 설정 값 확인

(At Client)
# ping -s 192.168.10.200

(At Server)
# if_mpadm -d pcn1
-> Client 확인
# ifconfig -a
-> pcn1 설정 값 확인

# ip_mpadm -r pcn0
-> Client 확인
# ifconfig -a
-> pcn0 설정 값 확인

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




(부팅시 설정)
# cat /etc/release
# eeprom local-mac-address?=true

# cat /etc/hosts
.....
192.168.8.100      solaris100        # Data address for hme0
192.168.8.101      solaris100-hme0   # hme0:1 Test address for hme0
192.168.8.200      solaris200        # Data address for hme1
192.168.8.201      solaris200-hme1   # hme1:1 Test address for hme1


# cat /etc/hostname.hme0
192.168.8.100 broadcast + netmask + group testgroup up \
addif 192.168.8.101 deprecated netmask + broadcast + -failover up

# cat /etc/hostname.hme1
192.168.8.200 broadcast + netmask + up group testgroup \
addif 192.168.8.201 deprecated netmask + broadcast + -failover up


* 192.168.8.XXX or solarisXXX    Assigns the address associated with the solarisXXX
                                 name.

* netmask +                      Looks up the mask in the netmasks database.

* broadcast +                    Results in a default broadcast address appropriate
                                 for the address and netmask.

* group testgroup                Assigns testgroup as the name for a IPMP group.

* up                             Marks the interface as “up,” and initializes the
                                 hardware.

* addif 192.168.8.XXX            Creates the next unused logical interface, and
                                 assigns it the IP address associated with the
                                 solarisXXX-hmeX name.

* deprecated                     Marks the address as a deprecated address.
                                 Addresses that are marked as deprecated are not
                                 used as source addresses for outbound packets
                                 unless either there are no other addresses
                                 available on this interface or the application is
                                 bound to this address explicitly. The output from
                                 the ifconfig -a command shows DEPRECATED as
                                 one of the flags associated with this interface.

* -failover                      Marks the address as a non-failover address.
                                 Addresses that are marked in this way do not fail
                                 over when the interface fails. The output from the
                                 ifconfig -a command shows NOFAILOVER as
                                 one of the flags associated with this interface.


(2). Test (Failover, Failback)


    ======= HOSTA =======      |      ======= HOSTB =======
         Active    hme0 -------|------hme0  # ping -s HOSTA       
                   hme0:1      |
         Active    hme1 -------|
                   hme1:1      |
    =====================      |      =====================

(a). HOSTB에서 HOSTA로 ping 명령어에 -s 옵션을 사용하여 hme0(192.168.8.100)
     으로 연속적인 ICMP echo reply 신호를 받는다.
(b). HOSTA에서 hme0의 NIC의 LAN 선을 뽑는다.
(c). HOSTB에서 계속된 ping 시도가 되고 있는지 확인한다.
     (잠시 끊김현상이 발생하기는 하지만 바로 복구되는 것을 확인한다.)
(d). HOSTA에서 ifconfig 명령어를 사용하여 hme0에 대한 IP 설정값을 확인한다.
     (0.0.0.0 으로 설정된것을 확인할수 있다.)
(e). 잠시후에 HOSTA에서 ifconfig 명령어를 사용하여 hme0에 대한 IP 설정값을
     확인한다.(Failback 기능으로 인해 IP가 원래대로 설정이 돌아 온것을 확인
     한다.)
   


(3). Standby NIC를 갖는 IPMP 설정

(현재 설정)
부팅시의 설정 사항을 보면 알수 있을 것이다.

(부팅시 설정)
* /etc/hostname.hme0
192.168.8.100 netmask + broadcast + group testgroup deprecated -failover up

* /etc/hostname.hme1
192.168.8.200 netmask + broadcast + group testgroup up \
addif 192.168.8.201 deprecated netmask + broadcast + standby up


(4). Test(Failover, Failback)
테스트도 "4.(2)" 테스트와 비슷하게 수행한다.



5. /etc/default/mpathd & in.mpathd
____________________________________


The starting of the in.mpathd daemon is controlled by the
TRACK_INTERFACES_ONLY_WITH_GROUPS parameter in the
/etc/default/mpathd file.

If the TRACK_INTERFACES_ONLY_WITH_GROUPS variable is set to yes, the
ifconfig utility’s group option starts the in.mpathd process
automatically. That is, as soon as you use the ifconfig utility with the
group option in the command, the in.mpathd process starts. If the
TRACK_INTERFACES_ONLY_WITH_GROUPS variable is set to no, the
/etc/rcS.d/S30network.sh run control script starts the in.mpathd
process at boot time.

# cat /etc/default/mpathd
#
#pragma ident   "@(#)mpathd.dfl 1.2     00/07/17 SMI"
#
# Time taken by mpathd to detect a NIC failure in ms. The minimum time
# that can be specified is 100 ms.
#
FAILURE_DETECTION_TIME=10000
#
# Failback is enabled by default. To disable failback turn off this option
#
FAILBACK=yes
#
# By default only interfaces configured as part of multipathing groups
# are tracked. Turn off this option to track all network interfaces
# on the system
#
TRACK_INTERFACES_ONLY_WITH_GROUPS=yes



6. TEST 하기 위한 명령어
_________________________

To verify the system’s failover configuration, or to change the operational
status of IPMP interfaces, use the if_mpadm utility. You can use this utility
to take an interface offline (detach), by forcing a failover, and verifying
that an alternate interface takes over as expected. If configuration errors
occur, they appear at this stage. Also, use the if_mpadm utility to reattach
a detached interface.

# if_mpadm -d hme0  (Detach an online interface)
# if_mpadm -r hme0  (Reattach an offline interface)

[Ref.] 메세지 모니터링을 위해서 console window를 띄어 놓고 테스트 하면 좋다.
# dtterm -C &



7. Reference
________________

Sun Book : Network Administration for the Solaris 9 Operating Environment
           (SA-399) "Modules 6" Reference

2008. 8. 29. 16:39

ref_ndd

 

                                         

 

                     ndd CMD

 

 

 

 

 

1. ndd Overview

__________________

 

get and set driver configuration parameters

 

     ndd gets and sets selected configuration parameters in  some

     kernel  drivers.  Currently,  ndd  only supports the drivers

     that implement the TCP/IP  Internet  protocol  family. Each

     driver  chooses  which parameters to make visible using ndd.

     Since these parameters are usually tightly  coupled  to  the

     implementation,  they  are  likely to change from release to

     release. Some parameters may be read-only.cl

 

     If the -set option is omitted, ndd queries the named driver,

     retrieves the value associated with the specified parameter,

     and prints it. If the  -set  option  is  given,  ndd  passes

     value,  which  must  be  specified, down to the named driver

     which assigns it to the named parameter.

 

     By convention, drivers that support ndd also support a  spe-

     cial  read-only  parameter  named ``?'' which can be used to

     list the parameters supported by the driver.

 

ndd 명령어를 통해 많은 네트워크 설정값을 설정할 수 있다. 하지만 ndd 명령어로 설정한

값은 부팅시에는 적용되지 않고 현재 적용만된다. 부팅시에도 적용하도록 설정하기 위해

서는 /etc/init.d/inetinit 시작 스크립트를 사용해도 되고 또는 /etc/rc2.d 디렉토리에

개인적인 시작 스크립트를 생성하여 기능을 추가해도 된다.

 

 

 

 

 

2. 네트워크 장치 & 프로토콜

 

(1). 네트워크 프로토콜

 

/dev/arp

/dev/rarp

/dev/icmp

/dev/tcp

/dev/ip

 

 

(2). 네트워크 장치

 

/dev/hme

/dev/qfe

 

 

(3). 사용예

 

# ndd /dev/arp \?

# ndd /dev/rarp \?

# ndd /dev/icmp \?

# ndd /dev/tcp \?

# ndd /dev/ip \?

 

 

 

 

 

3. ndd 명령어

___________________

 

(3.1) 기본사용법

 

ndd [ -get | -set ] /dev/ip [ \? | ip_forwarding ]

                      /dev/arp

 

# ndd /dev/ip \?

# ndd -get /dev/ip \?

 

# ndd /dev/ip ip_forwarding

# ndd -get /dev/ip ip_forwarding

 

# ndd -set /dev/ip ip_forwarding 1

 

 

 

(3.2) 대표적인 인자(Driver Parameter)

 

# ndd -get /dev/ip ip_forwarding

0                    IP Forwarding : Off

1                    IP Forwarding : On

 

# ndd -get /dev/hme link_speed

0                    NIC Link Speed : 10Mbps

1                    NIC Link Speed : 100Mbps

 

# ndd -get /dev/hme link_mode

0                    NIC Link Mode : Half Duplex

1                    NIC Link Mode : Full Duplex

 

# ndd –get /dev/hme link_status

0                    NIC is down

1                    NIC is up

 

# ndd –get /dev/hme instance

0                    NIC 1st

1                    NIC 2nd

2                    NIC 3rd

...

 

Instance NIC카드 넘버

 

[참고] Virtual Interface Number

To set more than 256 virtual ip addresses. By default solaris can have 256 virtual

ip addresses per interface. This default can be be change using this command.

 

# ndd -get /dev/ip ip_addrs_per_if

256

 

# ndd -set /dev/ip ip_addrs_per_if <Number>    (Number 1 ~ 8192)