aboutsummaryrefslogtreecommitdiffstats
path: root/src/charon/scripts/to-alice.sh
diff options
context:
space:
mode:
authorMartin Willi <martin@strongswan.org>2006-04-28 10:51:19 +0000
committerMartin Willi <martin@strongswan.org>2006-04-28 10:51:19 +0000
commit1029d84d2365ca6e6b2d2a96e5c0a1fad3c127e3 (patch)
treed7d1152d0651f01f023b4faa09fc51f936f89e60 /src/charon/scripts/to-alice.sh
parent51c3484a9f70f03b2ea73151428a40e785c0c56c (diff)
downloadstrongswan-1029d84d2365ca6e6b2d2a96e5c0a1fad3c127e3.tar.bz2
strongswan-1029d84d2365ca6e6b2d2a96e5c0a1fad3c127e3.tar.xz
Diffstat (limited to 'src/charon/scripts/to-alice.sh')
-rwxr-xr-xsrc/charon/scripts/to-alice.sh27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/charon/scripts/to-alice.sh b/src/charon/scripts/to-alice.sh
new file mode 100755
index 000000000..01ba27f5b
--- /dev/null
+++ b/src/charon/scripts/to-alice.sh
@@ -0,0 +1,27 @@
+#!/bin/bash
+
+# enable ip forwarding for gateway
+echo 1 > /proc/sys/net/ipv4/ip_forward
+
+# add connection to alice
+MY_ADDR=192.168.0.2 # Address of local peer
+OTHER_ADDR=192.168.0.1 # Address of remote peer
+MY_ID="C=CH, O=Linux strongSwan, CN=bob" # ID of local peer
+OTHER_ID="C=CH, O=Linux strongSwan, CN=alice" # ID of remote peer
+MY_NET=10.2.0.0 # protected local subnet
+OTHER_NET=10.1.0.0 # protected remote subnet
+MY_BITS=16 # size of subnet
+OTHER_BITS=16 # size of subnet
+CONN_NAME=to-alice # connection name
+
+bin/stroke add $CONN_NAME "$MY_ID" "$OTHER_ID" $MY_ADDR $OTHER_ADDR $MY_NET $OTHER_NET $MY_BITS $OTHER_BITS
+
+# initiate
+i=0
+LIMIT=1
+
+while [ "$i" -lt "$LIMIT" ]
+do
+ bin/stroke up $CONN_NAME
+ let "i += 1"
+done