aboutsummaryrefslogtreecommitdiffstats
path: root/Source/scripts/to-alice.sh
blob: fa2f84dd00d9b82e23ab766e4d06a7979e6c64ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/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, also used as ID
OTHER_ADDR=192.168.0.1   # Address of remote peer, also used as ID
MY_CERT=bob.der          # own certificate
OTHER_CERT=alice.der     # certificate for 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_ADDR $OTHER_ADDR $MY_CERT $OTHER_CERT \
               $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