OSDN Git Service

2013.10.24
[uclinux-h8/uClinux-dist.git] / freeswan / klips / test / east-lifetime-02 / test01.sh
1 #!/bin/sh
2
3 TZ=GMT export TZ
4
5 ipsec spi --clear
6 ipsec eroute --clear
7
8 enckey=0x4043434545464649494a4a4c4c4f4f515152525454575758
9 authkey=0x87658765876587658765876587658765
10 lifetime="--life soft-bytes=384"
11
12 #ipsec klipsdebug --set pfkey
13 #ipsec klipsdebug --set verbose
14
15 ipsec spi --af inet --edst 192.1.2.45 --spi 0x12345678 --proto esp --src 192.1.2.23 --esp 3des-md5-96 $lifetime --enckey $enckey --authkey $authkey
16
17 ipsec spi --af inet --edst 192.1.2.45 --spi 0x12345678 --proto tun --src 192.1.2.23 --dst 192.1.2.45 --ip4
18
19 ipsec spigrp inet 192.1.2.45 0x12345678 tun inet 192.1.2.45 0x12345678 esp 
20
21 ipsec eroute --add --eraf inet --src 192.0.2.0/24 --dst 192.0.1.0/24 --said tun0x12345678@192.1.2.45
22
23 ipsec tncfg --attach --virtual ipsec0 --physical eth1
24 ifconfig ipsec0 inet 192.1.2.23 netmask 0xffffff00 broadcast 192.1.2.255 up
25
26 arp -s 192.1.2.45 10:00:00:64:64:45
27 arp -s 192.1.2.254 10:00:00:64:64:45
28
29 ipsec look
30
31 # magic route command
32 route add -host 192.0.1.1 gw 192.1.2.45 dev ipsec0
33
34 ipsec pf_key 
35 #