'IPsec VPN'에 해당되는 글 2건

  1. 2016.06.07 IPsec VPN 본사 - 지사 설정 방법 by 랩터 인터내셔널
  2. 2016.04.22 IPsec VPN - HSRP 이중 경로 설정 방법 by 랩터 인터내셔널


■ Internet Router 기본 설정


Router(config)# hostname Internet


Internet(config)# interface fastethernet 0/0


Internet(config-if)# ip address 100.10.10.2 255.255.255.0


Internet(config-if)# no shutdown


Internet(config-if)# exit


Internet(config)# interface fastethernet 1/0


Internet(config-if)# ip address 100.10.20.2 255.255.255.0


Internet(config-if)# no shutdown


Internet(config-if)# exit




■ Head Router 기본 설정


Router(config)# hostname Head


Head(config)# interface fastethernet 0/0


Head(config-if)# ip address 100.10.10.1 255.255.255.0


Head(config-if)# no shutdown


Head(config-if)# exit


Head(config)# interface fastethernet 0/1


Head(config-if)# ip address 192.168.10.1 255.255.255.0


Head(config-if)# no shutdown


Head(config-if)# exit


Head(config)# ip route 192.168.20.0 255.255.255.0 100.10.20.1


Head(config)# ip route 100.10.20.0 255.255.255.0 100.10.10.2




■ Branch Router 기본 설정


Router(config)# hostname Branch


Branch(config)# interface fastethernet 0/0


Branch(config-if)# ip address 100.10.20.1 255.255.255.0


Branch(config-if)# no shutdown


Branch(config-if)# exit


Branch(config)# interface fastethernet 0/1


Branch(config-if)# ip address 192.168.20.1 255.255.255.0


Branch(config-if)# no shutdown


Branch(config-if)# exit


Branch(config)# ip route 192.168.10.0 255.255.255.0 100.10.10.1


Branch(config)# ip route 100.10.10.0 255.255.255.0 100.10.20.2






■ 1차 Ping Test




HEAD Router에 연결된 PC1 (IP : 192.168.10.10)에서


라우터 인터페이스 fa0/1(192.168.10.1), fa0/0(100.10.10.1)까지는 정상적인 ping test가 된다.


그러나 Internet 라우터 인터페이스 fa0/0(100.10.10.2)는 핑이 안된다.


그 이유는 이번 실습에서 인터넷 라우터에는 정적/동적 라우팅 프로토콜을 사용하지 않기 때문이다.












▶▶▶ IPsec Site-to-Site VPN 설정시에 양쪽의 라우터에서 phase 1, phase 2 설정시


Hash (데이터 무결성 체크) 및 암호와 알고리름 등은 어떤 기법을 사용해도 상관없으나,


중요한 것은 양쪽이 동일한 방법을 사용해야 한다.






■ Head 라우터 IPSEC VPN 설정 - Branch 사설구간과의 통신을 위해서




▶ pahse 1 설정 – 마스터 키 생성


Head(config)# crypto isakmp policy 1                                           1~10000까지 사용가능, 낮은 번호 우선


Head(config-isakmp)# authentication pre-share                                  인증은 프리-쉐어 키


Head(config-isakmp)# hash sha                                                  데이터 무결성(Hash) 체크 방법


Head(config-isakmp)# encryption aes 128                                        암호와 알고리즘 방법


Head(config-isakmp)# group 2                                                   Diffie-Hellman Group2


Head(config-isakmp)# lifetime 84600                                            양측 수명이 다르면 짧은 것 적용


Head(config-isakmp)# exit


Head(config)# crypto isakmp key 6 Hoony address 100.10.20.1 255.255.255.255    상대방 사이트 포트 (피어인증)




▶ pahse 2 설정 – Session 키 생성


Head(config)# access-list 110 permit ip 192.168.10.0 0.0.0.255 192.168.20.0 0.0.0.255   보호할 트래픽을 지정하는 ACL


Head(config)# crypto ipsec transform-set IPSEC-VPN ah-md5-hmac esp-aes 128              Hash 및 암호와 방법


Head(cfg-crypto-trans)# exit


Head(config)# crypto map To-Branch 10 ipsec-isakmp                                      To-Branch 설정


Head(config-crypto-map)# match address 110                                              ACL 110과 일치하면


Head(config-crypto-map)# set peer 100.10.20.1                                           피어를 100.10.20.1로 하고


Head(config-crypto-map)# set transform-set IPSEC-VPN                                    트랜스폼셋 PSEC-VPN을 적용하라


Head(config-crypto-map)# exit


 


▶ 물리적 포트에 IPsec 적용


Head(config)# interface fastethernet 0/0


Head(config-if)# crypto map To-Branch


Head(config-if)# exit


Jan 15 14:58:27.711: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON






■ Branch 라우터 IPSEC VPN 설정 - Head 사설구간과의 통신을 위해서




▶ pahse 1 설정


Branch(config)# crypto isakmp policy 1


Branch(config-isakmp)# authentication pre-share


Branch(config-isakmp)# hash sha


Branch(config-isakmp)# encryption aes 128


Branch(config-isakmp)# group 2


Branch(config-isakmp)# lifetime 84600


Branch(config-isakmp)# exit


Branch(config)# crypto isakmp key 6 Hoony address 100.10.10.1 255.255.255.255




▶ pahse 2 설정


Branch(config)# access-listt 120 permit ip 192.168.20.0 0.0.0.255 192.168.10.0 0.0.0.255


Branch(config)# crypto ipsec transform-set IPSEC-VPN ah-md5-hmac esp-aes 128


Branch(cfg-crypto-trans)# exit


Branch(config)# crypto map To-Head 10 ipsec-isakmp


Branch(config-crypto-map)# match address 120


Branch(config-crypto-map)# set peer 100.10.10.1


Branch(config-crypto-map)# set transform-set IPSEC-VPN


Branch(config-crypto-map)# exit




▶ 물리적 포트에 IPsec 적용


Branch(config)#


Branch(config)# interface fastethernet 0/0


Branch(config-if)# crypto map To-Head


Branch(config-if)# exit


Jan 15 15:00:16.911: %CRYPTO-6-ISAKMP_ON_OFF: ISAKMP is ON






■ HEAD 라우터와 Branch 라우터에 Site-to-Site VPN 설정 후 통신 테스트


 - PC1 (IP : 192.168.10.10)에서 PC2 (IP : 192.168.20.10)으로 Ping Test








정상적으로 통신이 되고 있음을 확인





■ Branch 라우터에서 인터넷 구간에 연결된 물리적 인터페이스 fastethernet 0/0를 Wireshark 로 캡쳐










 


■ PC2의 물리적 인터페이스의 트래픽 WireShark로 확인


 - 출발지 / 도착지 IP 주소와 어떤 프로토콜로 트래픽이 오가는지 확인 할 수 있다.






출처 - http://things.blog.me/220242263076

반응형
Posted by 랩터 인터내셔널

IPsec VPN - HSRP 2중 경로

 


 

VPN을 구성함에 있어 하나의 경로로만 구성하면 안정성이 낮아진다.

 

그러므로, Intranet을 위한 VPN에 HSRP를 활용하여 이중화를 하여 안정성을 높일 수 있다.

 

Company_Active 라우터가 192.168.20.0/24 네트워크에 대하여 Active 상태로 작동하고

 

Company_Stanby 라우터는 Standby 상태로 대기중이다.

 

그러다가 Company_Active의 ethernet 0/1포트에 장애가 발생하면 Company_Stanby 라우터가

 

preempt에 의해 권한은 위임받아 Active 상태가 된다.

 


 

11.png



 

 

 


 

■ Client 라우터 기본 설정

 

Router(config)# hostname Client
Client(config)# interface ethernet 0/3
Client(config-if)# ip address 192.168.10.1 255.255.255.0
Client(config-if)# no shutdown
Client(config-if)# exit
Client(config)# interface ethernet 0/0
Client(config-if)# ip address 100.10.10.2 255.255.255.0
Client(config-if)# no shutdown
Client(config-if)# exit
Client(config)# router eigrp 10
Client(config-router)# no auto-summary
Client(config-router)# network 100.10.10.0
Client(config-router)# network 192.168.10.0
Client(config-router)# exit
Client(config)#

 

 


 

■ Company_Active 라우터 기본 설정

 

Router(config)# hostname Company_Active
Company_Active(config)# interface ethernet 0/0
Company_Active(config-if)# ip address 100.10.20.2 255.255.255.0
Company_Active(config-if)# no shutdown
Company_Active(config-if)# exit
Company_Active(config)# interface ethernet 0/1
Company_Active(config-if)# ip address 192.168.20.1 255.255.255.0
Company_Active(config-if)# no shutdown
Company_Active(config-if)# exit
Company_Active(config)# router eigrp 10
Company_Active(config-router)# no auto-summary
Company_Active(config-router)# network 100.10.20.0
Company_Active(config-router)# network 192.168.20.0
Company_Active(config-router)# exit
Company_Active(config)#

 

 

 

 

■ Company_Standby 라우터 기본 설정

 

Router(config)# hostname Company_Standby
Company_Standby(config)# interface ethernet 0/0
Company_Standby(config-if)# ip address 100.10.20.3 255.255.255.0
Company_Standby(config-if)# no shutdown
Company_Standby(config-if)# exit
Company_Standby(config)# interface ethernet 0/1
Company_Standby(config-if)# ip address 192.168.20.2 255.255.255.0
Company_Standby(config-if)# no shutdown
Company_Standby(config-if)# exit
Company_Standby(config)# router eigrp 10
Company_Standby(config-router)# no auto-summary
Company_Standby(config-router)# network 100.10.20.0
Company_Standby(config-router)# network 192.168.20.0
Company_Standby(config-router)# exit

 

 


■ ISP 라우터 기본 설정

 

Router(config)# hostname ISP
ISP(config)# interface ethernet 0/0
ISP(config-if)# ip address 100.10.10.1 255.255.255.0
ISP(config-if)# no shutdown
ISP(config-if)# exit
ISP(config)# interface ethernet 0/1
ISP(config-if)# ip address 100.10.20.1 255.255.255.0
ISP(config-if)# no shutdown
ISP(config-if)# exit
ISP(config)# router eigrp 10
ISP(config-router)# no auto-summary
ISP(config-router)# network 100.10.10.0
ISP(config-router)# network 100.10.20.0
ISP(config-router)# exit
ISP(config)# exit
ISP#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route

 

Gateway of last resort is not set

 

     100.0.0.0/24 is subnetted, 2 subnets
C       100.10.10.0 is directly connected, Ethernet0/0
C       100.10.20.0 is directly connected, Ethernet0/1
D    192.168.10.0/24 [90/307200] via 100.10.10.2, 00:01:53, Ethernet0/0
D    192.168.20.0/24 [90/307200] via 100.10.20.3, 00:01:36, Ethernet0/1    

 

                     [90/307200] via 100.10.20.2, 00:01:36, Ethernet0/1

 

 

Intranet의 192.168.20.0/24 네트워크에 대한 경로가 2중으로 설정되었다.
 

 


 

----------------------------------------------------------------

 

게이트웨이 이중화 설정​ - SDM 접속을 위하여 로컬 계정을 추가한다.

 

----------------------------------------------------------------

 

 

■ HSRP 설정 - Company_Standby 라우터

 

Company_Standby(config)# username Hoony privilege 15 password 0 1234
Company_Standby(config)# interface ethernet 0/1
Company_Standby(config-if)# standby 1 ip 192.168.20.254
Company_Standby(config-if)# standby 1 preempt
Company_Standby(config-if)# standby 1 track ethernet 0/0
Company_Standby(config-if)# exit
Company_Standby(config)# exit
Jan 19 13:48:44.239: %HSRP-6-STATECHANGE: Ethernet0/1 Grp 1 state Standby -> Active
Jan 19 13:48:47.259: %HSRP-6-STATECHANGE: Ethernet0/1 Grp 1 state Active -> Speak

Company_Standby# show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active          Standby         Virtual IP    
Et0/1       1   100  P Standby  192.168.20.1    local           192.168.20.254
Company_Standby#

 


 

■ HSRP 설정 - Company_Active 라우터

 

Company_Active(config)# username Hoony privilege 15 password 0 1234
Company_Active(config)# interface ethernet 0/1
Company_Active(config-if)# standby 1 ip 192.168.20.254
Company_Active(config-if)# standby 1 priority 150
Company_Active(config-if)# standby 1 preempt
Company_Active(config-if)# standby 1 track ethernet 0/0 60
Company_Active(config-if)# exit
Company_Active(config)#exit
Jan 19 13:48:56.131: %HSRP-6-STATECHANGE: Ethernet0/1 Grp 1 state Listen -> Active
Company_Active# show standby brief
                     P indicates configured to preempt.
                     |
Interface   Grp Prio P State    Active          Standby         Virtual IP    
Et0/1       1   150  P Active   local           192.168.20.2    192.168.20.254
Company_Active#

 


 

 

■ SDM을 이용한 IPsec VPN 서버 설정

22.gif


 

 


 

 

 

 

■ VPN Client 프로그램을 이용한 Intranet (192.168.20.0/24) 접속

 


 

33.gif


 

 

 

 

 

■ isakmp on 상태 및 VPN client 접속 완료

 

44.png


 

 


 


 


 

■ 사설 Intranet 의 IP를 할당 받은 상태 확인

 


 

55.png


 

 


 


 

■ show running-config - Company-Active 라우터

 

...중략

 

username Hoony privilege 15 password 0 1234
!
aaa new-model
aaa authentication login default local   
aaa authentication login sdm_vpn_xauth_ml_1 local
aaa authorization exec default local
aaa authorization network sdm_vpn_group_ml_1 local
aaa session-id common
!
crypto isakmp policy 1
 encr 3des
 authentication pre-share
 group 2
crypto isakmp xauth timeout 15
!
crypto isakmp client configuration group Company
 key 123123
 pool SDM_POOL_1
 max-users 20
!
crypto ipsec transform-set ESP-3DES-SHA esp-3des esp-sha-hmac
!
crypto dynamic-map SDM_DYNMAP_1 1
 set transform-set ESP-3DES-SHA
 reverse-route
!
crypto map SDM_CMAP_1 client authentication list sdm_vpn_xauth_ml_1
crypto map SDM_CMAP_1 isakmp authorization list sdm_vpn_group_ml_1
crypto map SDM_CMAP_1 client configuration address respond
crypto map SDM_CMAP_1 65535 ipsec-isakmp dynamic SDM_DYNMAP_1
!
interface Ethernet0/0
 ip address 100.10.20.2 255.255.255.0
 half-duplex
 crypto map SDM_CMAP_1
!
ip local pool SDM_POOL_1 192.168.20.100 192.168.20.150
ip http server

 


출처 - http://things.blog.me/220242263076

 

반응형
Posted by 랩터 인터내셔널