레이블이 VPN인 게시물을 표시합니다. 모든 게시물 표시
레이블이 VPN인 게시물을 표시합니다. 모든 게시물 표시

2014년 1월 21일 화요일

GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 7. Tunnel 보안 / IPSec VPN


GRE Tunnel만 사용할 경우, 네트워크간 연결 자체에는 문제가 없으나 Tunneling을 위해서 Encapsulation되었을 뿐인 원본데이타 그대로가 외부 경로(이 경우에는 BGP로 연결된 구간이 해당된다.)를 지나가게 된다. 이는 중간단계에서 얼마든지 내용을 확인할 수 있고, 이를 변조시킬 수도 있다. 즉, Encapsulation만 되어 있어서 그 내용에 대한 보안에 문제가 있을 뿐더러, 그렇게 받은 내용을 신뢰할 수도 없다. VPN이 필요한 이유는 이러한 신뢰성과 보안성을 위해서이다.

IPSec VPN (여기서는 GRE Tunnel 동반)은 VPN(Virtual Private Networks : 가상 사설 네트워크)의 한 종류로, IP기반의 3계층 보안형식이다.

여기서는 GRE Tunnel과 함께 사용한다. 볼드 처리한 부분은 변수/옵션/이름지정을 해야하는 부분들이다.

1. 먼저 ISAKMP정책을 설정한다.

A00A(config)# crypto isakmp policy 10  / 정책이 여러개면 숫자가 낮을 수록 우선시됨.
A00A(config-isakmp)# encryption aes  / 암호화 방식을 설정
A00A(config-isakmp)# authentication pre-share / 인증은 사전에 설정한 키로 함.
A00A(config-isakmp)# hash sha  
A00A(config-isakmp)# group 5  Diffie Hellman groups 중 몇번을 사용할지 설정.
A00A(config-isakmp)# exit

encryption에서 사용 가능한 옵션은 아래의 세가지중 하나.
  3des  Three key triple DES
  aes   AES - Advanced Encryption Standard.
  des   DES - Data Encryption Standard (56 bit keys).

자세한 내용은 대칭키 암호화 - AES/DES/3DES 를 참조. 가장 최근것이 AES다.

authentication 항목에서 사용가능한 옵션을 다음과 같다.
  pre-share  Pre-Shared Key
  rsa-encr   Rivest-Shamir-Adleman Encryption
  rsa-sig    Rivest-Shamir-Adleman Signature

아래의 두 항목 관련 자료는 RSA (Rivest-Shamir-Adleman)를 참조.

lifetime 항목은 기본값으로 진행하였기에 별도로 설정하지 않았다.
(짧게 설정하면 보안에 좋지만... router 부하가 커진다.=GNS기동중인 컴퓨터 부하가 크다.)

2. 각 대상(여기서는 해당 Peer IP)에 대한 key값(Pre-Shared Key : PSK)을 입력하고

A00A(config)# crypto isakmp key 6 pword address 204.172.100.161
A00A(config)# crypto isakmp key 6 pword address 206.172.100.161

연결상태 유지 확인용 DPD(Dead Peer Detection) 설정.

A00A(config)# crypto isakmp keepalive 30

3. IPsec으로 보호할 대상 트래픽 지정.
ACL에서 GRE 대신 IP로 변경해도 됨.

A00A(config)# ip access-list extended vpn12  / Tunnel 12와 연동할 ACL이라 12
A00A(config-ext-nacl)# permit gre host 203.172.100.129 host 204.172.100.161
A00A(config-ext-nacl)# exit

A00A(config)# ip access-list extended vpn13   / Tunnel 13과 연동할 ACL이라 13
A00A(config-ext-nacl)# permit gre host 203.172.100.129 host 206.172.100.161
A00A(config-ext-nacl)# exit

4. IPsec SA를 지정한다. (여기서는 ts10번으로)

A00A(config)# crypto ipsec transform-set ts10 esp-aes esp-md5-hmac
A00A(cfg-crypto-trans)# exit

뒤의 보라색과 파란색 부분에  지정 가능한 옵션은 아래와 같다.

  ah-md5-hmac   AH-HMAC-MD5 transform
  ah-sha-hmac   AH-HMAC-SHA transform
  comp-lzs      IP Compression using the LZS compression algorithm
  esp-3des      ESP transform using 3DES(EDE) cipher (168 bits)
  esp-aes       ESP transform using AES cipher
  esp-des       ESP transform using DES cipher (56 bits)
  esp-md5-hmac  ESP transform using HMAC-MD5 auth
  esp-null      ESP transform w/o cipher
  esp-seal      ESP transform using SEAL cipher (160 bits)
  esp-sha-hmac  ESP transform using HMAC-SHA auth

6. Cryto Map을 설정한다.

먼저 Cryto Map의 Peer 지정을 Loopback Interface로 하기 때문에 이를 선언.

A00A(config)# crypto map GREVPN local-address loopback 0

그리고 Cryto Map의 새부설정을 지정.

A00A(config)# crypto map GREVPN 10 ipsec-isakmp
A00A(config-crypto-map)# match address vpn12 
A00A(config-crypto-map)# set peer 204.172.100.161  / Tunnel 12의 Dst
A00A(config-crypto-map)# set transform-set ts10  / 연결할 IPsec SA를 지정
A00A(config-crypto-map)# exit

A00A(config)# crypto map GREVPN 20 ipsec-isakmp
A00A(config-crypto-map)# match address vpn13
A00A(config-crypto-map)# set peer 206.172.100.161  / Tunnel 13의 Dst
A00A(config-crypto-map)# set transform-set ts10
A00A(config-crypto-map)# exit

6. Cryto Map을 해당 인터페이스에 지정.

A00A(config)# int s1/0  / 외부에서 직접 오는 경로
A00A(config-if)# crypto map GREVPN

A00A(config)# int f2/0  / 네트워크 구조상 우회할 수 있는 경로
A00A(config-if)# crypto map GREVPN


작업을 마치고 상태 확인은 아래의 명령어로 진행하면 된다.

clear ip access-list counters   / ACL 기록 초기화
show ip access-list  / ACL 적용 내역 조회 (초기화 후 좀 기다렸다 하는게 좋음.)

clear crypto session  / VPN 세션 초기화
show crypto isakmp sa  / 현재 VPN 관련 SA(Security Association) 정보


show crypto ipsec sa  / IPsec SA상태 조회


show crypto session detail  / 세션의 암호화/복호화 내역






관련 링크

설정방법(단, 실제 설정 자체는 이 내용보다는 피터전의 책을 더 참고하였다.)
Configuring VPNs Using an IPSec Tunnel and Generic Routing Encapsulation


관련 이론이나 자료, 정보
rfc 2408 isakmp

실제 진행하다 문제생긴 경우 참고할 곳.
IPsec Troubleshooting: Understanding and Using debug Commands
Proposal with ESP is missing cipher



실제 설정에서 각 라우터별 공통 부분은 아래와 같다.

conf t
crypto isakmp policy 10
encryption aes
authentication pre-share
hash sha
group 5
exit

각 라우터별 변동되는 부분은 아래와 같다.

#A00A
crypto isakmp key 6 pword address 204.172.100.161
crypto isakmp key 6 pword address 206.172.100.161

crypto isakmp keepalive 30

ip access-list extended vpn12
permit gre host 203.172.100.129 host 204.172.100.161
exit

ip access-list extended vpn13
permit gre host 203.172.100.129 host 206.172.100.161
exit

crypto ipsec transform-set ts10 esp-aes esp-md5-hmac
exit

crypto map GREVPN local-address loopback 0

crypto map GREVPN 10 ipsec-isakmp
match address vpn12
set peer 204.172.100.161
set transform-set ts10
exit

crypto map GREVPN 20 ipsec-isakmp
match address vpn13
set peer 206.172.100.161
set transform-set ts10
exit

int s1/0
crypto map GREVPN
exit

int f2/0
crypto map GREVPN
exit


#A00B
crypto isakmp key 6 pword address 204.172.100.161
crypto isakmp key 6 pword address 206.172.100.161

crypto isakmp keepalive 30

ip access-list extended vpn22
permit gre host 205.172.100.129 host 204.172.100.161
exit

ip access-list extended vpn23
permit gre host 205.172.100.129 host 206.172.100.161
exit

crypto ipsec transform-set ts10 esp-aes esp-md5-hmac
exit

crypto map GREVPN local-address loopback 0

crypto map GREVPN 10 ipsec-isakmp
match address vpn22
set peer 204.172.100.161
set transform-set ts10

crypto map GREVPN 20 ipsec-isakmp
match address vpn23
set peer 206.172.100.161
set transform-set ts10

int s1/0
crypto map GREVPN
int f2/0
crypto map GREVPN


#A10A
crypto isakmp key 6 pword address 203.172.100.129
crypto isakmp key 6 pword address 205.172.100.129

crypto isakmp keepalive 30

ip access-list extended vpn12
permit gre host 204.172.100.161 host 203.172.100.129
exit

ip access-list extended vpn22
permit gre host 204.172.100.161 host 205.172.100.129
exit

crypto ipsec transform-set ts20 esp-aes esp-md5-hmac
exit

crypto map GREVPN local-address loopback 0

crypto map GREVPN 10 ipsec-isakmp
match address vpn12
set peer 203.172.100.129
set transform-set ts20

crypto map GREVPN 20 ipsec-isakmp
match address vpn22
set peer 205.172.100.129
set transform-set ts20

int s1/1
crypto map GREVPN



#A20A
crypto isakmp key 6 pword address 203.172.100.129
crypto isakmp key 6 pword address 205.172.100.129

crypto isakmp keepalive 30

ip access-list extended vpn13
permit gre host 206.172.100.161 host 203.172.100.129
exit

ip access-list extended vpn23
permit gre host 206.172.100.161 host 205.172.100.129
exit

crypto ipsec transform-set ts30 esp-aes esp-md5-hmac
exit

crypto map GREVPN local-address loopback 0

crypto map GREVPN 10 ipsec-isakmp
match address vpn13
set peer 203.172.100.129
set transform-set ts30

crypto map GREVPN 20 ipsec-isakmp
match address vpn23
set peer 205.172.100.129
set transform-set ts30

int s1/1
crypto map GREVPN

2013년 12월 24일 화요일

GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 5. 연결된 Tunnel을 통해 Area 연결 시도

지금까지의 내용을 그대로 따라한 경우, 아래와 같이 된다.

1. 3개의 OSPF Area 각각의 OSPF 경로가 형성된다.
2. 주요 4개의 라우터(A00A/A00B/A10A/A20A)간 루프백 인터페이스를 기준으로 한 eBGP경로가 생성됨.
3. 주요 4개의 라우터(A00A/A00B/A10A/A20A)간 eBGP 경로를 기반으로 터널링 연결을 통한 논리적 직접연결이 형성된다.
4. 4개의 ISP는 eBGP로 선언한 네트워크가 없어 주요 4개 라우터에 관련 경로가 남지 않음.


OSPF 단일 Area의 경우는 상관없으나, 여러 Area를 포함하는 경우, 반드시 모든 Area는 Area 0에 연결되어야만 한다. 앞에서 설정한 Tunnel 인터페이스는 이를 위해서 논리적으로 연결을 형성하기 위해 사용된 것이다.

그럼 이제 이를 이용해서 연결을 시도해 보자. (편의상 A00A와 A10A연결로 진행)

먼저 eBGP와 Tunnel 인터페이스가 정상적으로 활성화 되었는지 show ip route 명령으로 확인한다.

먼저 A00A는 아래와 같다.
아래와 같이 A10A의 루프백 인터페이스 및 Tunnel 12 인터페이스 연결이 확인된다.


그리고 A10A는 아래와 같다.
아래와 같이 A00A의 루프백 인터페이스 및 Tunnel 12 인터페이스 연결이 확인된다.



이제 여기에 Area 연결을 위해 Tunnel 12 인터페이스를 OSPF에 선언한다.

router ospf 5730
 network 192.168.111.64 0.0.0.3 area 10

그러면 아래와 같이 터널의 연결이 끊겼다가 다시 복구되는게 반복된다.




일반적으로 터널링 연결상태에서 연결이 끊기는 경우는 아래와 같다.


- There is no route to the tunnel destination address.
터널의 목적지(destination)로 연결되는 경로를 알 수 없는 경우.
* 이를 방지하기 위해서 Tunnel 인터페이스와 무관하게 라우팅 태이블에 올라오도록 설정한다. 여기서는 eBGP를 사용.

- The interface that anchors the tunnel source is down.
터널의 출발지(source) 인터페이스가 다운된 경우.
* 여기서는 이를 방지하기 위해서 Loopback 인터페이스를 사용했다.

- The route to the tunnel destination address is through the tunnel itself.
터널의 목적지(destination)로 향하는 경로가 터널 자신이 될 경우.


여기서는 세번째가 원인. OSPF에 선언된 네트워크중 주요 라우터의 루프백 인터페이스가 포함되어 있기 때문이다. 해결방법은 크게 두가지 방법이 있다.


1. Tunnel을 통해 연결하는 Routing Protocol에 해당 Tunnel의 Destination/Source에 해당하는 Network를 포함시키지 않는다.

2. Tunnel을 통해 연결하는 Routing Protocol에서 해당 Tunnel의 Destination/Source에 해당하는 Network를 광고하지 않는다.


지금과 같은 경우, iBGP로 연결된 구간이 있기 때문에 1번은 불가. 때문에 2번을 선택해서 아래와 같이 진행한다.


A00A

Router(config)# access-list 11 deny 204.172.100.160 0.0.0.3   - Tunnel 12 destination 관련
Router(config)# access-list 11 permit any
Router(config)# router ospf 5730
Router(config-router)# distribute-list 11 in


A10A

Router(config)# access-list 10 deny 203.172.100.128 0.0.0.3   - Tunnel 12 destination 관련
Router(config)# access-list 10 permit any
Router(config)# router ospf 5730
Router(config-router)# distribute-list 10 in


위 내용의 의미는 ACL을 통해서 광고 대상을 설정한 뒤(여기서는 Tunnel 12 destination에 대한 network), distribute-list 명령으로 OSPF 네이버간 받아들이는(distribute-list [acl] in) 광고를 제한한것. 외부로 보내는 광고를 제한(distribute-list [acl] out)하지 않는 이유는 iBGP기반이 되는 영역과 중복되고, 다른 장비에는 경로에 대한 광고를 보내야 하기 때문.

최종적으로 이 환경에서 OSPF Area 연결에 대한 명령은 아래와 같이 된다.


A00A

access-list 11 deny 204.172.100.160 0.0.0.3
access-list 11 deny 206.172.100.160 0.0.0.3
access-list 11 permit any

router ospf 5730
network 192.168.111.64 0.0.0.3 area 10
network 192.168.121.64 0.0.0.3 area 20
distribute-list 11 in


A00B

access-list 11 deny 204.172.100.160 0.0.0.3
access-list 11 deny 206.172.100.160 0.0.0.3
access-list 11 permit any

router ospf 5730
network 192.168.111.68 0.0.0.3 area 10
network 192.168.121.68 0.0.0.3 area 20
distribute-list 11 in


A10A

access-list 10 deny 203.172.100.128 0.0.0.3
access-list 10 deny 205.172.100.128 0.0.0.3
access-list 10 permit any

router ospf 5730
network 192.168.111.64 0.0.0.3 area 10
network 192.168.111.68 0.0.0.3 area 10
distribute-list 10 in


A20A

access-list 10 deny 203.172.100.128 0.0.0.3
access-list 10 deny 205.172.100.128 0.0.0.3
access-list 10 permit any

router ospf 5730
network 192.168.121.64 0.0.0.3 area 20
network 192.168.121.68 0.0.0.3 area 20
distribute-list 10 in


P.S : distribute-list에 사용되는 ACL은 반드시 Standard ACL만 사용 가능하다. 조금 다른 경우로, X.X.X.0/24는 차단하고 X.X.X.0/25는 받도록 하고싶은 경우라면 ACL이 아닌 Prefix-List를 사용해야 한다.

P.S : 사실 이 현상 자체는 좀 더 간단한 방법으로 해결 가능하다.


관련 링크

GRE Tunnel Keepalives
OSPF Inbound Filtering Using Route Maps with a Distribute List

2013년 12월 20일 금요일

GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 4. 터널링 설정

Tunnel 연결.

특정 네트워크끼리 논리적인 연결을 구성함으로서 마치 직접 연결된 인터페이스로 인식 시키는 기술. 여기서는 총 4개의 터널 연결을 구성한다.

tunnel 12 : A00A Lo 0 - A10A Lo 0
tunnel 22 : A00B Lo 0 - A10A Lo 0
tunnel 13 : A00A Lo 0 - A20A Lo 0
tunnel 23 : A00B Lo 0 - A20A Lo 0




A00A 

interface Tunnel12
 ip address 192.168.111.65 255.255.255.252
 tunnel source 203.172.100.129
 tunnel destination 204.172.100.161

interface Tunnel13
 ip address 192.168.121.65 255.255.255.252
 tunnel source 203.172.100.129
 tunnel destination 206.172.100.161



A00B

interface Tunnel22
 ip address 192.168.111.69 255.255.255.252
 tunnel source 205.172.100.129
 tunnel destination 204.172.100.161

interface Tunnel23
 ip address 192.168.121.69 255.255.255.252
 tunnel source 205.172.100.129
 tunnel destination 206.172.100.161



A10A 

interface Tunnel12
 ip address 192.168.111.66 255.255.255.252
 tunnel source 204.172.100.161
 tunnel destination 203.172.100.129

interface Tunnel22
 ip address 192.168.111.70 255.255.255.252
 tunnel source 204.172.100.161
 tunnel destination 205.172.100.129



A20A

interface Tunnel13
 ip address 192.168.121.66 255.255.255.252
 tunnel source 206.172.100.161
 tunnel destination 203.172.100.129

interface Tunnel23
 ip address 192.168.121.70 255.255.255.252
 tunnel source 206.172.100.161
 tunnel destination 205.172.100.129


정상적으로 터널링 연결이 되었다면, 기존에 BGP를 통해 Lo 0로 핑을 보낸것과 달리 터널로 직접 핑을 보낼 수 있다. 핑 테스트를 꼭 해보자. 



GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 3. 각 라우터간 연결(BGP)


1. ISP 연결관련 설정.

ISP부분은 OSPF가 아니면서 각 Area를 연결하기 위한 환경을 구성하는게 목적이고, 그러한 목적을 위해서 각각 모두 분리된 AS로 eBGP를 구성함. ISP들 자체의 네트워크 선언은 하지 않고 OSPF 각 Area에서 선언된 네트워크 전달만 함. 각각의 AS는 아래와 같음.

ISP_A : BGP 10
ISP_B : BGP 20
ISP_C : BGP 30
ISP_D : BGP 40



ISP_A 

interface Loopback0
 ip address 203.172.100.65 255.255.255.252

interface FastEthernet0/0
 ip address 100.100.10.5 255.255.255.252

interface FastEthernet0/1
 ip address 100.100.11.5 255.255.255.252

interface Serial1/0
 ip address 10.10.10.5 255.255.255.252

router bgp 10
 no synchronization (사용 IOS파일에선 기본값. 이후 언급 생략)
 bgp router-id 203.172.100.65
 bgp log-neighbor-changes (사용 IOS파일에선 기본값. 역시 이후 언급 생략)
 neighbor 10.10.10.6 remote-as 11 (A00A와 eBGP연결)
 neighbor 100.100.10.6 remote-as 20 (ISP_B와 eBGP연결)
 neighbor 100.100.11.6 remote-as 30 (ISP_C와 eBGP연결)


ISP_B

interface Loopback0
 ip address 204.172.100.65 255.255.255.252

interface FastEthernet0/0
 ip address 100.100.10.6 255.255.255.252

interface FastEthernet0/1
 ip address 110.110.10.5 255.255.255.252

interface Serial1/1
 ip address 11.11.11.13 255.255.255.252

router bgp 20
 no synchronization
 bgp router-id 204.172.100.65
 bgp log-neighbor-changes
 neighbor 11.11.11.14 remote-as 12 (A10A와 eBGP연결)
 neighbor 100.100.10.5 remote-as 10 (ISP_A와 eBGP연결)
 neighbor 110.110.10.6 remote-as 40 (ISP_D와 eBGP연결)


ISP_C

interface Loopback0
 ip address 205.172.100.65 255.255.255.252

interface FastEthernet0/0
 ip address 120.120.10.5 255.255.255.252

interface FastEthernet0/1
 ip address 100.100.11.6 255.255.255.252

interface Serial1/0
 ip address 12.12.12.5 255.255.255.252

router bgp 30
 no synchronization
 bgp router-id 205.172.100.65
 bgp log-neighbor-changes
 neighbor 12.12.12.6 remote-as 11 (A10B와 eBGP연결)
 neighbor 100.100.10.5 remote-as 10 (ISP_A와 eBGP연결)
 neighbor 120.120.10.6 remote-as 40 (ISP_D와 eBGP연결)


ISP_D

interface Loopback0
 ip address 206.172.100.65 255.255.255.252

interface FastEthernet0/0
 ip address 120.120.10.6 255.255.255.252

interface FastEthernet0/1
 ip address 110.110.10.6 255.255.255.252

interface Serial1/1
 ip address 13.13.13.13 255.255.255.252

router bgp 40
 no synchronization
 bgp router-id 206.172.100.65
 bgp log-neighbor-changes
 neighbor 13.13.13.14 remote-as 13 (A20A와 eBGP연결)
 neighbor 110.110.10.5 remote-as 20 (ISP_B와 eBGP연결)
 neighbor 120.120.10.5 remote-as 30 (ISP_C와 eBGP연결)



2. 각 OSPF Area별 설정.

각 OSPF Area 별로 지정된 BGP AS값은 아래와 같다.

Area 0 : 11
Area 10 : 12
Area 20 : 13

OSPF Area 0은 외부 연결이 이중화 구조라 A00A와 A00B는 iBGP구성(IGP는 OSPF 그대로 사용). 그외의 BGP연결은 모두 eBGP연결.


2-1. Area 0

A00A

router bgp 11
 bgp router-id 203.172.100.129
 neighbor 10.10.10.5 remote-as 10
 neighbor 205.172.100.129 remote-as 11
 neighbor 205.172.100.129 update-source Loopback0
 network 203.172.100.128 mask 255.255.255.240


A00B

router bgp 11
 bgp router-id 205.172.100.129
 neighbor 12.12.12.5 remote-as 30
 neighbor 203.172.100.129 remote-as 11
 neighbor 203.172.100.129 update-source Loopback0
 network 205.172.100.128 mask 255.255.255.240


2-2. Area 10

A10A

router bgp 12
 bgp router-id 204.172.100.161
 network 204.172.100.160 mask 255.255.255.240
 neighbor 11.11.11.13 remote-as 20


2-3. Area 20

A20A

router bgp 13
 bgp router-id 206.172.100.161
 network 206.172.100.160 mask 255.255.255.240
 neighbor 13.13.13.13 remote-as 40



P.S : 혹시라도 이 내용대로 직접 해보시는 분이 있을지 몰라 첨언.
지금처럼 네트워크 선언을 루프백만 한 경우, ping 명령어를 평소처럼 Destination IP만 입력하면 정상적인 핑이 돌아오지 않는다. 아래와 같이 할 필요가 있다.

ping [Destination IP] source [Source 'IP or Interface']

여기서 말하는 Source IP or Interface는 BGP를 통해 선언되서 상대쪽에서도 이미 알고 있는 네트워크를 말한다. (상대가 모르는 네트워크면 응답을 할 수가 없으니까.)

2013년 12월 19일 목요일

GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 2. 주요 인터페이스 IP설정 및 각 Area별 OSPF설정

각 장비별 주요 인터페이스 및 기본적인 OSPF 설정값.
(각 영역별 Core부분만. Access Layer부분은 생략. Distribute Layer는 GNS 한계상 제외)




A00A

interface Loopback0 - BGP 광고용 대표 IP 배정
 ip address 203.172.100.129 255.255.255.240

interface FastEthernet0/0 - A00C와 연결
 ip address 192.168.101.129 255.255.255.252

interface FastEthernet0/1 - A00D와 연결
 ip address 192.168.101.133 255.255.255.252

interface Serial1/0 - ISP_A와 연결
 ip address 10.10.10.6 255.255.255.252

interface FastEthernet2/0 - A00B와 연결
 ip address 192.168.101.137 255.255.255.252

router ospf 5730
 router-id 203.172.100.129
 passive-interface Serial1/0
 network 10.10.10.4 0.0.0.3 area 0
 network 192.168.101.128 0.0.0.3 area 0
 network 192.168.101.132 0.0.0.3 area 0
 network 192.168.101.136 0.0.0.3 area 0
 network 203.172.100.128 0.0.0.15 area 0

A00B

interface Loopback0 - BGP 광고용.
 ip address 205.172.100.129 255.255.255.240

interface FastEthernet0/0 - A00D와 연결
 ip address 192.168.101.145 255.255.255.252

interface FastEthernet0/1 - A00C와 연결
 ip address 192.168.101.149 255.255.255.252

interface Serial1/0 - ISP C와 연결
 ip address 12.12.12.6 255.255.255.252

interface FastEthernet2/0 -A00A와 연결
 ip address 192.168.101.138 255.255.255.252

router ospf 5730
 router-id 205.172.100.129
 passive-interface Serial1/0
 network 12.12.12.4 0.0.0.3 area 0
 network 192.168.101.136 0.0.0.3 area 0
 network 192.168.101.144 0.0.0.3 area 0
 network 192.168.101.148 0.0.0.3 area 0
 network 205.172.100.128 0.0.0.15 area 0


A10A

interface Loopback0 - BGP 광고용
 ip address 204.172.100.161 255.255.255.240

interface FastEthernet0/0 - A10B와 연결
 ip address 192.168.111.129 255.255.255.252

interface Serial1/1 - ISP B와 연결
 ip address 11.11.11.14 255.255.255.252

router ospf 5730
 router-id 204.172.100.161
 passive-interface Serial1/1
 network 11.11.11.12 0.0.0.3 area 10
 network 192.168.111.128 0.0.0.3 area 10
 network 192.168.111.132 0.0.0.3 area 10
 network 204.172.100.160 0.0.0.15 area 10


A20A

interface Loopback0 - BGP 광고용
 ip address 206.172.100.161 255.255.255.240

interface FastEthernet0/0 - A20B와 연결
 ip address 192.168.121.129 255.255.255.252

interface Serial1/1 - ISP D와 연결
 ip address 13.13.13.14 255.255.255.252

router ospf 5730
 router-id 206.172.100.161
 passive-interface Serial1/1
 network 13.13.13.12 0.0.0.3 area 20
 network 192.168.121.128 0.0.0.3 area 20
 network 192.168.121.132 0.0.0.3 area 20
 network 206.172.100.160 0.0.0.15 area 20


P.S : 당연하다면 당연하지만, 실제로 입력한 건 저렇게 명령다 치고 입력하지 않습니다~
그리고 저것 만 하진 않아요. 다 생략하고 마지막에 불필요한것 다 컷한 결과물. show running-config에서 필요한 부분만 잘라온겁니다~

2013년 12월 16일 월요일

GRE IPsec VPN을 이용한 원격지간 OSPF Area 연결 - 1. 개요

1. 개요

Routing Protocol을 공부하다보면, RIP/OSPF/EIGRP/BGP 이 네가지는 배우게 된다.
물론 BGP는 CCNA까지에서는 그냥 그런게 있다 정도나 배우거나 아예 듣지도 못하지만...

그중 OSPF는 다소 큰 구조의 네트워크 구성에 주로 사용되며, 구역별로 Area를 나눠서 Routing 정보를 전달하는 구조를 가지고 있다. 다만, 하나의 Area로만 구성된 경우에는 상관이 없지만, 둘 이상의 Area로 구성된 경우는 제한사항이 하나 있는데, 모든 Area 는 Area 0과 논리적으로 직접 연결되야만 한다는 점이다. 따라서 Area 1 - Area 0 - Area 2는 가능하지만, Area 0 - Area 1 - Area 2는 불가능하다. 당연히 Area 0 - 별도 네트워크 - 그외 Area 식의 환경도 연계가 안된다.

이런 상황을 해결하는 방법은 몇가지가 있지만, 여기서는 Tunnel 을 사용한 방법으로 분리된 네트워크 환경에서 하나의 OSPF 구성으로 만드는 방법을 알아보려고 한다.

시뮬레이션은 GNS3를 사용했으며, 실제 작업과정에서 걸리는 부하가 커서 상당히 간략화 한 구조를 사용하기로 한다.


2. 기본 설정



기본설정은 아래와 같다.

Area 0 : 가상의 회사 - 본사

Area 10/20 : 가상의 회사 - 지사

ISP A~D : 가상의 계약한 ISP 업체들

ISP간 연결 및 ISP-회사간 연결에는 BGP를 사용한다.

각 본사 및 지사 내부적으로는 OSPF를 사용한다.

각 본사 및 지사간 GRE Tunnel(with VPN)을 구성해서 연결한다.




3. 구성

-1. ip 설정 및 연결.

일단 OSPF 영역의

Point-to-Point 부분은 C Class급 사설네트워크로
192.168.100.0 - Area 0
192.168.110.0 - Area 10
192.168.120.0 - Area 20
내에서 분할함.

ISP 영역은 적당히~(중요하지 않으니까)

해서 실제 설정값은 다음게시물로