#!/bin/sh                                                                  
# Should be run before racoon
#server at office config
ifconfig gif0 >/dev/null 2>&1 || ifconfig gif0 create
gifconfig gif0 192.168.2.23 192.168.2.20
ifconfig gif0 inet 10.1.23.1 10.1.20.1 netmask 255.255.255.0
setkey -FP
setkey -F
setkey -c <<EOF
spdadd 10.1.23.0/24 10.1.20.0/24 any -P out ipsec
esp/tunnel/192.168.2.23-192.168.2.20/require;
spdadd 10.1.20.0/24 10.1.23.0/24 any -P in ipsec
esp/tunnel/192.168.2.20-192.168.2.23/require;
EOF
