[OSPF 설정] Cisco GRE over IPsec (Hub/Spoke)구성 예제
Cisco GRE over IPsec 구성 예제
예: Hub(200.1.1.1) ↔ Remote(210.1.1.1)
GRE 터널 인터페이스 = 내부 가상 링크 (10.10.10.0/30)
그 GRE 트래픽을 IPsec으로 암호화
🔑 동작 요약
두 라우터 간 “200.1.1.1 ↔ 210.1.1.1” 경로 위에서 GRE 터널(10.10.10.0/30)을 만듦.
IPsec crypto map으로 GRE 프로토콜 트래픽(GRE=IP Protocol 47)을 캡처해서 암호화.
OSPF는 GRE 터널(10.10.10.1–10.10.10.2) 위에서 돌기 때문에 **멀티캐스트(224.0.0.5)**도 자연스럽게 전달됨.
🔹 Hub Router 설정
! GRE 터널 인터페이스
interface Tunnel0
ip address 10.10.10.1 255.255.255.252
tunnel source 200.1.1.1
tunnel destination 210.1.1.1
ip ospf network point-to-point
!
! OSPF 활성화
router ospf 100
router-id 1.1.1.1
network 10.10.10.0 0.0.0.3 area 0
!
! ISAKMP Phase 1
crypto isakmp policy 10
encr aes
hash sha
authentication pre-share
group 2
lifetime 3600
!
crypto isakmp key cisco123 address 210.1.1.1
! IPsec Transform set (Phase 2)
crypto ipsec transform-set TS esp-aes esp-sha-hmac
mode transport
!
! GRE 트래픽만 보호
crypto map GRE-MAP 10 ipsec-isakmp
set peer 210.1.1.1
set transform-set TS
match address GRE-TRAFFIC
!
access-list GRE-TRAFFIC permit gre host 200.1.1.1 host 210.1.1.1
interface GigabitEthernet0/0
ip address 200.1.1.1 255.255.255.0
crypto map GRE-MAP
🔹 Remote Router 설정
! GRE 터널 인터페이스
interface Tunnel0
ip address 10.10.10.2 255.255.255.252
tunnel source 210.1.1.1
tunnel destination 200.1.1.1
ip ospf network point-to-point
!
! OSPF 활성화
router ospf 100
router-id 2.2.2.2
network 10.10.10.0 0.0.0.3 area 0
!
! ISAKMP Phase 1
crypto isakmp policy 10
encr aes
hash sha
authentication pre-share
group 2
lifetime 3600
!
crypto isakmp key cisco123 address 200.1.1.1
! IPsec Transform set (Phase 2)
crypto ipsec transform-set TS esp-aes esp-sha-hmac
mode transport
!
! GRE 트래픽만 보호
crypto map GRE-MAP 10 ipsec-isakmp
set peer 200.1.1.1
set transform-set TS
match address GRE-TRAFFIC
!
access-list GRE-TRAFFIC permit gre host 210.1.1.1 host 200.1.1.1
interface GigabitEthernet0/0
ip address 210.1.1.1 255.255.255.0
crypto map GRE-MAP