VPN 이론 및 실습

ehfmlr·2023년 6월 19일
0

Network

목록 보기
1/1

VPN (Virtual Private Network)

-> 인터넷과 같이 여러 사람이 공용으로 사용하는 공중망을 특정인이나 조직이 단독으로 사용하는 사설망처럼 동작 시키는 것

[VPN 종류]

  • IPsec VPN

- VPN 게이트웨이(서버) 2대를 서로 연결함으로써 게이트웨이 사이에 터널링이 맺어지며, 암호화된 데이터를 주고 받는다. 패킷은 암호화 되기 때문에 중간에 공격자가 스니핑을 하더라도 내용을 알 수 없다.
- 운영방식에 따라 전송모드와 터널모드가 있고, 암호화 여부에 따라 ESP, AH 프로토콜을 사용

IPsec VPN 기능

  • Authentication (인증)
    - 망에 접속할 수 있는 자격에 대한 사용자 인증 과정 (PreShare, CA, PSK)
  • Confidentiality (기밀성)
    - 데이터에 대한 암호화 (DES, 3DES, AES, RC4)
  • Data Integrity (무결성)
    - 데이터의 전송 과정에서의 변조 방지 (MD5, SHA-1)

IPsec VPN의 메인 프로토콜

  • IKE: 보안 협상, 인증키 프레임워크 제공
  • AH: 데이터의 인증과 보안에 대한 프레임워크 제공
  • ESP: 데이터의 암호화, 인증, 보안에 대한 프레임워크 제공

IKE Phases

  • Phase 1
    - Authenticate the peers
    - Negotiate a bidirectional SA
    - Main mode or aggressive mode
  • Phase 1.5
    - Xauth : 사용자 인증
    - Mode config
  • Phase 2
    - IPsec SAs/SPIs
    - Quick mode
  • SSL VPN

- VPN 게이트웨이(서버) 1대와 클라이언트를 인터넷 웹브라우저를 통해 연결하는 VPN으로 중앙 서버만 있으면 언제나 어디서나 접속이 가능하기 때문에 출장근무자나 재택근무자들에게 서비스를 제공하기 쉬운 구성

VPN 암호화 기술

  • 비밀키 알고리즘
    - 대칭키(Symmetric)
    - 동일키
    - 속도 빠름, 키 분배와 관리 어려움
    - 종류: DES, 3DES, AES, IDEA, SEED

  • 공개키 알고리즘
    - 비대칭키(Asymmetric)
    - 다른키
    - 속도 느림, 키 사전 공유 불필요
    - 종류: RSA, Diffie-Hellman, Rabin, Elgamal

KEY 관리

  • SKIP : Sun Microsystems
  • Photuris : IBM
  • ISAKMP : CISCO Systems

VPN 실습 Topology

IP 설정

ASA1

ASA1(config)# int g0/0
ASA1(config-if)# nameif outside
ASA1(config-if)# security-level 0
ASA1(config-if)# ip add 172.16.1.1 255.255.255.0
ASA1(config-if)# no shut
ASA1(config-if)# ex

ASA1(config)# int g0/1
ASA1(config-if)# nameif inside
ASA1(config-if)# security-level 100
ASA1(config-if)# ip add 192.168.10.1 255.255.255.0
ASA1(config-if)# no shut
ASA1(config-if)# ex

ASA2

ASA2(config)# int g0/0
ASA2(config-if)# nameif outside
ASA2(config-if)# security-level 0
ASA2(config-if)# ip add 172.16.1.2 255.255.255.0
ASA2(config-if)# no shut
ASA2(config-if)# ex

ASA2(config)# int g0/1
ASA2(config-if)# nameif inside
ASA2(config-if)# security-level 100
ASA2(config-if)# ip add 192.168.20.1 255.255.255.0
ASA2(config-if)# no shut
ASA2(config-if)# ex

Static Route 설정

ASA1

config)# route outside 192.168.20.0 255.255.255.0 172.16.1.2

ASA2

config)#route outside 192.168.10.0 255.255.255.0 172.16.1.1

Tunnel 구성

ASA1

config)# access-list vpn10 extended permit ip 192.168.10.0 255.255.255.0 192.168.20.0 255.255.255.0

config)# tunnel-group 172.16.1.2 type ipsec-l2l
config)# tunnel-group 172.16.1.2 ipsec-attributes
config-tunnel-ipsec)# ikev2 remote-authentication pre-shared-key CISCO
config-tunnel-ipsec)# ikev2 local-authentication pre-shared-key CISCO

config)# crypto ikev2 policy 10
config-ikev2-policy)# encryption aes-256
config-ikev2-policy)# integrity sha256
config-ikev2-policy)# group 14
config-ikev2-policy)# prf sha256
config-ikev2-policy)# lifetime seconds 86400
config)# crypto ikev2 enable outside

config)# crypto ipsec ikev2 ipsec-proposal IPSEC-PRO
config-ipsec-proposal)# protocol esp encryption aes-256
config-ipsec-proposal)# protocol esp integrity 
sha-256

config)# crypto map 10-20 10 match address vpn10 
config)# crypto map 10-20 10 set peer 172.16.1.2
config)# crypto map 10-20 10 set ikev2 ipsec-proposal IPSEC-PRO
config)# crypto map 10-20 10 set pfs
config)# crypto map 10-20 interface outside

ASA2

config)# access-list vpn20 extended permit ip192.168.20.0 255.255.255.0 192.168.10.0 255.255.255.0

config)# tunnel-group 172.16.1.1 type ipsec-l2l
config)# tunnel-group 172.16.1.1 ipsec-attributes
config-tunnel-ipsec)# ikev2 remote-authentication pre-shared-key CISCO
config-tunnel-ipsec)# ikev2 local-authentication pre-shared-key CISCO

config)# crypto ikev2 policy 10
config-ikev2-policy)# encryption aes-256
config-ikev2-policy)# integrity sha256
config-ikev2-policy)# group 14
config-ikev2-policy)# prf sha256
config-ikev2-policy)# lifetime seconds 86400
config)# crypto ikev2 enable outside

config)# crypto ipsec ikev2 ipsec-proposal IPSEC-PRO
config-ipsec-proposal)# protocol esp encryption aes-256
config-ipsec-proposal)# protocol esp integrity 
sha-256

config)# crypto map 20-10 10 match address vpn20 
config)# crypto map 20-10 10 set peer 172.16.1.1
config)# crypto map 20-10 10 set ikev2 ipsec-proposal IPSEC-PRO
config)# crypto map 20-10 10 set pfs
config)# crypto map 20-10 interface outside

ICMP 허용

ASA1, ASA2

config)# policy-map global_policy
config-pmap)# class inspection_default
config-pmap-c)# inspect icmp

확인
#show running-configobject-group
#show running-configaccess-list
#show running-configcrypto ikev2
#show running-configcrypto ipsec
#show run crypto map

0개의 댓글