━━━━ ◇ ━━━━
정보보안실무/네트워크

Net.01 GNS3 구축 및 서브넷팅

728x90
반응형

구축환경
GNS3 - (https://www.gns3.com/software/download)

GNS3


Cisco Packet
Router (3계층)
Switch (2계층)  L2 SW (Layer 2 SWitch) 
L3 SW(라우터와 같은 역할 가능(라우터 넘버 3으로 시작함))
L4 SW
L4~L7 SW
녹색링크의 의미: 물리적으로 데이터 통신에 전혀 문제가 없음을 나타냄
붉은링크의 의미: 추가적인 설정 필요함
통신에 참여하는 것들은 '노드'라고 표현한다


FW
PM
Endpoint Detection (EDR) 

덩어리를 하나의 랜(LAN)이라고 한다. 

Option - show device Model labels 체크해제 
always show port labels in logical workspace 체크 

ethernet 전송속도: 10mb
fast ethernet 전송속도: 100mb
현재 전송방식은 모두 ethernet이다.


처음 A, B에게는 MAC 주소 밖에없다. 
IP주소를 줘야한다. 
클릭 - desktop - ip configuration - IPv4 Address
192는 C클래스 주소이다. 
그래서 서브넷에 255.255.255.0이 자동입력된다. 
* 특정한 서브넷 마스크 사용 시 사용가능한 ip주소 범위가 있다.

ping 확인하기

내부통신: 내부네트워크(장비)끼리 통신하는 것

CLI = set up 모드 (command line interface) 

would you like to enter the initial configuration dialog? [yes/no] : n
press RETURN to get started! - enter
Router> : 사용자모드 
Router>enable
Router# : privillages 모드 (=enable 모드)
 Router#configure terminal
Router(config)# : (전역설정모드/장비전체에 영향을 미침) 
*Gig0/0의 주소가 A, B의 게이트웨이 역할을 함 (게이트웨이: 내외부의 관문) 
*Gig0/0 주소설정
Router(config)#interface Gig0/0
Router(config-if)#
Router(config-if)#exit (이전모드로 가고싶을 때)
Router(config)#line vty 0 4
Router(config-line)# 
* end나 ctrl+z를 누르면 바로 enable모드로 간다. 

Router#show version (버전 및 스펙을 보고싶을 때) 
Router#show flash (flash메모리 내용)
Router(config)#show flash (사용안됨. 각 모드마다 사용할 수 있는 명령어가 정해져있음) 

[기본설정명령어]
Host 이름 바꾸기
Router(config)# -> router: 장비의 이름
Router(config)#hostname 주고싶은 이름

[접속시 패스워드설정]
exit 두번으로 다시 돌아가기
yw con0 is now available
Press RETURN to get started. <- 이런 메시지뜸
yw>enable
yw#configure terminal
yw(config)#line console 0
yw(config-line)#login
yw(config-line)#password 1234
end 누르고 exit 하고 다시 접속
User Access Verification
Password:  패스워드 입력

[보안성을 조금 더 높이기 위한 작업]
(enable이라는 명령어를 내렸을 때 비밀번호 걸기) 
yw>enable
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#enable password 12345

[현재설정상태 보기]
yw#show running-config (RAM(Random Access Memory)안에 있는 정보) 
NVRAM: 비휘발성메모리 

[enable password를 암호화시키는 방법]
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#enable secret 123456
enable secret 5 $1$mERr$H7PDxl7VYMqaD3id4jJVK/
enable password 12345
두개가 같이 설정 돼 있을 경우 secret 비번이 우선적으로 적용됨

[모든 패스워드를 암호화하고 싶을 때]
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#service password-encryption
- enable secret 5 $1$mERr$H7PDxl7VYMqaD3id4jJVK/
- enable password 7 08701E1D5D4C

 [vty: virtual terminal 원격접속 ]
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#line vty 0 4
yw(config-line)#login
% Login disabled on line 388, until 'password' is set
% Login disabled on line 389, until 'password' is set
% Login disabled on line 390, until 'password' is set
% Login disabled on line 391, until 'password' is set
% Login disabled on line 392, until 'password' is set ---원격으로 접속할 수 있는 동접 수  (5) 
yw(config-line)#password 1234
yw(config-line)#


[IP주소 주는 방법]
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#interface gi0/0
yw(config-if)#ip address 192.168.10.1 255.255.255.0
(3계층 장비의 기본값은 기본적으로 shutdown 되어있다) 
yw(config-if)#no shutdown

A PC로 가서 게이트웨이 주소 입력
B PC로 가서 게이트웨이 주소 입력


[오른쪽 라우터] 
이름바꾸기
(램은 전원이 꺼지면 정보가 날아간다. 하지만 저장돼있는 걸 보려면 아래)
변경을 하면 반드시 저장해야한다. 
Router>enable
Router#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname Daegu
Daegu(config)#exit
Daegu#
%SYS-5-CONFIG_I: Configured from console by console

Daegu#copy running-config startup-config
Destination filename [startup-config]?  -> enter
Building configuration...
[OK]
Daegu#

시리얼 IP 주소주기
yw>enable
Password: 
yw#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
yw(config)#interface Se0/3/1
yw(config-if)#ip address 192.168.30.100 255.255.255.0
yw(config-if)#no shutdown


[스위치 IP 주소 할당하기]
Switch>enable
Switch#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#hostname X-SW
X-SW(config)#interface vlan 1(논리적인 인터페이스)
X-SW(config-if)#ip address 192.168.10.150 255.255.255.0
X-SW(config-if)#no shutdown

X-SW(config-if)#
%LINK-5-CHANGED: Interface Vlan1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface Vlan1, changed state to up

게이트웨이 설정
X-SW(config-if)#exit
X-SW(config)#ip default-gateway 192.168.10.1
X-SW(config)#exit
X-SW#write memory (저장명령어) 

write vs copy (먹힐때가 각각 다르기때문에 일단 편한거 쓰기) 

ctrl + shift + 6 : 스펠링 틀렸을 때 빠져나오는 방법

copy run start

en: enable
conf t: configure terminal 


ip주소 설계는 할당량에 대해 나눠서 할당하는 것이다. 
그래서 ip주소 관리대장이라는 것이 있다. 
주소가 있어야 도달하지만 큰 의미는없다. 
하지만 네트워크 상에서는 서브넷 마스크(255.255.255.0)가 중요하다. (절대 꼬이면 안됨) 


ftp로 들어갈 때
ftp  ip주소
dir: 파일들 보기 
파일 다운로드: get
파일 업로드 : put  




[라우터 + 라우터]
CISCO 2901 (Router0)





enable 

config-terminal 

int gi0/1  // 이더넷포트

no shutdown // 포트 활성화

ip address 192.168.1.1 255.255.255.0 



int se0/3/0  // 이더넷포트

no shutdown // 포트 활성화

ip address 192.168.3.1 255.255.255.252 

// ip 2개만 필요하기떄문에 마스크 252



ip route 192.168.2.0 255.255.255.0 192.168.3.2 

// 상대방 이더넷 네트워크로 가기위한 반대쪽 라우터 포트









CISCO 2901 (Router1)







enable 

config-terminal 

int gi0/1  // 이더넷포트

no shutdown // 포트 활성화

ip address 192.168.2.1 255.255.255.0 



int se0/3/0  // 이더넷포트

no shutdown // 포트 활성화

ip address 192.168.3.2 255.255.255.252 

// ip 2개만 필요하기떄문에 마스크 252



ip route 192.168.1.0 255.255.255.0 192.168.3.1 

// 상대방 이더넷 네트워크로 가기위한 반대쪽 라우터 포트

 

 

 


서브넷팅

 

같은 집
192.168.10.100
255.255.255.0  => prefix 표기법 /24 = 1이 24개 즉 11111111.11111111.11111111.00000000
* 장비는 10진수 이해못함. 2진수만 이해함

128 64 32 16 8 4 2 1 

11000000.10101000.00001010.01100100
11111111.11111111.11111111.00000000 AND 연산(비트 값이 1, 1일 때 '1'이 나오는 연산)
--- NETWORK ID --   - Host ID-
11000000.10101000.00001010.00000000 
192.168.10.0 -> Network Address (집주소) 


192.168.10.200
255.255.255.200

11000000.10101000.00001010.11001000
11111111.11111111.11111111.00000000
11000000.10101000.00001010.00000000
192.168.10.128

서브네트워크의 수  = 2의 N승(N : '0' -> '1'로 변경한 갯수) 
각 서브네크워크 당 실제 할당 가능한 IP주소의 수 = 2의 N승 - 2 (N: 남아있는 '0'의 갯수)
11111111.11111111.11111111.11000000 
-> 원래 하나의 집이 4개의 집으로 쪼개진다. 
2의 2승 

서브네팅을 하는 이유: 주소

예제) A 기업에 7개의 부서가 있는데 현재 할당받은 네트워크 대역이
200.100.100.0/24일 때 관리자에 의해서 하나의 대역을 7개의 부서에
할당이 가능하도록 서브네트워크로 분리하고 하나의 서브네트워크 당
최소 30노드가 필요할 때의 서브넷 마스크 값을 구하고
각 대역을 나타내시오. 

*B class 255.255.0.0
*A class 255.0.0.0

 

 

예제) 172.16.0.0/16 네트워크 대역을 할당 받았을 때
최소 7개의 서브네트워크로 분할하고
대역대를 나타내시오 
그리고 서브넷마스크 값은? 

 

172.16.0.0/16
255.255.11110000.00000000
255.255.240.0

172.16.0.0~172.16.15.255
172.16.16.0~172.16.31.255
172.16.32.0~172.16.47.255
172.16.48.0~172.16.63.255
172.16.64.0~172.16.79.255

 

728x90
반응형
COMMENT