Header

  1. View current page

    adioshun님의 노트

Profile_img_60x60_01
0

[구현_IPSec] 리눅스-윈도우

*수정시 코멘트를 꼭 추가 합시다.

 

 개요

앞장의 리눅스의 IPSec 구현을 바탕으로

  • 리눅스와 WindowsXP 간의 IPSec통신을 구현한다.
  • Mobile Windows 5.0 과 WindowsXP IPSec통신을 구현한다
  • Mobile Windows 5.0과 리눅스와의 IPSec통신을 구현한다.
  • 윈도우XP는 제한적 IPSec을 지원하므로, Full support하는 윈도우 서버도 고려 하기 (윈도 서버도 풀 support 안합니다, 오직 vista에서만)

 

참고

  1. http://www.jacco2.dds.nl/networking/openswan-l2tp.html
  2. http://support.microsoft.com/default.aspx?scid=kb;en-us;838079
  3. How to Configure IPSec Tunneling in Windows 2000
  4. VPN설치_계획_및_설치_순서_v02.doc [이전에 IMTL선배님들이 작업한 VPN문서]
  5. http://gentoo-wiki.com/HOWTO_IPSEC
  6. http://www1.ietf.org/mail-archive/web/ipsec/current/msg00960.html windows의 h

 

현재 windows xp 에서의 IPv6 현황

http://www.microsoft.com/technet/network/ipv6/ipv6faq.mspx

Q. Does the IPv6 protocol for Windows support Internet Protocol security (IPsec)?
A.

IPsec for the IPv6 protocol for Windows Server 2003 and Windows XP is supported, with the following limitations:

The Authentication Header (AH) and Encapsulating Security Payload (ESP) are supported for both transport and tunnel modes. However, ESP for the IPv6 protocol for Windows does not support data encryption.

IPsec in the IPv6 protocol for Windows does not support the use of Internet Key Exchange (IKE) to negotiate security associations (SAs). IPsec policies, SAs, and the keys to calculate the Message Digest 5 (MD5) or Secure Hash Algorithm 1 (SHA-1) keyed hash for AH or ESP must be manually configured.

IPsec for IPv6 traffic is completely independent from IPsec for IPv4 traffic. IPv6 IPsec security policies are not managed with the IP Security Policies snap-in. IPsec policies and SAs for the IPv6 protocol for Windows must be manually configured with the Ipsec6.exe tool. For more information and an example, see the topic titled "Using IPsec between two local link hosts" in Windows Server 2003 or Windows XP help.

IPsec for the IPv6 protocol for Windows Vista and Windows Server "Longhorn" has full support for IPsec.

 

제한사항 추가 (헌정)

•IPsec supported except:
–ESP for the IPv6 doesn’t support data encryption
–IPsec in the IPv6 protocol doesn’t support the use of Internet Key Exchange (IKE) for negotiating security associations (SAs)
–IPsec for IPv6 traffic completely independent from IPsec for IPv4.

출처 : 2_Internet

 

윈도 비스타에서 IPv6 IPsec 하는 방법

http://www.usipv6.com/6sense/2006/apr/01.htm

Full IPsec support
Internet Protocol security (IPsec) support for IPv6 traffic in Windows XP and Windows Server 2003 is limited. For example, there is no support for Internet Key Exchange (IKE) or data encryption, and IPsec security policies, security association, and keys must be manually configured using command-line tools.
In Windows Vista, IPsec support for IPv6 traffic is the same as that for IPv4, including support for IKE and data encryption with AES 128/192/256. You can now configure IPsec policies for IPv6 traffic in the same way as IPv4 traffic using Windows graphical user interface (GUI) tools.

 

 

Windows 에서 IPv6 활성화 하기

명령어 창에서

c:\> netsh interface ipv6 install

끝이다.

 

 

윈도 xp에서 ipsec6.exe를 이용하여 ipsec 거는 법

http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_imp_conf5.mspx?mfr=true

 

일단 사용의 편의를 위해 고정 아이피를 박아넣자

c:\> netsh interface ipv6 add address "로컬 영역 연결" 2001:220:1404:3::201

 

혹시 모르니까 다음의 것도 셋팅을 해 놓자. 라우터로 동작 안하게 하는 것이다.

c:\> netsh interface ipv6 set interface "로컬 영역 연결" forwarding=disabled advertise=disabled

 

라우팅 테이블 추가하는 방법.

c:\> netsh interface ipv6 add route 2001:220:1404:3::201/128 "로컬 영역 연결" nexthop=2001:220:1404:3::1 publish=yes

 

라우팅 테이블 보는 방법

c:\> netsh interface ipv6 show routes

 

윈도 두대에 각각 설치해보자. 일단

c:\> ipsec6 s test

 

하면 test.spd 파일과 test.sad 파일이 생성된다.

여기에 아래 링크를 참고하여 채워 넣는다.

winwin.sadwinwin.spdTest.key -- for 2001:220:1404:3::201

winwin202.sad, winwin202.spd -- for 2001:220:1404:3::202 ;; Test.key는 같이 쓴다.

 

각각의 Windows PC 에서 다음 명령으로 IPSec을 건다.

c:\> ipsec6 d sp 2            ;; 기존에 걸려있던 보안정책을 삭제한다.

c:\> ipsec6 l winwin         ;; load의 l 글자다.. 헷갈리지 말자. 뒤에 확장자는 생략한다.

 

상호간에 ping6을 때려보자 - 2001:220:1404:3::201 에서 해보자

c:\> ping6 2001:220:1404:3::202 -t

 

감동적이다.. ㅠ.ㅠ ethereal로 캡쳐해서 보면 더 감동적이다..

그래서!!! 캡쳐파일을 올린다.

AH 트랜스포트 모드 - ah-success

ESP 터널 모드 - esp-success

 

윈도 xp에서 IPv6 IPsec 하는 방법

  • ipsec6.exe 을 이용하면 된다.

 http://technet2.microsoft.com/WindowsServer/ko/Library/ae2a3333-ade1-43ff-bec3-4a61b21490e91042.mspx?mfr=true

 

  • ipsec6.exe 사용법

Ipsec6.exe를 사용하여 IPSec 정책과 보안 연결을 구성할 수 있습니다.

Ipsec6.exe에는 여러 명령이 있으며 각 명령은 고유한 매개 변수 집합으로 구성되어 있습니다.

ipsec6 sp [Interface]

활성 보안 정책을 표시합니다. 또는 특정 인터페이스의 활성 보안 정책을 표시합니다.

ipsec6 sa

활성 보안 연결을 표시합니다.

ipsec6 l FileNameWithNoExtension

FileName.spd에서 보안 정책을 로드하고 FileName.sad에서 보안 연결을 로드합니다.

ipsec6 s FileNameWithNoExtension

FileName.spd에 현재 보안 정책을 저장하고 FileName.sad에 현재 보안 연결을 저장합니다. 이 명령을 사용하여 보안 정책과 보안 연결을 구성하는 데 사용되는 파일을 만들 수 있습니다. 보안 정책이나 보안 연결이 없으면, 이 명령은 보안 정책에 대해 FileName.spd를 만들고 보안 연결에 대해 FileName.sad를 만듭니다. 텍스트 편집기로 수정하여 원하는 보안 정책이나 보안 연결을 구성하는 템플릿으로 이 파일을 사용할 수 있습니다.

ipsec6 d [{sp | sa}] [Index]

색인 번호로 지정된 활성 보안 정책 및 보안 연결 목록에서 sp 매개 변수를 사용하여 보안 정책을 삭제하거나 sa 매개 변수를 사용하여 보안 연결을 삭제합니다. ipsec6 sp 또는 ipsec6 sa를 사용하여 색인 번호를 표시할 수 있습니다.

ipsec6 m [{on | off}]

IP 보안으로 보호된 이동 IPv6에 사용되는 업데이트를 바인딩할 것인지 여부를 지정합니다. 이 옵션은 기본으로 선택되어 있습니다.

주의

이러한 IPv6의 IPSec 구현은 정적 키 입력에 의존하며 시퀀스 번호 재사용 시 키를 업데이트할 규정이 없기 때문에 프로덕션 환경에 사용하지 않는 것이 좋습니다.

SPI(Security Policies Identifier)를 수동으로 구성할 때는 항상 임의의 숫자를 사용하십시오. SPI에 대해서는 순차 번호를 사용하지 마십시오. 그렇지 않으면 IPv6의 IPSec 보안 정책이 손상될 수 있습니다.

Windows Server 2003 제품군의 IPv6 프로토콜은 IPSec ESP(Encapsulating Security Payload) 암호화 기능의 사용을 지원하지 않습니다. 그러나 Null 암호화를 포함한 ESP의 사용은 지원됩니다. Null 암호화는 ESP 헤더를 사용하지만 데이터 원본 인증 및 데이터 무결성 서비스만 제공됩니다.

 

 Windows xp와 Linux 간에 IPv6 IPsec 걸기

지금 까지는 실패다.

지금 현재 세팅을 설정하고 상호간에 핑을 날리면서 ethereal로 캡춰를 해봤다.

날라가긴 하는데 이상한 점이 발견된다.

캡춰 파일을 올린다.  error.cap

이파일을 ethereal 로 열어보면 다음과 같은 전체 화면이 보인다.

 ether-total.JPG

 

여기서 양방향으로 패킷이 오고 가는것은 양쪽에서 서로 응답없는 핑을 쏴대고 있기 때문이다. 보면 reply는 없고 request만 있는것을 볼 수 있다.

그럼 한 방향씩 다시 알아보도록 하자

ether-11-201.JPG

 

그 다음 반대방향이다

 ether-201-11.JPG

 

마지막 두 그림을 보면 IV (Integrity Value) 의 길이가 다른 것을 볼 수 있다.

둘은 분명 똑같이 HMAC-MD5로 128비트 키를 이용했는데

 

위엣것은 96비트짜리고 아래것은 160비트짜리 IV가 보여지고 있다.

이래서 서로 안되는가 보다.. 이걸 해결할 방안이 필요하다.

 

일단 윈도가 삐구짓 하고 있다,

애초에 AH에서 Authentication Data 만들때 결과 나온것의 96 bit만 사용하기로 되어있다.

근데 윈도가 그걸 안지키고 있으니 삐꾸가 날 밖에 ㅡㅡ

난감하다 ㅡㅡ 뭔수로 저걸 고친다냐?

 

 해결 !!! - 중희님 만만세~!!

 http://www1.ietf.org/mail-archive/web/ipsec/current/msg00960.html 

이 사이트에 해답이 나와있다. Authentication Algorithm으로 HMAC-MD5 대신에 HMAC-MD5-96 이라고 윈도 박스에 써주면 된다

아 놔 이거 완전 사람 바보 만드는 구먼,,,,

 

History

Last edited on 05/11/2007 14:58 by [-L-A-B-O-N-]™

Comments (0)

You must log in to leave a comment. Please sign in.