kh교육

(20250804028)router-redistribute, 암호학

boangod 2025. 8. 4. 17:51

redistribute

OSPF : STATIC, RIP, EIGRP

 

redistribute static subnets

                  rip subnets

                  eigrp # metric # subnets

 

• redistribute static subnet 명령은 default route 설정을 포함하지 않는다.

    # default-information originate 명령이 반드시 필요하다.

• Metric : 다른 라우팅 프로토콜로부터 이전된 경로의 metric 값은 OSPF와 형식이 다르므로 값을 직접 지 정한다.

• Subnets : classless 정보를 전송하기 위해서 사용된다.

 

EIGRP : STATIC, RIP, OSPF

 

redistribute static

                   rip metric K1 K3 K4 K2 K5

                   ospf # metric K1 K3 K4 K2 K5

 

• redistribute static 명령은 default route 설정을 포함한다.

• Metric : default-metric으로 BW De Re Lo MTU를 대신할 수 있다.

- K1 : Bandwidth(대역폭)

- K3 : Delay(지연)

- K4 : Reliability(신뢰도)

- K2 : Load(회선사용량)

- K5 : MTU

 

 

실습

static - ospf

R1

en
conf t
hostname R1
no ip domain-lookup
int g0/0
ip add 1.1.1.1 255.255.255.0
no sh
int se0/0/0
ip add 12.1.1.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 s0/0/0
exit
copy running-config startup-config

 

R2

en
conf t
hostname R2
no ip domain-lookup
int g0/0
ip add 2.2.2.1 255.255.255.0
no sh
int se0/0/0
ip add 23.1.1.2 255.255.255.0
no sh
int se0/0/1
ip add 12.1.1.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 s0/0/0
ip route 1.1.1.0 255.255.255.0 s0/0/1
exit
copy running-config startup-config

 

R3

en
conf t
hostname R3
no ip domain-lookup
int se0/0/0
ip add 34.1.1.3 255.255.255.0
no sh
int se0/0/1
ip add 23.1.1.3 255.255.255.0
no sh
int loopback0
ip add 10.10.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 loopback0
ip route 1.1.1.0 255.255.255.0 s0/0/1
ip route 2.2.2.0 255.255.255.0 s0/0/1
ip route 12.1.1.0 255.255.255.0 s0/0/1
router ospf 1
redistribute static subnets
default-information originate
network 34.1.1.3 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R4

en
conf t
hostname R4
no ip domain-lookup
int g0/0
ip add 4.4.4.1 255.255.255.0
no sh
int se0/0/0
ip add 45.1.1.4 255.255.255.0
no sh
int se0/0/1
ip add 34.1.1.4 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 4.4.4.1 0.0.0.0 area 0
network 34.1.1.4 0.0.0.0 area 0
network 45.1.1.4 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R5

en
conf t
hostname R5
no ip domain-lookup
int g0/0
ip add 5.5.5.1 255.255.255.0
no sh
int se0/0/1
ip add 45.1.1.5 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 5.5.5.1 0.0.0.0 area 0
network 45.1.1.5 0.0.0.0 area0
exit
exit
copy running-config startup-config

 

※ R3에서 default-information originate : OSPF는 default routing 정보전달을 직접 지정해야 한다.

※ R3에서 redistribute static subnets을 입력할때 subnets를 빼면 classful 정보만전송된다.

 

static - ergip

R1

en
conf t
hostname R1
no ip domain-lookup
int g0/0
ip add 1.1.1.1 255.255.255.0
no sh
int se0/0/0
ip add 12.1.1.1 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 s0/0/0
exit
copy running-config startup-config

 

R2

en
conf t
hostname R2
no ip domain-lookup
int g0/0
ip add 2.2.2.1 255.255.255.0
no sh
int se0/0/0
ip add 23.1.1.2 255.255.255.0
no sh
int se0/0/1
ip add 12.1.1.2 255.255.255.0
no sh
exit
ip route 0.0.0.0 0.0.0.0 s0/0/0
ip route 1.1.1.0 255.255.255.0 s0/0/1
exit
copy running-config startup-config

 

R3

en
conf t
hostname R3
no ip domain-lookup
int se0/0/0
ip add 34.1.1.3 255.255.255.0
no sh
int se0/0/1
ip add 23.1.1.3 255.255.255.0
no sh
int loopback0
ip add 10.10.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 loopback0
ip route 1.1.1.0 255.255.255.0 s0/0/1
ip route 2.2.2.0 255.255.255.0 s0/0/1
ip route 12.1.1.0 255.255.255.0 s0/0/1
router eigrp 100
redistribute static
no auto-summary
network 23.1.1.3 0.0.0.0
network 34.1.1.3 0.0.0.0
exit
exit
copy running-config startup-config

 

R4

en
conf t
hostname R4
no ip domain-lookup
int g0/0
ip add 4.4.4.1 255.255.255.0
no sh
int se0/0/0
ip add 45.1.1.4 255.255.255.0
no sh
int se0/0/1
ip add 34.1.1.4 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 4.4.4.1 0.0.0.0
network 34.1.1.4 0.0.0.0
network 45.1.1.4 0.0.0.0
exit
exit
copy running-config startup-config

 

R5

en
conf t
hostname R5
no ip domain-lookup
int g0/0
ip add 5.5.5.1 255.255.255.0
no sh
int se0/0/1
ip add 45.1.1.5 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 5.5.5.1 0.0.0.0
network 45.1.1.5 0.0.0.0
exit
exit
copy running-config startup-config

 

※ EIGRP에 의해서 전송된 Static 정보는 EX 타입으로 외부 라우팅 정보로 확인된다.

 

rip - ospf

R1

en
conf t
hostname R1
no ip domain-lookup
int g0/0
ip add 1.1.1.1 255.255.255.0
no sh
int se0/0/0
ip add 12.1.1.1 255.255.255.0
no sh
exit
router rip
version 2
passive-interface g0/0
no auto-summary
network 1.1.1.0
network 12.1.1.1
exit
exit
copy running-config startup-config

 

R2

en
conf t
hostname R2
no ip domain-lookup
int g0/0
ip add 2.2.2.1 255.255.255.0
no sh
int se0/0/0
ip add 23.1.1.2 255.255.255.0
no sh
int se0/0/1
ip add 12.1.1.2 255.255.255.0
no sh
exit
router rip
version 2 
passive-interface g0/0
no auto-summary
exit
exit
copy running-config startup-config

 

R3

en
conf t
hostname R3
no ip domain-lookup
int se0/0/0
ip add 34.1.1.3 255.255.255.0
no sh
int se0/0/1
ip add 23.1.1.3 255.255.255.0
no sh
int loopback0
ip add 10.10.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 loopback0
router rip
version 2
no auto-summary
network 23.1.1.0
redistribute ospf 1 metric 5
default-information originate
router ospf 1
redistribute rip subnets
default-information originate
network 34.1.1.3 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R4

en
conf t
hostname R4
no ip domain-lookup
int g0/0
ip add 4.4.4.1 255.255.255.0
no sh
int se0/0/0
ip add 45.1.1.4 255.255.255.0
no sh
int se0/0/1
ip add 34.1.1.4 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 4.4.4.1 0.0.0.0 area 0
network 34.1.1.4 0.0.0.0 area 0
network 45.1.1.4 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R5

en
conf t
hostname R5
no ip domain-lookup
int g0/0
ip add 5.5.5.1 255.255.255.0
no sh
int se0/0/1
ip add 45.1.1.5 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 5.5.5.1 0.0.0.0 area 0
network 45.1.1.5 0.0.0.0 area0
exit
exit
copy running-config startup-config

 

rip -ergip

R1

en
conf t
hostname R1
no ip domain-lookup
int g0/0
ip add 1.1.1.1 255.255.255.0
no sh
int se0/0/0
ip add 12.1.1.1 255.255.255.0
no sh
exit
router rip
version 2
passive-interface g0/0
no auto-summary
network 1.1.1.0
network 12.1.1.1
exit
exit
copy running-config startup-config

 

R2

en
conf t
hostname R2
no ip domain-lookup
int g0/0
ip add 2.2.2.1 255.255.255.0
no sh
int se0/0/0
ip add 23.1.1.2 255.255.255.0
no sh
int se0/0/1
ip add 12.1.1.2 255.255.255.0
no sh
exit
router rip
version 2 
passive-interface g0/0
no auto-summary
exit
exit
copy running-config startup-config

 

R3

en
conf t
hostname R3
no ip domain-lookup
int se0/0/0
ip add 34.1.1.3 255.255.255.0
no sh
int se0/0/1
ip add 23.1.1.3 255.255.255.0
no sh
int loopback0
ip add 10.10.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 loopback0
router rip
version 2
no auto-summary
network 23.1.1.0
redistribute eigrp 100 metric 5
default-information originate
exit
router eigrp 100
redistribute static
redistribute rip metric 10000 10 255 1 1500
no auto-summary
network 23.1.1.3 0.0.0.0
network 34.1.1.3 0.0.0.0
exit
exit
copy running-config startup-config

 

R4

en
conf t
hostname R4
no ip domain-lookup
int g0/0
ip add 4.4.4.1 255.255.255.0
no sh
int se0/0/0
ip add 45.1.1.4 255.255.255.0
no sh
int se0/0/1
ip add 34.1.1.4 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 4.4.4.1 0.0.0.0
network 34.1.1.4 0.0.0.0
network 45.1.1.4 0.0.0.0
exit
exit
copy running-config startup-config

 

R5

en
conf t
hostname R5
no ip domain-lookup
int g0/0
ip add 5.5.5.1 255.255.255.0
no sh
int se0/0/1
ip add 45.1.1.5 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 5.5.5.1 0.0.0.0
network 45.1.1.5 0.0.0.0
exit
exit
copy running-config startup-config

 

ospf - ergip

R1

en
conf t
hostname R1
no ip domain-lookup
int g0/0
ip add 1.1.1.1 255.255.255.0
no sh
int se0/0/0
ip add 12.1.1.1 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 1.1.1.1 0.0.0.0 area 0
network 12.1.1.1 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R2

en
conf t
hostname R2
no ip domain-lookup
int g0/0
ip add 2.2.2.1 255.255.255.0
no sh
int se0/0/0
ip add 23.1.1.2 255.255.255.0
no sh
int se0/0/1
ip add 12.1.1.2 255.255.255.0
no sh
exit
router ospf 1
passive-interface g0/0
network 2.2.2.1 0.0.0.0 area 0
network 12.1.1.2 0.0.0.0 area 0
network 23.1.1.2 0.0.0.0 area 0
exit
exit
copy running-config startup-config

 

R3

en
conf t
hostname R3
no ip domain-lookup
int se0/0/0
ip add 34.1.1.3 255.255.255.0
no sh
int se0/0/1
ip add 23.1.1.3 255.255.255.0
no sh
int loopback0
ip add 10.10.10.1 255.255.255.0
exit
ip route 0.0.0.0 0.0.0.0 loopback0
router ospf 1
network 23.1.1.3 0.0.0.0 area 0
default-information originate
redistribute eigrp 100 metric 10 subnets
exit
router eigrp 100
redistribute static
redistribute ospf 1 metric 10000 1000 255 1 1500
no auto-summary
network 23.1.1.3 0.0.0.0
network 34.1.1.3 0.0.0.0
exit
exit
copy running-config startup-config

 

R4

en
conf t
hostname R4
no ip domain-lookup
int g0/0
ip add 4.4.4.1 255.255.255.0
no sh
int se0/0/0
ip add 45.1.1.4 255.255.255.0
no sh
int se0/0/1
ip add 34.1.1.4 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 4.4.4.1 0.0.0.0
network 34.1.1.4 0.0.0.0
network 45.1.1.4 0.0.0.0
exit
exit
copy running-config startup-config

 

R5

en
conf t
hostname R5
no ip domain-lookup
int g0/0
ip add 5.5.5.1 255.255.255.0
no sh
int se0/0/1
ip add 45.1.1.5 255.255.255.0
no sh
exit
router eigrp 100
passive-interface g0/0
no auto-summary
network 5.5.5.1 0.0.0.0
network 45.1.1.5 0.0.0.0
exit
exit
copy running-config startup-config

 

 


암호학

 

DES의 작동 모드-3중DES

 

DES의 brute-force공격에 대한 취약성을 보완

• 새로운 알고리즘 개발 : IDEA (128 bit 키 사용)

• DES의 응용 : 3중 DES, 2중 DES

 

3중 DES - 생각보다 많이 사용됨

• 2개의 키를 사용

• 암호화 : 암호화, 복호화, 암호화(앞에서부터 순서대로)

• 복호화 : 복호화, 암호화, 복호화 (앞에서부터 순서대로)

• brute-force 공격에 DES보다 강함

 

 

 

추가된 암호 알고리즘

 

AES (Advanced Encryption Standard)

• DES를 대체하기 위한 표준암호 알고리즘

• 리인 델(Rijndael), 투피쉬(Twofish), 서펀트(Serpent), MARS 등이 2차 선정 (2000)

• 2000년 10월 2일 리인델이 AES로 선정

 

Rijndael

• 128, 192, 256 비트의 다양한 길이의 키를 사용(키 길이를 마음대로 사용가능)

• 알려진 모든 공격에 대응 가능

• 스마트카드상의 컴팩트한 보조 프로세서 등(핸드폰에서도 사용 가능)에 이용 가능

 

IDEA (International Data Encryption Algorithm) - 유럽에서 사용

• 국제 데이터 암호 알고리즘

• 64비트 평문 블록에서 128비트 키를 이용 작동

• 8라운드로 작동

• PGP (Pretty Good Privacy)의 메일 시스템에 이용

  ‐ 필 짐머맴이 개발.. (덕분에 미국에서 실형 살고 유럽으로 이주(?))

 

RC5

• 32,64,128비트 블록 사이즈를 이용

• 0에서 255까지 다양한 라운드 사용

• 0에서 2048비트까지의 키를 이용

 

SEED

• 한국 정보보호 센터에서 1999년 2월 개발

• 128비트 평문 블록에서 128비트 키를 이용 작동

• 16라운드로 작동

• G 함수가 사용된다.

 

 

인증서를 빼고 나머지 안전하게 믿을만한 것은 pgp밖에 없다.

 

위에 있는 암호 알고리즘은 수학적 결함이 없는 것들이다(안전함)

 

사람은 어떤 시스템에서도 안전하다고 안 믿는다.

ㄴ 물리적인 보안이 안되어있기 때문(언제 죽을지 몰라서..)

 

 

공개키 알고리즘

- 두 개의 다른 키 사용

 

- 공개키 : 모든 사람이 접근 가능한 키 (공개)

- 개인키 : 각 사용자 자신만이 소유 (비밀)

 

관용 암호에 사용되는 키는 비밀키라고 함

 

 

공개키 알고리즘의 특징

• 암호 알고리즘과 암호키를 알아도 복호키 계산 불가능

• 두 개의 키 중 하나는 암호에 다른 하나는 복호에 사용

 

 

공개키 암호 시스템

 

  1. 공개키와 개인키 생성(공개키는 개인키랑 쌍으로 이루어진다.)
  2. 공개키는 공개하고 개인키는 개인이 소유
  3. A는 B의 공개키로 메시지를 암호화
  4. B는 자신의 개인키로 메시지 복호화 사용자 B (B의 개인키를 모르는 제 3자는 메시지 복호 불가능)

 

 

공개키 암호의 기밀성

암호문을 함부로 아무나 조작할 수 없게 하는 것, 아무나 볼 수 없음.

- A가 B의 공개키로 암호화한 메시지는 B의 개인키로밖에 복호화할 수 없습니다.

 

 

공개키를 이용한 인증

개인키로 만든 문서는 서명문이라고 한다. 평문자체를 암호화하지 않는다.

그 사람의 공개키로 풀리는 문서는 그 사람만 만들 수 있다.

- A의 개인키로 암호화를 한다면 복호화할 수 있는 방법은 A의 공개키밖에 없기 때문에 개인키 소유자가 생성을 했다는 증거입니다.

예) 전자서명

 

 

공개키를 이용한 기밀통신과 서명

네트워크 채널 자체를 암호화하는 데는 사용 불가, 속도가 느림.

- A가 B의 공개키로 메시지를 암호화하면 안의 내용은 B만 복호화할 수 있기 때문에 기밀성이 보장됩니다.(보충 필요)

 

 

 

공개키 암호 시스템의 사용

  • 암호/복호 (수신자의 공개키로 메시지 암호)
  • 디지털 서명 (송신자의 개인키로 메시지 서명)
  • 키 교환 (세션키를 교환하기 위해 사용)

공개키 암호는 수학적인 난제를 이용 암호화를 수행한다.

 

소인수 분해의 어려움

• RSA

 

이산대수문제

• 엘가말(El Gamal)

• 디퍼헬만(Diffie-Hellman)

• 타원 곡선 (Elliptic Curve)

 


암호알고리즘 : mod 7에서 곱셈
• 공개키 : 3, 개인키 : 5
• 원문 : 4

 

암호화  : 4 * (3 mod 7) = 5 (암호문)

복호화  : 5 * (5 mod 7) = 4 (원문)

 

mod 7에서 3,5는 서로 역원 (mod에서는 정수 내에 곱셈에 대한 역원이 존재한 다.)