| 단계별 | 예제 코드 | 설명 |
| PC IP 설정 | PC0: IP: 203.230.7.2/24 GW: 203.230.7.1 PC1: IP: 203.230.8.2/24 GW: 203.230.8.1 PC2: IP: 203.230.11.2/24 GW: 203.230.11.1 PC3: IP: 203.230.12.2/24 GW: 203.230.12.1 | |
R1에 IPSec VPN 설정 (기본설정) | R1(config)# int gi0/0 R1(config-if)# ip add 203.230.7.1 255.255.255.0 R1(config-if)# no shut R1(config-if)# exit
R1(config)# int gi0/1 R1(config-if)# ip add 203.230.8.1 255.255.255.0 R1(config-if)# no shut R1(config-if)# exit
R1(config)# int s0/2/0 R1(config-if)# ip add 203.230.9.1 255.255.255.0 R1(config-if)# clock rate 64000 R1(config-if)# no shut R1(config-if)# exit
R1(config)# int tunnel 12 (트래픽이 통과하는 터널 선언) R1(config-if)# ip add 10.10.10.1 255.255.255.0 R1(config-if)# tunnel source s0/2/0 R1(config-if)# tunnel destination 203.230.9.2 R1(config-if)# exit | |
| R1에 IPSec VPN 설정(보안 라이선스 설정) | R1(config)# license boot module c2900 technology-package securityk9 ㆍㆍㆍ 중간 생략 ㆍㆍㆍ
ACCEPT? [yes/no]: yes % use ‘write’command to make license boot config take effect on
R1(config)# do write Building configuration… [OK]
R1(config)# exit R1# %SYS-5-CONFIG_I: Configured from console by console
R1# reload Proceed with reload? [confirm] (재부팅한 후 아래와 같이 입력) | |
| R1에 IPSec VPN 설정(IPSec 설정) | R1(config)# crypto isakmp policy 10 (ISAKMP에서 사용할 정책 선언) R1(config-isakmp)# encryption aes 256 R1(config-isakmp)# authentication pre-share R1(config-isakmp)# lifetime 36000 R1(config-isakmp)# hash sha R1(config-isakmp)# exit
R1(config)# crypto ipsec transform-set strong esp-3des esp-md5-hmac R1(config)# crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0 R1(config)# crypto map vpn 10 ipsec-isakmp R1(config-crypto-map)# set peer 203.230.9.2 R1(config-crypto-map)# set transform-set strong R1(config-crypto-map)# match address 110 R1(config-crypto-map)# exit
R1(config)# access-list 110 permit gre host 203.230.9.1 host 203.230.9.2
R1(config)# int s0/2/0 R1(config-if)# crypto map vpn (VPN 작동을 선언) R1(config-if)# exit | |
| 라우터 R1에 IPSec VPN 설정(OSPF 설정) | R1(config)# router ospf 7 R1(config-router)# network 203.230.7.1 0.0.0.0 area 0 R1(config-router)# network 203.230.8.1 0.0.0.0 area 0 R1(config-router)# network 203.230.9.1 0.0.0.0 area 0 R1(config-router)# network 10.10.10.1 0.0.0.0 area 0 | |
| R2에 IPSec VPN 설정(기본 설정) | R2(config)# int s0/2/0 R2(config-if)# ip add 203.230.10.1 255.255.255.0 R2(config-if)# clock rate 64000 R2(config-if)# no shut R2(config-if)# exit
R2(config)# int s0/2/1 R2(config-if)# ip add 203.230.9.2 255.255.255.0 R2(config-if)# no shut R2(config-if)# exit
R2(config)# int tunnel 12 (트래픽이 통과하는 터널 선언) R2(config-if)# ip add 10.10.10.2 255.255.255.0 R2(config-if)# tunnel source s0/2/1 R2(config-if)# tunnel destination 203.230.9.1 R2(config-if)# exit
R2(config)# int tunnel 23 (트래픽이 통과하는 터널 선언) R2(config-if)# ip add 11.11.11.1 255.255.255.0 R2(config-if)# tunnel source s0/2/0 R2(config-if)# tunnel destination 203.230.10.2 R2(config-if)# exit | |
| R2에 IPSec VPN 설정(보안 라이선스 설정) | R2(config)# license boot module c2900 technology-package securityk9 ㆍㆍㆍ 중간 생략 ㆍㆍㆍ
R2(config)# do write Building configuration… [OK]
R2(config)# exit R2# %SYS-5-CONFIG_I: Configured from console by console
R2# reload Proceed with reload? [confirm] (재부팅한 후 아래와 같이 입력) | |
| R2에 IPSec VPN 설정(IPSec 설정) | R2(config)# crypto isakmp policy 10 (ISAKMP에서 사용할 정책 선언) R2(config-isakmp)# encryption aes 256 R2(config-isakmp)# authentication pre-share R2(config-isakmp)# lifetime 36000 R2(config-isakmp)# hash sha R2(config-isakmp)# exit
R2(config)# crypto ipsec transform-set strong esp-3des esp-md5-hmac R2(config)# crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0 R2(config)# crypto map vpn 10 ipsec-isakmp R2(config-crypto-map)# set peer 203.230.9.1 R2(config-crypto-map)# set transform-set strong R2(config-crypto-map)# match address 110 R2(config-crypto-map)# exit
R2(config)# crypto map vpn 20 ipsec-isakmp R2(config-crypto-map)# set peer 203.230.10.2 R2(config-crypto-map)# set transform-set strong R2(config-crypto-map)# match address 120 R2(config-crypto-map)# exit | |
| R2에 IPSec VPN 설정(OSPF 설정) | R2(config)# access-list 110 permit gre host 203.230.9.2 host 203.230.9.1 R2(config)# access-list 120 permit gre host 203.230.10.1 host 203.230.10.2 R2(config)# int s0/2/0 R2(config-if)# crypto map vpn (VPN 작동을 선언) R2(config-if)# exit
R2(config)# int s0/2/1 R2(config-if)# crypto map vpn (VPN 작동을 선언) R2(config-if)# exit
R2(config)# router ospf 7 R2(config-router)# network 203.230.9.2 0.0.0.0 area 0 R2(config-router)# network 203.230.10.1 0.0.0.0 area 0 R2(config-router)# network 10.10.10.2 0.0.0.0 area 0 R2(config-router)# network 11.11.11.1 0.0.0.0 area 0 | |
| R3에 IPSec VPN 설정(기본 설정) | R3(config)# int gi0/0 R3(config-if)# ip add 203.230.11.1 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit
R3(config)# int gi0/1 R3(config-if)# ip add 203.230.12.1 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit
R3(config)# int s0/2/1 R3(config-if)# ip add 203.230.10.2 255.255.255.0 R3(config-if)# no shut R3(config-if)# exit
R3(config)# int tunnel 23 (트래픽이 통과하는 터널 선언) R3(config-if)# ip add 11.11.11.2 255.255.255.0 R3(config-if)# tunnel source s0/2/1 R3(config-if)# tunnel destination 203.230.10.1 R3(config-if)# exit | |
| R3에 IPSec VPN 설정(보안 라이선스 설정) | R3(config)# license boot module c2900 technology-package securityk9 ㆍㆍㆍ 중간 생략 ㆍㆍㆍ
ACCEPT? [yes/no]: yes % use ‘write’command to make license boot config take effect on
R3(config)# do write Building configuration… [OK]
R3(config)# exit R3# %SYS-5-CONFIG_I: Configured from console by console
R3# reload Proceed with reload? [confirm] (재부팅한 후 아래와 같이 입력) | |
| R3에 IPSec VPN 설정(IPSec 설정) | R3(config)# crypto isakmp policy 10 (ISAKMP에서 사용할 정책 선언) R3(config-isakmp)# encryption aes 256 R3(config-isakmp)# authentication pre-share R3(config-isakmp)# lifetime 36000 R3(config-isakmp)# hash sha R3(config-isakmp)# exit
R3(config)# crypto ipsec transform-set strong esp-3des esp-md5-hmac R3(config)# crypto isakmp key cisco123 address 0.0.0.0 0.0.0.0 R3(config)# crypto map vpn 10 ipsec-isakmp R3(config-crypto-map)# set peer 203.230.10.1 R3(config-crypto-map)# set transform-set strong R3(config-crypto-map)# match address 110 R3(config-crypto-map)# exit
R3(config)# access-list 110 permit gre host 203.230.10.2 host 203.230.10.1 R3(config)# int s0/2/1 R3(config-if)# crypto map vpn (VPN 작동을 선언) R3(config-if)# exit
R3(config)# router ospf 7 R3(config-router)# network 203.230.10.2 0.0.0.0 area 0 R3(config-router)# network 203.230.11.1 0.0.0.0 area 0 R3(config-router)# network 203.230.12.1 0.0.0.0 area 0 R3(config-router)# network 11.11.11.2 0.0.0.0 area 0 | ▶설정을 마친 후 파일을 저장하고 패킷트레이서를 파일을 다시 읽어 들여야 함 |
| IPSec VPN 설정 확인 | PC0> tracert 203.230.11.2
1 0 ms 0 ms 0 ms 203.230.7.1 (R1) 2 1 ms 7 ms 12 ms 10.10.10.2 (R2, tunnel 12) 3 4 ms 2 ms 9 ms 11.11.11.2 (R3, tunnel 23) 4 * 2 ms 9 ms 203.230.11.2 (PC2)
PC1> tracert 203.230.11.2
1 0 ms 0 ms 0 ms 203.230.8.1 (R1) 2 1 ms 7 ms 12 ms 10.10.10.2 (R2, tunnel 12) 3 4 ms 2 ms 9 ms 11.11.11.2 (R3, tunnel 23) 4 * 2 ms 9 ms 203.230.11.2 (PC2) | 10.10.10.2
정해진 터널 IP주소를 거쳐 잘 통과하는지 확인 |
| 인터페이스별 VPN 정보확인 | R2# show crypto ipsec sa (인터페이스 별로 VPN에 관한 모든 정보 확인) R2# show crypto ipsec transform-set (IPSec 설정 및 동작 확인) R2# show crypto isakmp policy (ISAKMP 설정 확인) R2# show crypto isakmp sa (VPN 출발지/도착지 및 상태 확인) R2# show crypto map (VPN 연결정보 및 ACL 확인) | |