WindowsXP에서 IPv6기반 IPSec 구현하기



1. Windows 에서 IPv6 활성화 하기

c:\> netsh interface ipv6 install


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


  • 일단 사용의 편의를 위해 고정 아이피를 박아넣자
    • c:\> netsh interface ipv6 add address "로컬 영역 연결" 2001:220:1404:3::201


  • 혹시 모르니까 다음의 것도 셋팅을 해 놓자. 라우터로 동작 안하게 하는 것이다.
    • c:\> netsh interface ipv6 set interface "로컬 영역 연결" forwarding=disabled advertise=disable


  • 라우팅 테이블 추가하는 방법.
    • 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.sad, winwin.spd, Test.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


3. 참고

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

참고

   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. http://gentoo-wiki.com/HOWTO_IPSEC
   5. http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sag_ip_v6_imp_conf5.mspx?mfr=true

작성 : IMTL_한병진, 이중희, 이제민
정리 : 20070420 by 임헌정
http://www.4ellene.net


 

2007/04/20 23:35 2007/04/20 23:35
Tag // ,

리눅스에서 IPSec6 구현하기


설치 (데비안기준)

  • 커널 2.6이상 (IPSec이 기본 설치), [2] 참고
    • 2.6에 들어 있는 IPSec은 KAME project를 기반으로 함[2], 그러므로 [1]을 참고 하는 것도 좋음
  • 관리 툴 설치 : apt-get install ipsec-tools [3]

설정파일

    Node_A의 설정 파일 [2]

    1: #!/usr/local/sbin/setkey -f
     2: flush;            // setkey 명령어
     3: spdflush;      //Security Asociation 과 Security Polies 초기화
     4:# <SA 설정>

     5: # AH <Node_A> to <Node_B>
     6: add <Node_A> <Node_B> ah 1000
     7:         -A hmac-md5 "1234567890123456";
     8: add <Node_B> <Node_A> ah 2000
     9:         -A hmac-md5 "1234567890123456";
    10:
    11: # ESP <Node_A> to <Node_B>
    12: add <Node_A> <Node_B> esp 1001
    13:         -E 3des-cbc "123456789012345678901234"    //암호화에 3DES 사용 , 뒤는 키값
    14:         -A hmac-sha1 "12345678901234567890";      //인증에 SHA1 사용 , 뒤는 키값
    15: add <Node_B> <Node_A> esp 2001
    16:         -E 3des-cbc "123456789012345678901234"    //키값의 생성시 아래 명령어 프롤프트에서 실행[1]
    17:         -A hmac-sha1 "12345678901234567890";     // dd if=/dev/random count=16 bs=1| xxd -ps
    18:#<SP 설정>
    19: spdadd <Node_A> <Node_B> any -P out IPsec  // (Node_B에서는 in으로 변경)
    20:         esp/transport//require                             // <Node_A>에서  <Node_B>로 가는 모든(any)패킷은
    21:         ah/transport//require;                             // Transport/ESP 와 Transport/AH 적용함
    22:                                                                     // 하단 [SP설정] 참고 
    23: spdadd <Node_B> <Node_A> any -P in IPsec// (Node_B에서는 out으로 변경)
    24:         esp/transport//require
    25:         ah/transport//require;



위 설정 파일을 /etc/setkey.conf로 저장


SA 설정
source | destination | ah/esp | SPI (Security Policy Index) any number but should be unique
| algorithm and associated secret key.

SP 설정
source | destination | on which kind of traffic to apply the policy (TCP, UDP, port, any) |
the direction in/out | what to do (IPsec/discard/none) | (esp/ah) / (transport/tunnel) /
(IP address of both ends of the tunnel) not required in transport mode / require.

 실행

 # setkey -f /etc/setkey.conf


확인

# setkey -D : SAD를 확인

# setkey -DP : SPD를 확인


실전 Tip

 setkey -f /etc/setkey.conf 로 설정파일을 읽어 들인다음

 설정했던 내용을 지워버리고 싶은 마음이 생길 것이다. 즉

# setkey -D

# setkey -DP


 이 두개를 실행했을때 아무것도 안나오게  하고 싶으면

 flush.conf 같은 파일을 하나 만들자

 1: #!/usr/local/sbin/setkey -f
 2: flush;          
 3: spdflush;


자 이제 이 flush.conf를 이용하여 ipsec 설정을 한방에 날리자

# setkey -f flush.conf

 위에 있는 두 명령으로 확인하면 싹 다 날라간걸 볼 수 있다.


참고 파일

[1] http://www.ipsec-howto.org/ipsec-howto.pdf
[2] http://www.linuxjournal.com/article/7840
[3] http://ipsec-tools.sourceforge.net/

IPsec-HowTo-WrittenByMoMTeam.pdf

작성 : 성균관 대학교 인터넷 관리 기술 연구실

정리 :20070420 by 임헌정
http://www.4ellene.net


 

2007/04/20 23:19 2007/04/20 23:19
Tag // ,

IPSec 구현전 참고 링크


openswan : http://www.natecarlson.com/linux/ipsec-x509.php

freeswan : http://www.strongsec.com/freeswan/

 

http://www.inwa.net/~m3047/ipsec-linux-windows.html

 

ipsec tunnel using Linux Kernel

http://www.shorewall.net/IPSEC-2.6.html

 

Linux Kernel IPsec

http://www.ipsec-howto.org/ipsec-howto.pdf

http://www.linuxjournal.com/article/7840

http://ipsec-tools.sourceforge.net/

 

이중에 아래 세개가 커널 IPsec 입니다.

Apt-get install ipsec-tools



2007/03/24 03:01 2007/03/24 03:01
Tag //

Linux, 특히 Ubuntu Linux 5.10 Breezy 버전에서 리얼타임 OS를 구현하기 위한 RTLinux 설정하는 법을 설명한 문서입니다.
필요하신 분들은 참고하세요.
그리고 같이 첨부한 화일은 리눅스 커널 컴파일 옵션 화일입니다.

출처 : http://robotics.yonsei.ac.kr/bbs/view.php?id=guestbook&page=1&sn1=&divpage=1&sn=off&ss=on&sc=on&select_arrange=headnum&desc=asc&no=23
2006/11/26 21:44 2006/11/26 21:44
Tag // ,

OLSRv2 설치 하기

from Linux/구현 2006/09/24 22:21
OLSRv2  설치 하기


패포판 : RedHat 9.0
커널 : 2.4.20


1. 파일 다운 받기
http://www.net.ie.niigata-u.ac.jp/~yowada/v2/index.php?plugin=attach&refer=FrontPage&openfile=OLSRv2-Niigata.0.1.0.tar.gz

2. 압축 풀기 및 이동
tar zvfx OLSRv2-Niigata\[1\].0.1.0.tar.gz
cd OLSRv2-Niigata.0.1.0/

3. make
-> olsrv2라는 실행 스크립트 생성됨

4. 설정 파일 복사
cp ./autoconf/olsrd.conf /etc/olsrd.conf

5. 실행
./olsrv2

작성 : 2006.09.24 by 임헌정
참고 : http://www.net.ie.niigata-u.ac.jp/~yowada/v2/index.php?FrontPage
http://www.4ellene.net


2006/09/24 22:21 2006/09/24 22:21
Tag //

1] 해당 인터페이스 방화벽 해제

2] 해당 인터페이스 IP설정(192.168.1.2)

3] 해당 인터페이스 GW설정(192.168.1.1)

라우터

[1] 라우터의 전원과 1번포트에 전원선및 컴퓨터와 연결 랜선 연결


웹 브라우져

http://192.168.1.1

2006/09/20 15:59 2006/09/20 15:59

MAODV 설치

from Linux/구현 2006/09/18 22:47
MAODV 설치
배포판 : Redhat9.0
커널 : 2.4.20-8


1] AODV-UU 0.6복사
http://core.it.uu.se/adhoc/AodvUUImpl/files.xml?action=download&file=aodv-uu-0.6.tar.gz


2] 패치 파일 복사
http://www.isr.umd.edu/CSHCN/research/maodv/patch-maodv-umd


3] 압축 풀기및 패치
tar zvfx aodv-uu-0.6.tar.gz
cp patch-maodv-umd ./aodv-uu-0.6/
cd aodv-uu-0.6
patch -p2 < patch-maodv-umd


[성공 메시지시 메시지]


* 설치전 사전 작업
ln -s /usr/src/linux-2.4 /usr/src/linux

4] 설치
make
make install
(make: *** No rule to make target `docs', needed by `all'.  Stop. 에러 발생시 -> mkdir docs

5] 실행
aodvd -l -r 3
aodvd --help


작성 : 2006.09.19 by 임헌정
http://www.4ellene.net


2006/09/18 22:47 2006/09/18 22:47
Tag //
VPN 모바일 멀티 캐스트 Testbed
[ 설치 순서 ]
1. Mobile IPv6 설치
2. Mipl_dev : MN정보 제공 + 모바일 멀티캐스트 에서 사용
3. 멀티캐스트 설치
4. IPSec 설치
5. Mobile Multicast 설치

VPN_Mobile multocast.zip

소스및 설정파일들



1. Mobile IPv6 설치
참고 : http://4ellene.net/tt/986

2. Mipl_dev 설치
압축 파일의 ctl_api_mipl 을 이용

3. 멀티캐스트 설치
패키지 다운 받기 (mrd6_0.9.5)



mrd6.conf.txt

멀티캐스트v6 설정파일

3.1 참고 사항
- /etc/mrd6.conf
- 각 라우팅 엔트리의 mrib 필수
- 명령어 : mrd6sh show

4. IPSec 설치
패키지 다운 (ipsec-tools 0.6.5)
http://mirror.isp.net.au/ftp/pub/ubuntu/pool/main/i/ipsec-tools/ipsec-tools_0.6.5-4ubuntu1_i386.deb

4.1 각 노드에서 쉘 스크립트로 실행

IPsec_script.txt

IPSec 실행 스크립트

5. Mobile Multicast
압축 파일의 mobile_multicast.tar 이용
BT : HA가 노드의 이동 지역의 라우터까지 터널이용하여 패킷 전달
RS : MN가 이동 지역의 네트워크에 Join메시지를 보내어 이동 지역의 R에게서 멀티캐스트 패킷 수신


구현 : 정수진, 이종혁
작성 : 20060916 by 임헌정
http://www.4ellene.net
2006/09/16 03:45 2006/09/16 03:45
Mobile IPv6 For Linux 설치 하기mipv6-2.0.2용

배포판 : ubuntu 6.06 LTS
커널 : ???

*전반적인 내용은 Mobile IPv6 For Linux 설치 하기 가 같습니다.
단지 파일 명칭만 바뀌었을 뿐입니다. 새 유분트 배포판 6.06에서 잘 작동



[커널 관련 사전작업]

커널 2.6.16 받기 : wget ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.16.tar.gz
앞축 풀기: tar zvfx linux-2.6.16.tar.gz
이동 : mv linux-2.6.16 /usr/src/linux

[MIPv6 프로그램 관련 사전 작업]

MIP프로그램 받기 : wget http://www.mobile-ipv6.org/software/download/mipv6-2.0.2.tar.gz
압축 풀기 : tar zvfx mipv6-2.0.2.tar.gz
이동 : mv mipv6-2.0.2 /usr/src/linux/mipv6-2.0.2

[커널 패치 파일 관련 사전 작업]

커널 패치 받기 : wget http://www.mobile-ipv6.org/software/download/mipv6-2.0.2-linux-2.6.16.patch.gz
이동 : mv mipv6-2.0.2-linux-2.6.16.patch.gz /usr/src/linux/

[커널 패치 하기]

소스 디렉토리 이동 : cd /usr/src/linux
패치 하기 :# zcat mipv6-2.0.2-linux-2.6.16.patch.gz | patch -p1

[컴파일전 .config파일 확인]

make menuconfig
확인 : ./mipv6-2.0.2/chkconf_kernel.sh /usr/src/linux/
수정 : vi .config
재확인 : ./mipv6-2.0.2/chkconf_kernel.sh /usr/src/linux/

[컴파일 하기]

make-kpkg --revision=2.6.16 --initrd binary-arch

[MIPv6설치]

cd /usr/src/linux/mipv6-2.0.2
CPPFLAGS='-isystem /usr/src/linux/include' ./configure --enable-vt
make
make install

* 이전 버전의 설정 파일을 그대로 적용할경우 제대로 작동 하지 않을수도 있다
그럴경우 아래 설정 파일을 참조 하길..

[설정 파일 내용]
/etc/rc.boot/rc.local
/etc/radvd.conf
/usr/local/etc/mip6d.conf
route -A inet6
/etc/network/interfaces

goliath.txt

1번 라우터

siege-tank.txt

3번 라우터

vessel.txt

2번 라우터


valkyrie.txt

2번 노드

vulture.txt

3번 노드

wraith.txt

1번 노드



작성 : 06.08.03 by 임헌정
수정 : 06.08.08 by 이종혁
http://www.4ellene.net
2006/08/08 03:21 2006/08/08 03:21

About the IPv6 Patch for AODV-UU

AODV-UU is a Linux-based implementation for AODV (short for Ad-hoc On-demand Distance Vector Routing) developed at the Uppsala University. The original code is based on IPv4 and can use wireless as well as ordinary network interfaces.

The IPv6 patch for AODV-UU version 0.9 aims to make the source code compilable either for IPv4 or for IPv6 networks. This is done by adding a layer for IP-version abstraction, called iplib. Within the AODV code all types and calls to the Linux kernel or socket interfaces specific to the IP-version are replaced by calls to the respective iplib types and functions.



1. 소스 다운 받기
IPv4 AODV-UU [홈페이지] [소스 0.9 ]
IPv6 AODV-UU [홈페이지] [소스]











참고 링크 : http://webspace.buckingham.ac.uk/cadams/bnrg/aodv6/index.html

2006/06/30 19:29 2006/06/30 19:29
Tag // ,



1. 커널 버젼과 배포판 맞추기

2. 올라와 있는 모듈 맞추기
(모르면 전체 설치 )

3. 컴파일시 참조할 기본 폴더 확인
/usr/src/linux
/usr/include
/usr/include/asm (asm-i386을 링크)

4. 설치할 소스 파일이 원하는 헤더 파일이 유무 확인
#include <net/neighbour.h>
-> /usr/include/net/neighbour.h

5. 관련 논문및 이전 구현물  검색
(keywork : testbed, implement, 데몬, 설정 파일명등)

6. 다른 배포판 상위 커널 버젼에서도 시도 해보기

7. 설정 파일의 내용및 옵션은 모두 알기

2006/06/28 07:55 2006/06/28 07:55
Tag //
NIST Secure AODV over IPv6

hut-aodv에 보안 부분을 추가 한거 같다..

0. 사전 작업

yum install openssl
modprobe ipv6
rmmod <모듈명>
- lsmod로 ip6_nf_aodv, ip6_queue 모듈 올라와 있는지 확인후 내리기

1. 파일 받기

2. 심볼 링크 걸어 주기

cd /usr/src/
ln -s linux-2.4.20-8/ linux

3. 설치 하기

3.1 모듈 컴파일 하기

cd /root/secaod