1. http://linux.sarang.net/image/... ... - hostname : linux - domain name : sarang.net - FQDN(Fully Qualified Domain Name) : linux.sarang.net - URL(Uniform Resource Locator) : http://linux.sarang.net - URI(Uniform Resource Identifier) : http://linux.sarang.net/image/... 2. TCP and UDP - TCP(Transmission Control Protocol) - 자료의 전송시 모든것을 하나하나 확인함 - 부하가 많이 걸림 - 암호화 되지 않음 - UDP(User Diagram Protocol) - 자료 전송시 확인하지 않음 - 부하가 낮아서 속도가 필요한 경우에 이요 * Netware : 네트워크상에서 원하는 컴퓨터를 찾기위해 broadcast식으로 모두 접속하여 확인함. 이 과정에서 상당한 부하가 발생하며 사내 네트웍의 60-70%를 차지하기도 함 - 실제 접속후에는 tcp/ip 형식으로 자료교환 3. IP 체계 A Class : 0-126.0.0.0 : 0.0.0.0 - 126.255.255.255 B Class : 128-191.0.0.0 : 128.0.0.0 - 191.255.255.255 C Class : 192-223.0.0.0 : 192.0.0.0 - 223.255.255.255 D, E Class : 실제 사용하지 않으며 예비용임 A Class : 첫번째 자리를 고정해서 부여함 : 256x256x256 B Class : 두번째 자리를 고정해서 부여함 : 256x256 C Class : 세번째 자리를 고정해서 부여함 : 256 * 256개중 0 : network address(라우터) 255 : broadcast address 두개는 사용하지 못함 * 256개를 둘로 나누었을 경우 사용못하는 ip넘버는 4개로 늘어남 * 127.0.0.1 : 자기컴퓨터의 주소로 Test용 등에 이용 4. 네트웍 컴퓨터 찾는 과정 - 예를 들어 165.229.11.9에서 210.243.157.100으로 자료를 보낸다면 210.243.157.0(라우터) 로 자료를 일단 전송함. 그 후 아래의 100번 컴퓨터는 라우터에서 찾아 자료를 보내주게 됨 즉 인터넷은 라우터끼리의 연결이라고 말할수 있음 - s/w : IP Address - h/w : MAC(Media Access Control) Address : Lan Card의 고유넘버로 16진수 6자리로 되어 있음 [][][] [][][] 회사에 할당됨 256x256x256 * 전세계의 Lan Card는 MAC Address number가 전부 다름 * 실제로 인터넷 상에서 컴퓨터를 구분하는 것은 IP가 아닌 MAC Address이다 - 라우터는 내부 컴퓨터의 MAC Address와 IP Address를 수시로 check 한다 그래서 실제로 컴퓨터의 IP Address를 바꾸면 IP Address와 MAC Address를 비교하여 해당 컴퓨터를 찾게 된다.5. OSI Model (http://giga.easysw.org 참조) 1) Application 2) Presentation 3) Session - 암호화 4) Transport - 전송관리 계층(연결, 연결확립, 연결확인 -- 원래 data가 segment로 나눠짐) 5) Network - 실제 전송 (최적화 경로를 찾음=라우팅 -- packet으로 나눠짐) - 라우팅 프로토콜 - RIP(routing information protocol) - 거리 - OSPF(open shortest path first) - 시간 6) Data Link - 장비 접속 - 최단경로 선택, 장비를 거칠때마다 자료에 packet이 첨가됨 7) Physical - 자료가 이진수로 바뀌어 전송됨 1-3) : data - ftp, http, smtp 4) : data를 segment로 나눔 - TCP, UDP ... 5) : packet(64k)으로 나누어짐 - IP, RIP, OSPF 6) : frame - FDDI, Ethernet, ISDN 7) : bits - FDDI, Eternet, ISDN * 인터넷 상에서 자료를 보낼때 TCP가 packet울 나누어 인터넷 상에서 뿌리면 도착지의 라우터에서 재조립됨 -OSPF프로토콜에 따라 먼저보낸 패킷이 나중에 도착할 수도 있음 이 때 순서대로 재조립 하며 에러가 나면 재전송을 요구함. * 라우터의 주소는 대부분 1번이나 254번을 이용함 - 주로 254번 6. 기본적인 default port number - http : 80 - ssh : 22 - telnet : 23 - mail : smtp 25 pop3 110 - ftp : 21 7. 설정예 ip 210.107.75.55 인경우 C Class 이므로 network주소는 210.107.75.0 broadcast주소 210.107.75.255 netmask주소는 255.255.255.0 subnet이 2인경우 netmask주소 255.255.255.128 network주소 xxx.xxx.xxx.0 and xxx.xxx.xxx.128 subnet이 4인경우 netmask주소 255.255.255.192 network주소 0, 64, 128, 1928. /etc/modules.conf : 로딩되는 module 목록 - lsmod : 현재 작동중인 module 확인 - modules.conf에 없더라도 작동되면서 적재되는 module이 있음 - modules.conf에서 쓰지 않는 module 주석 처리 - 서버에서는 module을 쓰지 않고 커널에 집어넣는다. - 방화벽등이 기본설정에서 module로 작동하고 있으므로 속도의 저하가 있다 이럴경우 서버에서는 커널컴파일한다. - lsmod : 모듈올리는 것 - rmmod : 모듈 내리는 것 (device죽이고 난 후 제거가 가능함) - modprobe : 자동으로 지가 알아서 찾아줌9. 네트워크 카드 설정 - /etc/hosts, /etc/sysconfig/network, /etc/resolv.conf, /etc/sysconfig/network-scripts/ifcfg-eth0(1, ...) 1. /etc/hosts * 외부로 나가는 것은 문제가 없으나 자신의 서비스가 외부로 제공되지 않을때 * /etc/host.conf - order hosts,bind,multion - hosts파일을 먼저 확인하고, (bind)네임서버 확인, (multion)ip공유시??? * 퍼미션이 644 or 444정도일것 읽을수 없다면 모든 서비스가 먹통이 됨.. - 자신의 컴퓨터를 확인하지 못하므로 * /etc/services : 포트 넘버등이 설정되어 있음 - 응용프로그램 작동시에 따로 포트넘버를 설정하지 않아도 됨 2. /etc/sysconfig/network (route) * 일반적인 네트웍 설정, Gateway를 여기서 설정해 준다. * FORWARD_IP4=true : 라고 해주어야 마스커레이딩, NAT설정시 ip공유가 가능 3. /etc/resolv.conf (host, nslookup, nmap) * NameServer 설정이 되어 있다. 4. /etc/sysconfig/network-scripts/ifcfg-eth0 (netstat, ping, traceroute) * Lan 카드의 ip, netmask, broadcast 등등 설정 * static : 고정 IP, network은 항상 최고 앞번 broadcast는 항상 최고 끝번으로 - /etc/rc.d/init.d/network restart10. 네트웍관련 명령어들 - host domainname : ip 주소 확인 - ping * ICMP protocol 사용 * ttl : 252개의 컴퓨터를 지나면 패킷이 사라짐(패킷이 경로를 모르고 헤맬때) * 패킷의 최대크기 64k - netstat -antu : 자세하게 출력 -r : 라우팅정보 출력 - nmap localhost : 자신의 열려진 포트주소 정보 - traceroute -I domainname : I 옵션으로 방화벽 해결 - ifconfig * collision이 RX에 비해 10% 넘어선다면 문제.. 11. nsswitch.conf(파일시스템 데이타베이스와 네임서비스 스위치설정파일) 네트워크 서비스 스위치( network service switch ) 파일 /etc/nsswitch.conf 는 /etc/host.conf파일이 호스트를 찾는 방법들을 결정하는 것과 같이, 어떤 정보가 요구 되어졌을때, 그것을 찾는 순서를 결정한다. 예를 들어서 다음 라 인을 보면, hosts: files nisplus dns 이것은 호스트를 찾는 펑션에서 먼저 로컬의 /etc/hosts 파일에서 먼저 찾고, 그 다음 NIS+에 의해 찾고, 마지막으로 도메인 네임 서비스(/etc/resolv.conf 와 named)를 통해 찾는다. 이 경우 맞는 것을 못찾았을 경우 에러가 리턴된다. 다음은 한컴리눅스 3.0 설치시 디폴트 설정이다. 아래와 비교 참고하자. # # /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Legal entries are: # # nisplus or nis+ Use NIS+ (NIS version 3) # nis or yp Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # db Use the local database (.db) files # compat Use NIS on compat mode # hesiod Use Hesiod for user lookups # [NOTFOUND=return] Stop searching if not found so far # # To use db, put the "db" in front of "files" for entries you want to be # looked up first in the databases # # Example: #passwd: db files nisplus nis #shadow: db files nisplus nis #group: db files nisplus nis passwd: files nisplus shadow: files nisplus group: files nisplus #hosts: db files nisplus nis dns hosts: files nisplus dns # dns # Example - obey only what nisplus tells us... #services: nisplus [NOTFOUND=return] files #networks: nisplus [NOTFOUND=return] files #protocols: nisplus [NOTFOUND=return] files #rpc: nisplus [NOTFOUND=return] files #ethers: nisplus [NOTFOUND=return] files #netmasks: nisplus [NOTFOUND=return] files bootparams: nisplus [NOTFOUND=return] files ethers: files netmasks: files networks: files protocols: files nisplus rpc: files services: files nisplus netgroup: files nisplus publickey: nisplus automount: files nisplus aliases: files nisplus 다음은 NIS+를 위한 /etc/nsswitch.conf의 좋은 예이다. # # /etc/nsswitch.conf # # An example Name Service Switch config file. This file should be # sorted with the most-used services at the beginning. # # The entry '[NOTFOUND=return]' means that the search for an # entry should stop if the search in the previous entry turned # up nothing. Note that if the search failed due to some other reason # (like no NIS server responding) then the search continues with the # next entry. # # Legal entries are: # # nisplus or nis+ Use NIS+ (NIS version 3) # nis or yp Use NIS (NIS version 2), also called YP # dns Use DNS (Domain Name Service) # files Use the local files # db Use the local database (.db) files # compat Use NIS on compat mode # [NOTFOUND=return] Stop searching if not found so far # passwd: compat # for libc5: passwd: files nisplus group: compat # for libc5: group: files nisplus shadow: compat # for libc5: shadow: files nisplus passwd_compat: nisplus group_compat: nisplus shadow_compat: nisplus hosts: nisplus files dns services: nisplus [NOTFOUND=return] files networks: nisplus [NOTFOUND=return] files protocols: nisplus [NOTFOUND=return] files rpc: nisplus [NOTFOUND=return] files ethers: nisplus [NOTFOUND=return] files netmasks: nisplus [NOTFOUND=return] files netgroup: nisplus bootparams: nisplus [NOTFOUND=return] files publickey: nisplus automount: files aliases: nisplus [NOTFOUND=return] files