nslookup
#cp /etc/nsswitch.dns /etc/nsswitch.conf
/etc/hosts 내용 확인 후 dns 서버에 질의
/etc/nsswitch.files
/etc/nsswitch.dns
/etc/nsswitch.nis
/etc/nsswitch.nisplus
/etc/nsswitch.ldap
#vi /etc/resolv.conf
domain sun.com
nameserver 168.126.63.1
nameserver 168.126.63.2
:wq!
=============================================
DNS 파일 설정
$TTL
바인드버젼 8.2이전에서는 사불
바인드버젼 8.2이후에서는 필사
$ORIGIN == @ => 자신의 도메인
@ 절대 사용하지 말것!
@ 절대 사용하지 말것!
admin@google.com => admin.google.com.google.com
admin.google.com 형식으로 작성
domain 마지막에 .(dot)을 찍을 것!
domain 마지막에 .(dot)을 찍을 것!
/etc/named.conf <= in.named
(ver.9부터 /usr/sbin/named)
svc -a|grep dns
which named => /usr/sbin/named
/etc/hosts
/etc/inet/ipnodes
/etc/resolv.conf => nameserver (host ip)
=============================================
svcs -a | grep dns
svcadm enable ~~
=============================================
#named-checkconf
/etc/named.conf 의 문법 검사
#named-checkzone one.com one.zone
one.zone 검사
=============================================
장애 처리 및 DNS 로그, 통계 정보 수집
/etc/named.conf
loggin {
channel logfile {
file "/var/named/bind-log";
print-time yes;
severity debug 9;
print-cartegory yes;
print-severity yes;
};
category default { default_syslog; logfile; };
category quries { logfile; };
}
=============================================
#tail -f /var/adm/messages
#tail -f /var/named/bind-log
=============================================
dig (nslookup 없어질 예정, dig로 대체)
#dig @192.168.102.200 one.com sol10-u4.one.com
=============================================
ndc => rndc (sol10 이후)
rndc 장점 : 인증, 암호화
#rndc dumpdb
// 캐쉬 덤프 생성
#rndc flush
// 캐쉬 제거
svcadm restart dns/server
// 캐쉬 제거 (서비스 재시작)
#rndc dumpdb
cat /var/named/named_dump_db
// 캐쉬 덤프 파일 내용 확인
// 주석 제외하고 내용이 없음 확인
#rndc reconfig
// rndc 재구성 (네임서버 중지, 재시작)
###################
IPMP (IP MultiPathing)
###################
===================
solaris 8 (10/00 ) 버전
solaris 9 (12/02 ) 버전
IPMP
Link Base : health check 를 위해 sub interface 불필요
interface kernel driver가 지원.
Probe Base : health check 를 위해 sub interface 필요
=============================================================
fail over
장애 극복
fail back
장애 이전으로 복구
--------------------------------------------------------------
/etc/default/mpathd
설정 파일에 구성
ipv4 , ipv6 환경하에서 모두 사용이 가능
--------------------------------------------------------------
in.mpathd 가 ipmp 그룹 명을 사용
그룹명에는 공백사용이 불가
test interface (테스트 인터페이스도 ip 라우팅이 가능해야함)
--------------------------------------------------------------
Fail Detection , Repair---> ICMP
Monitoring IFF_RUNNING flag 사용
================================================================
IPMP 구성을 위한 작업
=====================
1)버전 확인
#cat /etc/release
2)mac 확인
#eeprom "local-mac-address?"
#eeprom local-mac-address?=true
ok>printenv local-mac-address?
ok>setenv local-mac-address? true
========================================================
Standby 없이 dual active path 의 IPMP설정 및 확인 설정
========================================================
host1# eeprom local-mac-address?=true
--> 각 interface의 ethernet address를 달리 설정하기 위한
eeprom parameter를 true로 설정
host1# ifconfig pcn0 unplumb
host1# ifconfig pcn1 unplumb
host1# ifconfig pcn0 plumb 192.168.0.86 group testgrp2 up
?
host1# ps -ef|grep mpath
root 477 1 0 17:18:09 ? 0:00 /sbin/in.mpathd
?
host1# ifconfig pcn0 addif 192.168.0.87 deprecated -failover up
?
host1# ifconfig -a
host1# ifconfig pcn1 plumb 192.168.0.88 group testgrp2 up
host2# ifconfig pcn1 addif 192.168.0.89 deprecated -failover up
host1# ifconfig -a
Failover 테스트
==================================================
Standby 를 가진 single active path의 IPMP 설정하기
==================================================
host1# eeprom local-mac-address?=true
host1# ifconfig pcn0 unplumb
host1# ifconfig pcn1 unplumb
host1# ifconfig pcn0 plumb 192.168.0.86 group testgrp2 up
?
host1# ps -ef|grep mpath
root 477 1 0 17:18:09 ? 0:00 /sbin/in.mpathd
?
host1# ifconfig pcn0 addif 192.168.0.87 deprecated -failover up
---> test interface 설정 . Created new logical interface pcn0:1
?
host1# ifconfig -a
host1# ifconfig pcn1 plumb 192.168.0.88 group testgrp1 deprecated -failover standby up
host1# ifconfig -a
??
/etc/hostnanme.<interface> 설정 내용
# cat /etc/hostname.pcn0
192.168.0.86 netmask 255.255.255.0 broadcast + group host1 up \
addif 192.168.0.87 deprecated -failover netmask 255.255.255.0 broadcast + up
?
#cat /etc/hostname.pcn1
192.168.0.88 netmask 255.255.255.0 broadcast + group host1 deprecated -failover standby up
==========================================================
touch /etc/notrouter
qfe , ce , ge , hme : link base 지원 가능.
==========================================================
#ps -ef |grep in[.]mpathd
solaris 9 이하에서는
/etc/rc2.d/S69inet script 에 의해서 동작
solaris 10 부터
/lib/svc/method/net-init 에 의해서 동작
#grep in[.]mpathd /lib/svc/method/net-init
==========================================================
Link 기반 IPMP 구성
모두 동일하나 sub interface 를 생성하지 않음
#ifconfig -a
#ps -ef |grep in[.]mpathd
LINK 기반 IPMP 운영
#if_mpadm -d hme0
-d : detatch (offline)
#ifconfig -a
#if_mpadm -r hme0
-r : Reattach (online)
==============================================================
#IPMP singleton#
한개의 IPMP 그룹에 하나의 NIC 만 포함하는 형태
Fail over 미지원되는 IPMP 임.
IPMP 상태 추적 및 모니터링 용도
인터페이스의 상태에 관련 실시간 notification (알림) 지원
==============================================================
#touch /etc/hostname.6
#init 6
==============================================================
staitc routing
정적라우팅
관리자가 직접 입력
저사양에서도 동작
보안성 좋다.
대규모 환경에서 부적합 ( 왜냐하면 네트워크 구성이 자주 변화하므로)
관리적 부하가 큼
dynamic routing
동적라우팅
별도의 프로토콜이 동작 ( 솔라리스의 경우는 in.routed 가 수행)
관리자의 관리 및 입력 부하가 적다
라우터의 경우는 정적 구성보다는 보다 고사양의 cpu 와 메모리가 요구
보안성이 상대적으로 떨어짐
대규모 환경에 적합 (네트워크 구성의 변화를 반영함.)
===============================================================
정적라우팅
/etc/defaultrouter
정적 indirect 라우팅
/etc/gateways
===============================================================
동적라우팅
in.routed 데몬에 의해 라우팅 서비스가 동작함.
in.routed 데몬에 의해 라우팅테이블이 추가, 제거 됨.
RIPv1 , RIPv2 , ICMP router Discovery Protocol
----------------------------------------------------------------
svc:/network/initial
SMF 에서 라우팅서비스 활성화
----------------------------------------------------------------
/etc/defaultrouter
1.적은 라우팅 테이블 구성이 가능케 함
2.신속한 IP 데이터그랩 처리가 가능해 짐
3.멀티플 기본 라우터 구성을 통한 SPOF 발생을 우회가능
단점
1.지정된 default 장애시 네트워크 불가
2.대규모 네트워크에 부적합
(네트워크가 flexible 한 경우)
================================================================
/etc/gateways
#cat /etc/gateways
net 192.168.3.0 gateway sys11 metic 1
:wq!
=================================================================
RIP 비활성시 /etc/gateways ==> no rip 추가
noripin
RIP 데이터 그램이 지정된 인터페이스로 수신,전송
되지 않도록 하려면 gateways 파일에 지시어 추가
수신된 rip 정보 무시
noripout
멀티홈 시스템인 경우 라우트를 알리지 않도록.
norip : noripin , noripout 지시어를 하나로 대체
=================================================================
no_rip
no_ripv1_in=pcn1
=================================================================
명령 구성 기반의 정적 라우팅
#route add net 192.168.3.0 sys11ext
#route add host sys24 sys21ext
#route add default instructor
#route delete sys24 sys21ext
=================================================================
#route get default
#route monitor
#route flush
#route -f add net 192.168.2.0 sys11ext
-f : flush
#route add net 192.168.3.0 sys31ext -netmask 255.255.255.224
#route add net 192.168.3.0/27 sys31ext
=================================================================
#routeadm
ipv4-routing
ipv4-forwarding
===> /etc/defaultrouter 빈 내용
#routeadm -u -d ipv4-routing
-u : update
-d : disable
-e : enable
-r : revert
=================================================================
#routeadm -u -e ipv4-routing
-u : 현재 구동중 옵션 즉시 적용
#routeadm -e ipv4-routing
파일에만 반영됨.....즉시 반영이 안됨
-r : 시스템 부팅시에 초기화로 돌아가지 않을 때 사용
==================================================================
RDISC (in.rdisc )
라우터 discovery ....
ICMP ( 9 ,10 번 타입을 이용하여 route advertisement ....)
multicast 224.0.0.1 (600초 단위 : 10분단위)
==================================================================
장점 : 라우팅 프로토콜과 독립적 구동
멀티캐스트 사용
라우팅 테이블 크기 감소
다중 기본 경로 제공을 통한 경로 중복 제공
단점 : 10분단위로 광고 하므로 블랙홀에 빠질 수 있음
호스트 --> 라우터
라우터 --> 라우터
===================================================================
/etc/gateways 에서 rdisc 제어 가능
rdisc_interval=100
단위는 초
===================================================================
icmp redirect
해커의 icmp redirect 공격 방어
#ndd -set /dev/ip ip_ignore_redirect 1
http://www.sun.com/solutions/blueprints/1200/network=updt1.pdf
====================================================================
#ifconfig pcn0 plumb 211.106.31.100/23 broadcast + up
#/etc/inet/routing.conf
=====================================================================
#rm /etc/defaultrouter
#vi /etc/hostname.pcn0
#vi /etc/hostname.pcn1
#init 6
sol9 이하 ( 포워딩 활성화)
#ndd -set /dev/ip ip_forwaring 1
sol10 (포워딩 활성화)
#routeadm -u -e ipv4-forwarding
(라우팅 활성화 )
#routeadm -u -d ipv4-routing
#routeadm -u -e ipv4-routing
=========================================================
멀티홈드 ( Multi Homed )
NIC 2장 이상일 때
sol10 )
#routeadm -u -d ipv4_forwarding
==========================================================
IP multi pathing
1) 로드분산
2) IP 장애극복
IPMP
solaris 8 (10/00) 버젼
solaris 9 (12/02) 버젼 ver.update 4 버젼 추천
====================================================
Link Base : health check를 위해 sub interface 불필요
interface kernel driver가 지원
Probe Base : health check를 위해 sub interface 필요
====================================================
fail over 장애 극복
fail back 장애 이전으로 복구
====================================================
/etc/default/mpathd
설정 파일 구성
ipv4, ipv6 환경하에서 모두 사용 가능
====================================================
in.mpathd가 ipmp 그룹 명을 사용 (그룹명에는 공백사용 불가)
test interface (테스트 인터페이스도 ip 라우팅이 가능해야합)
====================================================
Fail Detection, Repair -----> ICMP
Monitoring IFF_RUNNING flag 사용
> cat /etc/defult/mpathd
====================================================
IPMP 구성을 위한 작업
1) 버젼확인
#cat /etc/release
2) mac 확인
#eeprom "local-mac-address?"
#eeprom local-mac-address?=true
or
ok>printenv local-mac-address?
ok>setenv local-mac-address? true
====================================================
Standby 없이 dual active path의 IPMP설정 및 확인 설정
====================================================
host1#eeprom local-mac-address?=true
-> 각 interfacce의 ethernet address를 달기 설정하기 위한
eeprom parameter를 true로 설정
host1#ifconfig pcn0 unplumb
host1#ifconfig pcn1 unplumb
host1#ifconfig pcn0 plumb 192.168.0.86 group testgrp2 up
host1#ps -ef|grep mpath
root 477 1 0 17:18:09 ? 0:00 /sbin/in/mpathd
host1#ifconfig pcn0 addif 192.168.0.87 deprecated -failover up
host1#ifconfig -a
host1#ifconfig pcn1 plumb 192.168.0.88 group testgrp2 up
host2#ifconfig pcn1 addif 192.168.0.89 deprecated -failover up
host1#ifconfig -a
Failover 테스트
====================================================
Standby를 가진 single active path의 IPMP 설정하기
====================================================
host1#eeprom local-mac-address?=true
host1#ifconfig pcn0 unplumb
host1#ifconfig pcn1 unplumb
host1#ifconfig pcn0 plumb 192.168.0.86 group testgrp2 up
host1#ps -ef|grep mpath
root 477 1 0 17:18:09 ? 0:00 /sbin/in.mpathd
host1#ifconfig pcn0 addif 192.168.0.87 deprecated -failover up
host1#ifconfig -a
host1#ifconfig pcn1 plumb 192.168.0.88 group testgrp1 deprecated -failover standby up
host1#ifconfig -a
/etc/hostname.<interface> 설정 내용
#cat /etc/hostname.pcn0
192.168.0.86 netmask 255.255.255.0 broadcast + group host1 up \
addif 192.168.0.87 deprecated -failover netmask 255.255.255.0 broadcast + up
#cat /etc/hostname.pcn1
192.168.0.88 netmask 255.255.255.0 broadcast + group host1 deprecated -failover standby up
====================================================
solaris는 기본적으로 lan card가 2개 이상이면 router로 동작함.
touch /etc/nonrouter ---> 생성하면 router 동작 안함.
qfe, ce, ge, hme : link base 지원
====================================================
#ps -ef |grep in[.]mpathd
solaris 9 이하에서는
/etc/rc2.d/S69inet script에 의해 동작
solaris 10 부터
/lib/svc/method/net-init에 의해 동작
#grep in[.]mpathd /lib/svc/method/net-init
====================================================
Link 기반 IPMP 구성
모두 동일하나 sub interface를 생성하지 않음
#ifconfig -a
#ps -ef |grep in[.] mpathd
Link 기반 IPMP 운영
#if_mpadm -d hme0 ( -d : detatch (offline))
#ifconfig -a
#if_mpadm -r hme0 ( -r : reattach (online))
====================================================
#IPMP singleton#
한개의 IPMP 그룹에 하나의 NIC만 포함하는 형태
Fail over 미지원되는 IPMP
IPMP상태 추적 및 모니터링 용도
(인터페이스의 상태에 관련 실시간 notification(알림) 지원)
====================================================
dual step (ipv4 & ipv6)
#touch /etc/hostname.6
#init 6
NAT-PT (<-ipv6 - ipv4)
Tunnel (ipv4--ipv6--ipv4)
====================================================
Routing
direct rounting - 같은 네트워크
indirect routing - 다른 네트워크
static routing (정적)
관리자가 직접 입력
저사양에서도 동작
보안성 좋음
대규모 환경에 부적합 (네트워크 구성이 자주 변경)
관리적 부하가 큼
dynamic routing (동적)
별도의 프로토콜 동작 (solaris 경우 in.routed)
관리자의 관리 및 입력 부하 적음
라우터의 경우는 정적 구성보다 고사양의 cpu, memory 요구
보안성이 상대적으로 떨어짐
대규모 환경에 적합 (네트워크 구성이 자주 변경)
tip. 윈2000 라우터 (시스코 2500과 동등한 레벨의 라우팅 가능 > rip, rip v2, ospf)
솔라리스 라우터 (윈도보다 떨어짐 > rip, rip v2)
====================================================
static routing
/etc/defaultrouter
static indirect routing
/etc/gateways
====================================================
dynamic routing
in.routed 데몬에 의해 라우팅 서비스가 동작함
in.routed 데몬에 의해 라우팅테이블이 추가, 제거 됨
RIPv1, RIPv2, ICMP router Discovery Protocol
====================================================
svc:/network/initial
SMF에서 라우팅서비스 활성화
====================================================
IGP : RIP, OSPF...
EGP : EGP -> BGP
====================================================
netstat -r // hostname으로 라우팅 테이블 확인
netstat -nr // ip로 라우팅 테이블 확인
====================================================
/etc/defaultrouter 존재
장점
1. 적은 라우팅 테이블 구성 가능
2. 신속한 ip데이터그랩 처리 가능
3. 멀티플 기본 라우터 구성을 통한 SPOF 발생을 후회가능
단점
1. 지정된 default 장애시 네트워크 불가
2. 대규모 네트워크에 부적합 (네트워크가 filexible한 경우)
====================================================
/etc/gateways
#cat /etc/gateways
net 192.168.30.0 gateway sys11(or ip) metric 1
:wq!
====================================================
RIP 비활성화시
/etc/gateways ==> no rip 추가
noripin
RIP 데이터그램이 지정된 인터페이스로 수신, 전송되지
않도록 하려면 gateways 파일에 지시어 추가 수신된 rip정보 무시
noripout
멀티홈 시스템인 경우 라우트를 알리지 않도록
norip
noripin, noripout 지시어를 하나로 대체
====================================================
/etc/gateways
no_rip
no_ripv1_in=pcn0
====================================================
명령 구성 기반의 static routing
#route add net 192.168.3.0 sys11exxt
#route add host sys23 sys21ext
#route add default instructor
#route delete sys24 sys21ext
#route change default 192.168.0.1
====================================================
#route get default
#route monitor
#route flush
#route -f add net 192.168.2.0 sys11 (-f : flush)
#route add net 192.168.3.0 sys31ext -netmask 255.255.255.224
#route add net 192.168.3.0/27 sys31ext
route add net 192.168.30.0 sys2 metric1 (= ip route 192.168.30.0 s0/1)
====================================================
routing algorithm
1) maximum hop count
2) triggerd update
3) split horizon
4) route poisioning (posion reverse)
5) hold down timer
========================================================
↓ Solaris 10
========================================================
#routeadm
ipv4 routing
ipv4 forwarding
===> /etc/defaultrouter 가 빈 내용 일때
ripng (ipv6 rip)
#routeadm -u -d ipv4-routing
-u : update (현재 구동중 옵션 즉시 적용)
-d : disable
-e : enable
-r : revert (시스템 부팅시 초기화로 돌아가지 않음)
#routeadm -e ipv4-routing
파일에만 반영. 즉시 반영 안됨
====================================================
RDISC (in.rdisc)
라우터 discovery
ICMP (9, 10 번 타입을 이요해 route advertisement)
multicast 224.0.0.1 (600초 단위 : 10분 단위)
장점 : 라우팅 프로토콜과 독립적 구동
멀티캐스트 사용
라우팅 테이블 크기
다중 기본 경로 제공을 통한 경로 중복 제공
단점 : 10분단위로 광고 하므로 블랙홀에 빠질 수 있음
호스트 --> 라우터 (o)
라우터 --> 라우터 (x)
===================================================
/etc/gateways 에서 rdisc 제어 가능
rdisc_interval=100 (초)
===================================================
icmp redirect (라우터 2중화 기능)
해커의 icmp redirect 공격 방어
#ndd -set /dev/ip ip_ignore_redirect 1
http://www.sun.com/blueprints/1200/network-updt1.pdf
===================================================
CIDR (supernetting) <-> VLSM (subnetting)
연속된 네트워크여야 함!
211.106.30.0/24
211.106.31.0/24
00011111
00011110
211.106.30.0/23
211.106.31.0/23
===================================================
#ifconfig pcn0 plumb 211.106.30.100/23 broadcast + up
or
#ifconfig pcn0 plumb 211.106.30.100 255.255.254.0 broadcast + up
===================================================
#cat /etc/inet/routing.conf
#rm /etc/defaultrouter
#vi /etc/hostname.pcn0
#vi /etc/hostname.pcn1
#init 6
solaris 9 이하
#ndd -set /dev/ip ip_forwarding 1
solaris 10
#routeadm -u -e ipv4-forwarding
라우팅 활성화
#routeadm -u -d ipv4-routing
#routeadm -u -e ipv4-routing
===================================================
멀티홈드 (Multi Homed)
NIC 2장 이상일 때
solaris 10
#routeadm -u -d ipv4_forwarding
===================================================
자바 테스크톱에서 CDE 콘솔 호출
#dtterm -C &
IP 1)주소체계
2)최적경로 (IP라우팅)
ICMP internet control message protocol (ping)
IGMP internet group messagement protocol (multicast)
ARP address resolution protocol (ip - mac)
tcp 2^16 (0~65535)
udp 2^16 (0~65535)
0~1023 : well known port (관리자 서비스 포트)
1024~49151, 49152~65535 : 학술용 (클라이언트 포트)
tcp 분열 재조립 (pc상)
ip 분열 재조립 (network상)
bus topology - 끝단에 terminator가 있어야 신호가 죽는다
star...
ring...
baseband - digital (binary)
broadband - analog (frequency)
Hub = multiport repeater (flooding)
csma/ca - wireless
prom
netstat -i // 네트웤 카드의 통계 정보, netstat -ni // ip로 출력
banner
ifconfig -a // root만 mac정보 확인 가능, 일반 유저는 확인 안됨
eeprom local-mac-address?=true // system mac을 lan card mac으로 입력
ifconfig pcn0 ether xx:xx:xx:xx:xx:xx // 일회성으로 맥주소 변경
ethernet (digital, interl, xerox = dix)
↓
fast ethernet (ethernet II, dix 2.0)
snoop -v // 상세히
-V // 간단히
-o // output, 파일로 저장할 때
-i // input, 저장된 파일을 읽을 때
-a // audio, 패킷을 잡았을 때 소리나게 함
-s // 통계정보
ndd // 네트워크 파라메타값을 수정하는 명령
ndd (-get) /dev/pcn link_status
0 link disable
1 link enable
ndd (-get) /dev/hme link_speed
0 10M
1 100M
ndd -set /dev/hme link_speed 1 // 100M 변경
ndd /dev/hme link_speed // 확인
32bit ---> 48bit
ARP (ip -> mac)
48bit ---> 32bit
RARP (mac -> ip) // ipv6에서 필요없음
arp -a // arp cache table
-s // static
-f // cache table을 txt로 등록
rarp (fr망 - iarp)
ok boot net:rarp (반대에서는 arp데몬이 떠있어야함)
sol10 > svc -a | grep rarp
svc:/network/rarp
sol9 > /etc/rc3.d/s15nfs.server
sol10 > /etc/rc3.d/S16boot.server
/etc/inet/hosts => /etc/hosts
/etc/ethers => ip와 mac을 매핑
ping x.x.x.x
type 8 (echo request) <-> type 0 (echo reply)
code 0 <-> code 0
subnetting
a class - host : 1677777214
b class - host : 65534
c class - host : 254
서브넷을 하는 이유
1. collission이 발생하여 cpu 사용율 100%가 되어 사용할 수 가 없음
2. network bandwidth가 떨어짐
3. access control (security)
4. ip를 효율적으로 분배하기 위해
/etc/inet/netmask // 넷마스크 설정 파일
ifconfig pcn0 unplumb // 커널에서 pcn0 네트워크 인터페이스 분리 (윈도 장치관리자서 장치 삭제)
ifconfig pcn0 plumb // 커널에 pcn0 네트워크 인터페이스 로딩
ifconfig pcn0 192.168.102.100 netmask 255.255.255.0 broadcast 192.168.102.255 up
(= ifconfig pcn0 192.168.102.100 netmask 255.255.255.0 broadcast + up)
sub interface
ndd /dev/ip ip_addrs_per_if // 가상 인터페이스 추가
ksh -o vi
http://www.solarisschool.com/
logical disk 생성 단계 (최소 3개 이상)
(=meta disk)
1. metadb 생성 => 관찰, 생성/추가, 삭제
(=replica)
// metadb -a -f (c0d1) 생성
// metadb -a (c1d0) 추가
// metadb -d (c1d0) 삭제 (마지막 replica는 삭제 안됨)
// metadb -a -f -c 3 (c0d1) 1개 파티션에 3개의 replica 생성
// metadb -d -f (c1d0) 마지막 replica 삭제
2. raid 기법 및 disk 수 => raid 0~5
3. raid 구성 => 관찰 // metastat
=> 생성, 삭제, grewFS // metainit, metaclear
4. admin task
logical disk 생성
1. radi 0 - concatenate disk 구성
* 2개의 disk를 이용한 구성
#metainit d1(logical disk 이름) 2(disk 수) 1(write disk 수) c0d1s3 1(write disk 수) c1d0s3
#metastat
#metaclear d1(logical disk 이름)
2. raid 0 - stripe disk 구성
*2개 이상의 disk 사용
#metainit d1 1(logical unit) 2(disk 수) c0d1s4 c1d0s4
#metastat
#metaclear d1
#newfs /dev/md/rdsk/d1
?y
#newfs /dev/md/rdsk/d2
?y
mount /dev/md/dsk/d1 /test1
mount /dev/md/dsk/d2 /test2
umount /test1
metaclear test1
umount /test2
metaclear test2
3. mirroring
svm상에서의 mirroring은 1, 0+1만 됨
#metainit d1 1 1 c0d1s3 => 원본
#metainit d2 1 1 c1d0s3 => 밀러
#newfs /dev/md/rdsk/d1
#mount /dev/md/dsk/d1 /test
#metainit -f d12 -m d1 (-m:mirror생성 옵션)
remount 동작 : d12로 mount
#metattach d12 d2 => 밀러 디스크 붙이기
<원본 보존 테스트>
#metadetach d12 d1 => 원본 제거
#cd /test ; ls ; execute-command
#metaclear d12
#metaclear -r d12 => 종속된 서브 밀러 볼륨까지 같이 제거
acl
setfacl [user|group] [uid|gid] [permission] [filename]
getfacl => shaddow inode를 확인
inode - 시간, size, 권한, 소유권 관련, link, pointer
shaddow inode - acl
inode의 권한과 소유권 정보를 가지고 설정
#setfacl -m (acl modify)
-s (acl serial|serise)
-d (delete acl)
#setfacl -m u:userid:rw(or 6),mask:rw(or 6) file
#setfacl -s u::6,g::4,o:4,u:userid:6,mask:6 file
확인
#ls -l file // acl 적용 여부 확인
#getfacl file // acl 내용 여부 확인
acl
acl list 생성
#useradd -d /export /home/acl01 -m -s /bin/ksh acl01
#passwd acl01
#useradd -d /export/home/acl02 -m -g adm -s /bin/ksh acl02
#passwd acl02
#man ls > man.ls
#chmod 400 man.ls
#setfacl -m u:acl01:6,mask:6 man.ls
#ls -l man.ls
#getfacl man.ls
#setfacl -d u:acl01:6,mask:6 man.ls
#ls -l man.ls
#getfacl man.ls
텔넷 접속
$cd /export/home
$vi man.ls => 수정 가능 확인
rbac (역할계정)
1. role 생성
#roleadd -d /export/home/shutrole -m -s /bin/pfksh shutrole
#passwd shutrole
2. 사용자 계정과 role의 연결
#usermod -R shutrole user01
3. 역할에 설명서 부여 (역할 계정에서만 확인 가능)
#vi /etc/security/prof_attr
-------------------------------------------------------------------------------------
<생략>
Shut:::System Shutdown:
-------------------------------------------------------------------------------------
#vi /etc/security/exec_attr
-------------------------------------------------------------------------------------
<생략>
Shut:suser:cmd:::/usr/sbin/shutdown:uid=0
-------------------------------------------------------------------------------------
#rolemod -P Shut shutrole
4. role의 실행 절차
c:\>telnet 192.168.xx.xxx
login:user01
password:
$su shutrole
password:
$/usr/sbin/shutdown
roleadd /etc/user_attr
usermod -R /etc/user_attr
/etc/user_attr =================
ID::::type=role;profiles=Shut;auths // auths : 인증서
ID::::type=nomal;
roles=roleID
============================
roleID => account
auths => /etc/security/auth_attr
profiles => /etc/security/prof_attr
prof_attr => /etc/security/exec_attr => 명령경로
-----------------------------------------------------------------------------------------?
Shut:::Description:attr
helps=file_name
// smc환경에 대비해 html문서로 작성 추천
Shut:suser:cmd:::cmd=patch:uid=0
------- ------ ----
profile 명 script(path) uid,euid,gid,egid
인증서명:::Description1:Description1:attr
(short) (long) (helps=file명)
인증서명 => OS.Category.Category.part
-----------------------------------------------------------------------------------------?
usermod -R "" user01 // 권한 회수, 삭제
usermod -R shutrole user02 // 권한 부여
monitoring 기법
event message
message(log) create
kenel
daemon
user command
test:logger
syslogd => message(log) 발생되면 캡쳐해 기록하는 daemon
message(log) write
file
consol
user 단위 forwarding
logserver
M4 => analyze, 동시 여러 event message를 중요도에 따라 분석하여 보여주는 daemon
/etc/syslog.conf
selector => message source // (kern|daemon|user) (pri) <--> action => write // /var/adm/message
<--> 2tab 이상이 떨어져 있어야 함. 절대 space 사용하면 안됨
nfs server -- web server => user account directory는 nfs server에 있고 web server에서 mount되어 있음.
auto fs (자동적으로 mount 되는 기능, cd명령)
multiple mount - 다중으로 mount 시킬수 있는 기능 (일반 mount기능으로는 할수 없음)
auto mount, auto mount d는 다른 deamon
auto mount map
master - map 관리용 map (/etc/auto_master) // 어떤게 direct map 혹은 indirect map을 사용할지 정의
direct - 절대경로표현 // 파일형식 /etc/auto_### (direct | home등 자유롭게 지정)
indirect - 상대경로표현 (image mount point) // 파일형식 /etc/auto_### (direct | home등 자유롭게 지정)
▒▒▒▒▒▒▒ 실 습 ▒▒▒▒▒▒▒
▒auto_master direct map 등록
#vi /etc/auto_master
━━━━━━━━━━━━━━━━━━━━━
/- auto_direct
━━━━━━━━━━━━━━━━━━━━━
#vi /etc/auto_direct
━━━━━━━━━━━━━━━━━━━━━
data2 -ro 192.168.32.211:/export/share-dir
━━━━━━━━━━━━━━━━━━━━━
#mkdir /data2
#automount
#cd /data2
#df -h
▒auto_master indirect map 등록
#vi /etc/auto_master
━━━━━━━━━━━━━━━━━━━━━
/data3 auto_indirect
━━━━━━━━━━━━━━━━━━━━━
#vi /etc/auto_indirect
━━━━━━━━━━━━━━━━━━━━━
data 192.168.32.211:/export/share-dir
━━━━━━━━━━━━━━━━━━━━━
#mkdir /data3
#cd /data3
#cd data
#df -h
▒ special map - /etc/hosts
#vi /etc/hosts
━━━━━━━━━━━━━━━━━━━━━
192.168.32.211 server1
━━━━━━━━━━━━━━━━━━━━━
#cat /etc/auto_master
━━━━━━━━━━━━━━━━━━━━━
/net -hosts -nosuid,nobrowse => 확인만
━━━━━━━━━━━━━━━━━━━━━
#cd /net ; ls
#cd server1
#cd export/share-dir
#df -h
#cd
#vi /etc/auto_master
━━━━━━━━━━━━━━━━━━━━━
/net -hosts -nosuid => nobrowse 옵션 생략
━━━━━━━━━━━━━━━━━━━━━
#cd /net
▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
RAID (Redundant Arry of Independent Disk)
독립적인 물리 디스크를 논리적으로 병합
RAID 0
RAID 1
RAID 2 사용안함 (과거에 사용)
RAID 3 사용 분야가 다름 (parity disk 사용)
RAID 4 사용안함 (parity disk 사용)
RAID 5
Volume Manager Software (디스크 용량 관리 프로그램)
RAID 0 concatenate : 디스크를 직렬방식으로 붙여 나가는 방식, 한번에 하나의 디스크 사용 (확장성, 디시크 신뢰성이 없음, 복구의 어려움)
stripe : 디스크를 병렬방식으로 붙여 나가는 방식, 다수의 디스크 동시에 사용 (속도 증가, 디스크 신뢰성이 없음, 데이터 손실)
RAID 1 mirroring
0+1 write => volume to mirror, sync (image copy) □□ - ■■ (vv - mm)
read policy // write, read 작업이 동시에 걸릴경우 다른쪽에서 read작업을 분산처리 (write작업순위가 높음) - 고정방식, round-robin, geometric
write policy // parallel (write시 바로 sync), serial (write후 sync)
빠른 속도, 복구, 가격 최소 2배 이상
1+0 0+1보다 복잡, 특징은 0+1과 동일, 복구 신속 □■ - □■ (vm - vm)
RAID 5 각 디스크에서 parity 사용해 복구, 최소 3개 디스크 사용, 가격 1/n로 증가, 2개 이상의 디스크 손상시 복구 불가, write time stripe 75~60% (디스크 손상시 45%)
RAID 6 parity를 듀얼로 사용, 2개까지 손상되어도 복구 가능
soft partitions : disk가 병합된 volume을 partition을 나누는 방법
replica (복사본) = state database = metadb ==> volume에 대한 디스크 정보를 가지고 있는 디스크 (파티션)
volume manager software => 기본단위 disk (solaris는 partition)
/dev/md/dsk (or rdsk)/c2t0d1 c2는 가상 컨트롤러, solaris에서는 c2t0 생략
devfsadm
prtconf
가상 메모리 swap
swap size 보기 # swap -s
swap 장치 보기 # swap -l
swap 추가
파일로 추가
# mkfile 50m /export/swapfile
# ls -l /export/swapfile
# swap -a /export/swapfile
# swap -s
파티션으로 추가
# format ---> 새로운 swap용 파티션 생성
# swap -a /dev/dsk/clt0d0s3
영구적인 사용 (공통 작업)
# vi /etc/vfstab 에서 등록
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
장치명 fsck장치 포인트 FStype 우선순위 부트시 마운트 옵션
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
파일명 - - swap - no -
장치명
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
swap 삭제
# swap -d
# swap -l
NFS (Network File System)
자료의 일괄성, 자료의 신뢰성, 자료의 관리 효율
server는 데이타만 전송 client가 전송된 데이타를 실행 (client 리소스를 사용)
root로 다른 공유디렉토리로 접속하면 nobody로 변경되어 접속
/etc/dfs/dfstab => 서버구성
/etc/dfs/sharetab
/etc/rmtab
/etc/dfs/fstypes
/etc/mfs/nfslog.conf => log 정책
/etc/default/nfslogd => daemon 활동 정책
┏nfsd => handling
┗mountd=> mount 명령의 연결 요청 수락
┌statd => 상태 확인
└lockd => 상태 유지
nfslogd=> (생략 가능)
nfs server/cilent 구성
1. nfs server 구성
1) /etc/dfs/dfstab 에 내용 정보(share) 등록
2) /etc/init.d/nfs.server nfs server daemon 프로그램 동작
3) dfshares 명령을 이용해 공유 목록 확인
# share 명령을 이용한 공유의 형태
share -o [option-key] [share-dir]
[option-key]
ro/rw : read-only/read & write
log=tag : /etc/nfs/nfslog.conf에 등록된 태그로 로깅 정보 기록
ro,rw=access-list : 기본 공유는 ro 공유, access-list에 등록된 시스템만 rw공유
anon=UID : 접근하는 클라이언트에게 서버의 UID 값을 부여 (사용안함)
ifconfig pcn0 ip-add
ifconfig pcn0 up
server
vi /etc/dfs/dfstab => share /data
mkdir /data
touch file1 file2 file3
/etc/init.d/nfs.server start
dfshares
share
/etc/hosts
/etc/inet/ipnodes
share -o ro,rw=.valdue.co.kr:.valdue.com
client
/etc/vfstab => 영구적으로 사용할 시 작성
dfshares serverIP
mkdir /data-ex
mount serverIP:/data /data-ex
df -h
cd /data-ex