]> git.ipfire.org Git - thirdparty/strongswan.git/blob - programs/charon/scripts/to-alice.sh
- import of strongswan-2.7.0
[thirdparty/strongswan.git] / programs / charon / scripts / to-alice.sh
1 #!/bin/bash
2
3 # enable ip forwarding for gateway
4 echo 1 > /proc/sys/net/ipv4/ip_forward
5
6 # add connection to alice
7 MY_ADDR=192.168.0.2 # Address of local peer
8 OTHER_ADDR=192.168.0.1 # Address of remote peer
9 MY_ID="C=CH, O=Linux strongSwan, CN=bob" # ID of local peer
10 OTHER_ID="C=CH, O=Linux strongSwan, CN=alice" # ID of remote peer
11 MY_NET=10.2.0.0 # protected local subnet
12 OTHER_NET=10.1.0.0 # protected remote subnet
13 MY_BITS=16 # size of subnet
14 OTHER_BITS=16 # size of subnet
15 CONN_NAME=to-alice # connection name
16
17 bin/stroke add $CONN_NAME "$MY_ID" "$OTHER_ID" $MY_ADDR $OTHER_ADDR $MY_NET $OTHER_NET $MY_BITS $OTHER_BITS
18
19 # initiate
20 i=0
21 LIMIT=1
22
23 while [ "$i" -lt "$LIMIT" ]
24 do
25 bin/stroke up $CONN_NAME
26 let "i += 1"
27 done