본문으로 바로가기

1일차 ~5일차 복습

 

1. 네트워크 정의

 

  - 정보 공유를 목적으로 pc와 pc들이 모여서 이룬 망이다.

   (최근에는 스마트폰, 에어콘, 보일러, 창문, 자동차, 주방기구)에도 네트워크로 연결.... 이것을 IoT라고 함.

  - 장점 : 사용자입장에서 편리함, 경제성, 용이성 ex) 인터넷 예매

  - 단점 : 정보 유출, 보안 취약하다


2. 프로토콜
-데이터 전송  규약
- tcp, udp,ip,eth

 

3. 인캡슐레이션: <---> 디캡슐레이션
프로토콜을 추가하는과정

 

4. 네트워크 유형

1) LAN
- 내부 네트워크
- 장비 : 스위치, ,utp 케이블, pc 랜-카드, 무선ap
- 설계권장: 스타 토폴로지 + 이중화 도입


2) WAN
- 외부 네트워크
- 장비:  라우터, L3 스위치
- 프로토콜: HDLC, PPP, Frame-Relay,Ethernet
- 연결 방법 : ISP 업체를 통해서 연결
-SI>NI업체에서 관리

 

5. 데이터 전송 관계
- 요청에 의한 응답 관계
-요청자 : 클라이언트
- 응답자 : 서버

 

6. 데이터 전송 방식
-유티케스트 : 1:1
-브로드케스트 :1:n, 주로 내부네트워크에서 사용
arp요청할때 주로 사용(내부 네트워크만)
외부나갈때는 멀티캐스트로 전환해서 전송
-멀티케스트 : 1: 특정
-D클래스...

 


7. 데이터 전송 주소 체계
1) 포트 번호
- TCP,udp 헤더 안에 포함된 주소
- 주소 체계: 16bit
- tcp
-udp : snmp(161), tftp(69), dhcp server(67), dhcp client(68)
-클라이언트 입장 : 서비스 요청 -> 실행
-서버입장 : 서비스 구분 -> 제공

클라이언트                         서버
SA 55000                          SA 80
DA 80                             DA 50000


2) ip주소
- ip 헤더 안에 있는 주소(32bit)
- 논리적주소(설정 및 수정이 가능한 주소)
- 로컬 네트워크에서 리모트 네트워크로 데이터 전송 담당

 

3)MAC 주소
- 2^48개(48bit)
- 물리적 주소(설정 및 수정이 불가능한 주소)
- 소프트웨어적으로 명령어를 이용하여 수정 가능
- ETH 내부 네트워크 환경에 한해서 데이터 전송 담당


-netstate -n
-netstat -n -a: udp까지 볼수 있다
- ipconfig /all
-nslookup
-ncpa.cpl


인터넷이 안되면

L3 ip
L2
L1 선점검

 

8. 데이터 전송 프로토콜
1) tcp
3-way 핸드 쉐이킹을 실시하여 통신 연결 수립
- syn,(syn,ack),syn
- 데이터 스트링 서비스
- 흐름제어(stop & wait-> 슬라이딩 윈도우)
- 혼잡제어
- 오류 검사
-재전송 기능

 

2)udp
-layer 4
- 오류 검사

3)ip
-layer3
- 로컬네트워크에서 리모트 네트워크로 데이터 전송
-ttl: 거리 측정 및 패캣 루프 방지이 0이되면 drop, 1부터 시작....

 


4) icmp
-layer 3
-ip프로토콜에 대한 연결성을 테스트하는 메세지 형식의 프로토콜
-메세지 유형: Icmp Echo request, icmp Echo response
-명령어: ping, tracert
-tracert
ttl을 1로 보내고 2,,3,4
3이면 3번보내고 3번 응답함
*이면 방화벽으로 막힐 가능성이 있음
마지막 갯수를 빼면 라우터 갯수를 알수있다.

 

5)ARP
-layer3
- 목적지ip 주소에 해당하는 MAC주소를 설정
- 상대방 맥주소를 학습하기 위한 메세지 유형
ARP Request(브로드케스트)
ARP Response(유니케스트)
- 명령어, arp -a, arp -d, arp -s

[참고]
1. 스푸핑 공격
- 변조 공격: 공격자 정보 노출 방지, 응답 회피

2. 플러딩 공격
- 대량 패킷 전송 : 서버 과부하 발생, 서비스 연결 방해(Dos,DDos)
Ex)
- smuff 공격(공격자가 발생시킨 패킷을 여러대 좀비 pC에 의해서 서버로 응답을 보내는 공격)

- LAND공격(출발지와 목적지 주소를 서버 주소로 설정하여 보내는 공격)
3. 훔쳐보기 공격

9. ip 주소 특징

ex1) 182.162.54.123. 255.255.255.224(11100000)
-네트워크 이름   182.162.54.48
16*3=48~63
16*4=64
-서브넷 브로드케스트 주소182.162.54.63
-설정 가능한 ip주소 범위  및 개수 =2^5-2개
-공인


255.255.255.255-0
255.255.255.254-2씩
255.255.255.252-4씩
255.255.255.248-8씩
255.255.255.240-16씩
255.255.255.224 32씩

255.255.255.192-64씩
255.255.255.128-128씩


192.168.67.161 255.255.255.240(11110000)

C클래스
176
191,2^4-2
사설

Ex5) 121.160.160.0/24 ~ 121.160.127.0/24 요약
121.160.0001 0000.0
121.160.0001 0001.0
~
121.160.0001 1111.0 ->121.160.16.0/20  121.0.0.0/8
-------------------------
ex6) 198.133.32.0/24 ~198.133.63.0/24
198.133.001 00010.0
198.133.001 00011.0
~
198.133.001 11111.0-> 198.133.32.0/19(공통비트만큼 더해 준다)

ex7) 172.16.0.0 ~172.31.255.255
172.0001 0000.0.0
172.0001 0001.0.1
172.0001 1110.255.255
~
172.0001 1111.255.255
공통비트 뒤에 나머지를 0처리
-------------------------------------- 172.16.0.0/12
255.1111(공통비트를 1로바꾼다) 0000.0.0  ->255.240.0.0/12

명령어
Router     User Mode  사용자 모드
Router #  Privilege Exec Mode 관리자 모드


-정보확인 show,debug
-저장
-삭제
-재부팅
-테스트 
-원격 접속 telnet,ssh
Router#show user 누가 내장비 접속했는지 확인
exit 콘솔종료
tab 명령어 자동완성, 축약기능
? 도움말 기능
스페이스바 한페이지씩
Router#show i
% Ambiguous command: "show i"
축약을 너무 많이 했다.
show iq
             ^
% Invalid input detected at '^' marker.

^부분부터 잘못입력함
Router#show ip
% Incomplete command.
명령어 실행 부족
Router#show ip int brief
Interface              IP-Address      OK? Method Status(L1)                Protocol(L2)
administratively down: 인터페이스가 닫혀있는 상태

running-config -> RAM : 동작하기 위해 실행되는 명령어
재부팅하면 사라짐

conf t: Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line.  End with CNTL/Z.
end, 컨트롤 z : 관리자 모드

running-config에서  hostname R1 설정이 된다.
재부팅하면 사라짐
show  run-> reload
startup-config -> NVRAM으로 저장하려면 , copy run start


Translating "sdafsadfsadfj;"...domain server (255.255.255.255)
실제 장비에서는 기다려야 한다/
conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip domain-lookup -> dns요청 안함

 

나중에 오타입력했을때 dns요청 안함...
R1(config)#line con 0
R1(config-line)#logg syn -> 라인정리

 

R1(config-if)#line con 0
R1(config-line)#exec-timeout 0 0 -> 30초 뒤에 종료


정리............
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#
R1(config)#no ip domain-lookup <- DNS 요청 X
R1(config)#
R1(config)#line con 0
R1(config-line)#exec-timeout 30 30 <- 30분 30초동안 입력 없으면 콘솔 종료, 실제 장비에서는 기본값이 있다
R1(config-line)#
R1(config-line)#exec-timeout 0 0 <- 콘솔 종료 X
R1(config-line)#
R1(config-line)#logg syn <---------- 라인 자동 정리 기능
R1(config-line)#
R1(config-line)# Ctrl+Z
R1#

R1#show run
R1#copy run start

 

5. 라우터 패스워드 설정

 

 - R1 설정을 참조하여 R2와 R3에도 설정을 실시한다.

 

R1#conf t
R1(config)#
R1(config)#enable secret cisco 유저모드에서 관리자모드로 들어갈때(show run하면 암호화)
R1(config)#enable password cisco1234
R1(config)#
R1(config)#line con 0
R1(config-line)#password ciscocon
R1(config-line)#login
R1(config-line)#
R1(config-line)#line aux 0 -> 사용할일이 별로 없다....
R1(config-line)#password ciscoaux
R1(config-line)#login
R1(config-line)#
R1(config-line)#line vty 0 4
R1(config-line)#password ciscovty
R1(config-line)#login
R1(config-line)#end
R1#
R1#show run
R1#exit----> 유저모드로 전환됨

a,b PC ip setting

 

7. FastEthernet 0/0 인터페이스 설정(R2,R3도 동일)

R1#conf t
R1(config)#int fa0/0
R1(config-if)#ip address 13.13.10.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end

R1#show run
R1#show ip int brief
R1#show int fa0/0

 

R1#ping 13.13.10.2
R1#ping 13.13.10.3


R1#show arp

DTE(라우터)             DCE         
R1[s1/0]-----------csu/dsu-----------isp
v.35 back to back cable
v.35 smart back to back cable 현재는 많이 사용 안됨
패킷트레이서에는 중간에 csu/dsu모뎀이 없다.

8. R1 S1/0 - R2 S1/1 인터페이스 설정(R2,R3)도 동일

 

                                                       "clock rate 1000000"
     DTE                                                       DCE
R1[S1/0]--------------HDLC---------------[S1/1]R2

R1#show controllers s1/0
R1(config)#int s1/0
R1(config-if)#ip address 13.13.12.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#end
R1#show run
R1#show ip int brief


R2#show controllers s1/1
R2(config)#int s1/1
R2(config-if)#ip address 13.13.12.2 255.255.255.0
R2(config-if)#clock rate 2000000
R2(config-if)#no shutdown
R2(config0if)#end
R2#show run
R2#show ip int brief

r1,r2 셋팅해야 up

R2# ping 13.13.12.2

R1# show ip int brief
R1# ping 13.13.12.1
 
-----------------------------------------------------
R1 show ip route
DA 13.13.12.2 이면 나갈 수 있다.. 왜
13.13.12.0이 있으니깐

Packet Tracer PC Command Line 1.0
 A PC>ping 13.13.30.3

Pinging 13.13.30.3 with 32 bytes of data:


Reply from 13.13.10.1: Destination host unreachable.
Reply from 13.13.10.1: Destination host unreachable.
Reply from 13.13.10.1: Destination host unreachable.
Reply from 13.13.10.1: Destination host unreachable.
                             (라우터에 경로가 없다...)
Ping statistics for 13.13.30.3:
    Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),

라우터 경로 추가 업데이트를 해야 한다.

 
conf t
lo: 가상인터페이스
int lo 172가상인터페이스
#ip address 172.16.1.1 255.255.255.0
삭제할때 no int lo 172

R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#line vty 0 4
R1(config-line)#no password
R1(config-line)#password ciscovty
R1(config-line)#login
R1(config-line)#enable secret cisco

-A Pc에서 telnel 13.13.10.1접속


R1(config)#banner motd ^ 배너 만들기
Enter TEXT message.  End with the character '^'.
### R1 ###
^

banner motd 0 이면 나올때도 0

no banner motd

R1(config)#end
R1#
%SYS-5-CONFIG_I: Configured from console by console

R1#show run

텔넷 접속해서 확인

PC>telnet 13.13.10.1
Trying 13.13.10.1 ...Open
### R1 ###

 

 

 

 

 

4일차에 서브넷팅한것 + 5일차 cisco 명령어를 조합한것을 실습하였다..... (기본설정,인터페이스설정,핑테스트)

ex)

132.100.0.0/16


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#ip address 132.100.4.1 255.255.254.0
R1(config-if)#no shutdown

 

R1#show run
interface FastEthernet0/0
 ip address 132.100.4.1 255.255.254.0

R1#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        132.100.4.1     YES manual up                    up
 
R1#show int f0/0
FastEthernet0/0 is up, line protocol is up (connected)
  Hardware is Lance, address is 0060.47b9.048c (bia 0060.47b9.048c)
  Internet address is 132.100.4.1/23

R1#ping 132.100.4.2

R1#show arp
Protocol  Address          Age (min)  Hardware Addr   Type   Interface
Internet  132.100.4.1             -   0060.47B9.048C  ARPA   FastEthernet0/0
Internet  132.100.4.2             0   0001.4351.E416  ARPA   FastEthernet0/0


R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int f0/1
R1(config-if)#ip address 132.100.6.1 255.255.255.224
R1(config-if)#no shutdown
R1(config-if)#end

R1#show run
interface FastEthernet0/1
 ip address 132.100.6.1 255.255.255.224
 duplex auto
 speed auto

 
R1#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol
FastEthernet0/0        132.100.4.1     YES manual up                    up
 
R1#show int f0/1
FastEthernet0/1 is up, line protocol is up (connected)
  Hardware is Lance, address is 000a.f331.bc6e (bia 000a.f331.bc6e)

 

R1#ping 132.100.4.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 132.100.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/4/10 ms

 

R1#ping 132.100.6.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 132.100.6.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/10/18 ms


R2>en
R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int f0/0
R2(config-if)#ip address 132.100.0.1 255.255.252.0
R2(config-if)#no shutdown

R2(config-if)#end

R2#show run

interface FastEthernet0/0
 ip address 132.100.0.1 255.255.252.0

 

R2#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol
 FastEthernet0/0        132.100.0.1     YES manual up                    up

 

R2#show int f0/0
FastEthernet0/0 is up, line protocol is up (connected)
  Hardware is Lance, address is 000c.cfbd.60b9 (bia 000c.cfbd.60b9)
  Internet address is 132.100.0.1/22

 

R2#ping 132.100.0.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 132.100.0.2, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/1 ms

 

R2#show int s0/0
Serial0/0 is administratively down, line protocol is down (disabled)
  Hardware is HD64570

 

R2#show controllers s0/1
Interface Serial0/1
Hardware is PowerQUICC MPC860
DCE V.35, no clock

 

R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#int s0/1
R2(config-if)#ip address 132.100.6.34 255.255.255.252
R2(config-if)#clock rate 1000000
R2(config-if)#no shutdown

%LINK-5-CHANGED: Interface Serial0/1, changed state to down
R2(config-if)#end
R2#show run
R2#show ip int brief
Serial0/1              132.100.6.34    YES manual down                  down

 

R1#show controllers s0/0
Interface Serial0/0
Hardware is PowerQUICC MPC860
DTE V.35 TX and RX clocks detected
R1#show run
ip address 132.100.6.33 255.255.255.252

 

R1#show ip int brief
Interface              IP-Address      OK? Method Status                Protocol
 
FastEthernet0/0        132.100.4.1     YES manual up                    up
 
FastEthernet0/1        132.100.6.1     YES manual up                    up
 
Serial0/0              132.100.6.33    YES manual up                    up

 

R1#ping 132.100.6.34

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 132.100.6.34, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 9/9/9 ms

R2#ping 132.100.6.33

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 132.100.6.33, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms

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

 

나머지 부분도 위와 동일